/* Shared KOMAVO choices: native form semantics, a restrained custom surface. */
:root {
  --komavo-select-paper: #fff;
  --komavo-select-ink: #262521;
  --komavo-select-muted: #8a877f;
  --komavo-select-line: #dedbd4;
  --komavo-select-soft: #f5f4f0;
  --komavo-select-hover: #eeece6;
  --komavo-select-shadow: 0 12px 34px rgb(38 35 26 / 12%), 0 2px 6px rgb(38 35 26 / 4%);
}

select.k-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.k-select {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
  text-align: start;
  font-family: inherit;
}

.k-select .k-select-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--komavo-select-line);
  border-radius: 2px;
  background: var(--komavo-select-paper);
  color: var(--komavo-select-ink);
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-align: start;
  text-transform: none;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.k-select .k-select-trigger:hover { border-color: #aaa497; }
.k-select .k-select-trigger:focus-visible { outline: 2px solid var(--komavo-select-ink); outline-offset: 3px; }
.k-select.is-open .k-select-trigger { border-color: #8b8578; }
.k-select-value { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.k-select.is-placeholder .k-select-value { color: var(--komavo-select-muted); }
.k-select-arrow {
  display: block;
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin: -4px 2px 0 4px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 150ms ease, margin 150ms ease;
}
.k-select.is-open .k-select-arrow { margin-top: 3px; transform: rotate(225deg); }
.k-select.is-disabled .k-select-trigger { opacity: .55; cursor: not-allowed; background: var(--komavo-select-soft); }
.k-select .k-select-trigger[aria-invalid="true"] { border-color: #ac4b3d; }
.k-select-error { display: block; margin-top: 7px; color: #a04033; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.k-select-error[hidden], .k-select-popup[hidden] { display: none !important; }

.k-select-popup {
  box-sizing: border-box;
  position: fixed;
  z-index: 10050;
  max-width: calc(100vw - 20px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--komavo-select-line);
  border-radius: 3px;
  background: var(--komavo-select-paper);
  color: var(--komavo-select-ink);
  box-shadow: var(--komavo-select-shadow);
  font-family: "Montserrat", "Noto Sans", sans-serif;
  font-size: 12px;
  line-height: 1.6;
  text-align: start;
  scrollbar-width: thin;
  scrollbar-color: #ccc6ba transparent;
}
.k-select-popup::-webkit-scrollbar { width: 5px; }
.k-select-popup::-webkit-scrollbar-thumb { background: #ccc6ba; border-radius: 3px; }
.k-select-popup .k-select-options { position: relative; display: block; margin: 0; padding: 6px; list-style: none; }
.k-select-popup .k-select-option {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 1px;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
  line-height: 1.6;
  list-style: none;
  transition: background-color 100ms ease;
}
.k-select-option-text { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.k-select-popup .k-select-option[aria-selected="true"] { background: var(--komavo-select-soft); font-weight: 500; }
.k-select-popup .k-select-option.is-active { background: var(--komavo-select-hover); }
.k-select-check { visibility: hidden; flex: 0 0 7px; width: 7px; height: 11px; margin: -3px 3px 0 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.k-select-option[aria-selected="true"] .k-select-check { visibility: visible; }
.k-select-popup .k-select-option[aria-disabled="true"] { color: var(--komavo-select-muted); opacity: .55; cursor: not-allowed; background: transparent; }
.k-select-popup .k-select-group { display: block; margin: 0; padding: 13px 12px 5px; color: var(--komavo-select-muted); font-size: 10px; font-weight: 500; line-height: 1.6; letter-spacing: .04em; list-style: none; }
.k-select-popup .k-select-group:not(:first-child) { margin-top: 5px; border-top: 1px solid var(--komavo-select-line); }
.k-select-popup .k-select-empty { margin: 0; padding: 14px 12px; list-style: none; color: var(--komavo-select-muted); }

.currency-selector .k-select { width: 174px; flex: 0 1 174px; }
.currency-selector .k-select .k-select-trigger { min-height: 38px; padding: 8px 11px; font-size: 10px; }
.catalogue-sort .k-select { width: 210px; }
.catalogue-sort .k-select .k-select-trigger { font-size: 11px; }
.product-variants .k-select .k-select-trigger { min-height: 50px; }
.form-inline .k-select, .actions .k-select { width: auto; min-width: 130px; max-width: 100%; }
.form-inline .form-group .k-select { width: 100%; }

/* Existing Select2 keeps its search, AJAX and multiselect behaviour. */
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  min-height: 44px !important;
  height: auto !important;
  border: 1px solid var(--komavo-select-line) !important;
  border-radius: 2px !important;
  background: var(--komavo-select-paper) !important;
  color: var(--komavo-select-ink) !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}
.select2-container .select2-selection--single .select2-selection__rendered { display: block; padding: 11px 35px 10px 13px !important; color: var(--komavo-select-ink) !important; font-size: 12px !important; line-height: 1.6 !important; }
.komavo-dashboard .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 1.6 !important; }
.select2-container .select2-selection--single .select2-selection__arrow { top: 0 !important; right: 12px !important; height: 100% !important; width: 10px !important; }
.select2-container .select2-selection--single .select2-selection__arrow b { top: 50% !important; left: 1px !important; width: 7px !important; height: 7px !important; margin: -5px 0 0 !important; border: 0 !important; border-right: 1px solid var(--komavo-select-ink) !important; border-bottom: 1px solid var(--komavo-select-ink) !important; transform: rotate(45deg); }
.select2-container--open .select2-selection--single .select2-selection__arrow b { margin-top: -1px !important; transform: rotate(225deg); }
.select2-container--focus .select2-selection, .select2-container--open .select2-selection { border-color: #8b8578 !important; box-shadow: none !important; }
.select2-container .select2-selection__placeholder { color: var(--komavo-select-muted) !important; }
.select2-container--disabled .select2-selection { opacity: .55; background: var(--komavo-select-soft) !important; }
.select2-container .select2-selection--multiple .select2-selection__rendered { padding: 4px 8px !important; }
.select2-container .select2-selection--multiple .select2-selection__choice { margin: 3px 5px 3px 0 !important; padding: 4px 8px !important; border: 1px solid var(--komavo-select-line) !important; border-radius: 2px !important; background: var(--komavo-select-soft) !important; color: var(--komavo-select-ink) !important; font-size: 11px !important; }
.select2-container .select2-selection--multiple .select2-selection__choice__remove { color: var(--komavo-select-muted) !important; }
.select2-container .select2-search--inline .select2-search__field { color: var(--komavo-select-ink) !important; font-family: inherit !important; }
.select2-container .select2-dropdown { box-sizing: border-box; max-width: calc(100vw - 20px); overflow: hidden; border: 1px solid var(--komavo-select-line) !important; border-radius: 3px !important; background: var(--komavo-select-paper) !important; color: var(--komavo-select-ink) !important; box-shadow: var(--komavo-select-shadow) !important; font-family: "Montserrat", "Noto Sans", sans-serif; font-size: 12px; }
.select2-container--open { z-index: 10050; }
.komavo-dashboard .select2-container:has(> .select2-dropdown), .crm-panel .select2-container:has(> .select2-dropdown) { width: auto !important; max-width: calc(100vw - 20px); }
.select2-container .select2-search--dropdown { padding: 10px !important; }
.select2-container .select2-search--dropdown .select2-search__field { min-height: 38px; padding: 8px 10px !important; border: 1px solid var(--komavo-select-line) !important; border-radius: 1px !important; background: var(--komavo-select-paper) !important; color: var(--komavo-select-ink) !important; outline-offset: 2px; font-family: inherit !important; font-size: 13px !important; }
.select2-container .select2-results > .select2-results__options { max-height: min(320px, 55vh) !important; padding: 6px !important; scrollbar-width: thin; }
.select2-container .select2-results__option { min-height: 42px; padding: 10px 12px !important; color: var(--komavo-select-ink) !important; font-size: 12px !important; line-height: 1.6 !important; overflow-wrap: anywhere; }
.select2-container .select2-results__option[aria-selected="true"], .select2-container .select2-results__option--selected { position: relative; padding-right: 34px !important; background: var(--komavo-select-soft) !important; font-weight: 500; }
.select2-container .select2-results__option[aria-selected="true"]::after, .select2-container .select2-results__option--selected::after { position: absolute; top: 16px; right: 16px; width: 6px; height: 10px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); content: ""; }
.select2-container .select2-results__option--highlighted[aria-selected], .select2-container .select2-results__option--highlighted.select2-results__option--selectable { background: var(--komavo-select-hover) !important; color: var(--komavo-select-ink) !important; }
.select2-container .select2-results__option[aria-disabled="true"], .select2-container .select2-results__option--disabled { color: var(--komavo-select-muted) !important; opacity: .55; }
.select2-container .select2-results__group { padding: 12px 12px 4px !important; color: var(--komavo-select-muted) !important; font-size: 10px !important; font-weight: 500 !important; letter-spacing: .04em; }

html[data-theme="dark"] {
  --komavo-select-paper: #20201e;
  --komavo-select-ink: #eeeae3;
  --komavo-select-muted: #aba69b;
  --komavo-select-line: #514d45;
  --komavo-select-soft: #2a2925;
  --komavo-select-hover: #38352f;
  --komavo-select-shadow: 0 12px 34px rgb(0 0 0 / 30%);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] { --komavo-select-paper: #20201e; --komavo-select-ink: #eeeae3; --komavo-select-muted: #aba69b; --komavo-select-line: #514d45; --komavo-select-soft: #2a2925; --komavo-select-hover: #38352f; --komavo-select-shadow: 0 12px 34px rgb(0 0 0 / 30%); }
}
@media (max-width: 767px) {
  .k-select .k-select-trigger { min-height: 46px; padding: 11px 13px; font-size: 13px; }
  .k-select-popup { font-size: 13px; }
  .k-select-popup .k-select-option { min-height: 46px; padding: 11px 12px; }
  .mobile-navigation .currency-selector .k-select { width: 192px; flex-basis: 192px; }
  .mobile-navigation .currency-selector .k-select .k-select-trigger { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  .catalogue-sort .k-select { width: min(180px, 49vw); }
  .catalogue-sort .k-select .k-select-trigger { padding-inline: 10px; font-size: 10px; gap: 9px; }
  .select2-container .select2-search--dropdown .select2-search__field { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .k-select .k-select-trigger, .k-select-arrow, .k-select-popup .k-select-option { transition: none; }
}
