/* Hunter Store — themed select component. */

.ns-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.ns-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.ns-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-card, var(--surface, var(--paper-soft)));
  color: var(--ink);
  font: 500 14px/1.35 var(--font-body);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(13, 30, 65, .03);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ns-select-trigger:hover { border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.ns-select-trigger:focus-visible,
.ns-select.is-open .ns-select-trigger {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-wash);
}
.ns-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-select-caret {
  position: absolute;
  right: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  pointer-events: none;
}
.ns-select-caret::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease, border-color .18s ease;
}
.ns-select.is-open .ns-select-caret::before {
  margin-top: 4px;
  transform: rotate(225deg);
  border-color: var(--blue);
}
.ns-select.is-disabled { opacity: .55; }
.ns-select.is-disabled .ns-select-trigger { cursor: not-allowed; }

.ns-select-menu {
  position: fixed;
  z-index: 1200;
  max-height: min(330px, 60vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-card, var(--surface, var(--paper-soft)));
  box-shadow: 0 24px 54px -28px rgba(9, 30, 70, .48), 0 8px 18px -12px rgba(9, 30, 70, .22);
  overscroll-behavior: contain;
}
.ns-select-menu[hidden] { display: none !important; }
.ns-select-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 37px;
  padding: 8px 32px 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font: 500 13px/1.4 var(--font-body);
  text-align: left;
  cursor: pointer;
}
.ns-select-option:hover,
.ns-select-option:focus-visible {
  background: var(--blue-wash);
  color: var(--ink);
  outline: none;
}
.ns-select-option.is-selected {
  background: var(--blue-wash);
  color: var(--blue);
  font-weight: 650;
}
.ns-select-option.is-selected::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 5px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(42deg);
}
.ns-select-option:disabled { opacity: .45; cursor: not-allowed; }

/* Compact contexts */
.store-sort .ns-select,
.adm-inline-form .ns-select {
  display: inline-block;
  width: auto;
  vertical-align: middle;
}
.store-sort .ns-select { min-width: 168px; }
.store-sort .ns-select-trigger {
  min-height: 36px;
  padding: 6px 34px 6px 11px;
  border-radius: 10px;
  font-size: 11.5px;
}
.store-sort .ns-select-caret { right: 11px; }

.adm-inline-form .ns-select { min-width: 116px; }
.adm-inline-form .ns-select-trigger {
  min-height: 32px;
  padding: 5px 29px 5px 9px;
  border-radius: 7px;
  font-size: 11px;
}
.adm-inline-form .ns-select-caret { right: 9px; }
.adm-inline-form .ns-select-menu { font-size: 12px; }
.adm-inline-form .ns-select-option { min-height: 32px; padding-block: 5px; font-size: 12px; }

.adm-toolbar .ns-select { min-width: 142px; width: auto; }
.adm-toolbar .ns-select-trigger { min-height: 42px; padding: 8px 36px 8px 12px; border-radius: 10px; font-size: 13px; }

@media (max-width: 640px) {
  .ns-select-trigger { min-height: 44px; font-size: 13px; }
  .ns-select-menu { max-height: min(280px, 55vh); }
  .store-sort .ns-select { min-width: 0; width: 100%; }
}
