/* Selects: the closed control (all .form-control / .custom-select selects) and the searchable
   dropdown panel drawn by dist/js/gk-select.js. Spacing/direction of the closed control live in
   base-ui.css; this file only adds the look. */
:root {
  --gk-select-border: #d9dee7;
  --gk-select-border-hover: #b9c1cf;
  --gk-select-accent: var(--aureum-gold, #C79A2B);
  --gk-select-ring: var(--gk-ui-focus, 0 0 0 3px rgba(199, 154, 43, 0.24));
  --gk-select-text: var(--aureum-text, #172033);
  --gk-select-muted: var(--aureum-text-muted, #98A2B3);
  --gk-select-hover: #f4f5f8;
  --gk-select-active: #fbf5e6;
  --gk-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
}

/* ---- Closed control ------------------------------------------------------- */
select.form-control:not([multiple]):not([size]),
select.custom-select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--gk-select-chevron);
  background-repeat: no-repeat;
  background-size: 15px 15px;
  border-color: var(--gk-select-border);
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  color: var(--gk-select-text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

select.form-control:not([multiple]):not([size]):hover:not(:disabled),
select.custom-select:not([multiple]):not([size]):hover:not(:disabled) {
  border-color: var(--gk-select-border-hover);
}

select.form-control:not([multiple]):not([size]):focus,
select.custom-select:not([multiple]):not([size]):focus,
select.gk-select-open {
  border-color: var(--gk-select-accent);
  box-shadow: var(--gk-select-ring);
  outline: 0;
}

select.form-control:not([multiple]):not([size]):disabled,
select.custom-select:not([multiple]):not([size]):disabled {
  background-color: #f2f4f7;
  color: #8a94a6;
  cursor: not-allowed;
  opacity: 1;
}

select.form-control-sm:not([multiple]):not([size]) {
  border-radius: 0.375rem;
  background-size: 13px 13px;
}

/* The rules above out-rank Bootstrap's validation classes; keep its red border.
   (base-ui's .gk-invalid is already !important.) */
select.is-invalid,
.was-validated select:invalid {
  border-color: #dc3545 !important;
}

/* ---- Dropdown panel -------------------------------------------------------- */
.gk-select-pop {
  position: fixed;
  z-index: 2050;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 0.6rem;
  box-shadow: 0 12px 32px -6px rgba(16, 24, 40, 0.18), 0 4px 8px -4px rgba(16, 24, 40, 0.08);
  color: var(--gk-select-text);
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: start;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.gk-select-pop.is-above {
  transform: translateY(4px) scale(0.98);
  transform-origin: bottom center;
}

.gk-select-pop.is-open {
  opacity: 1;
  transform: none;
}

.gk-select-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  padding: 0 0.75rem;
  border-bottom: 1px solid #eef0f3;
  color: var(--gk-select-muted);
}

.gk-select-search svg {
  flex: none;
}

.gk-select-search input {
  flex: 1;
  min-width: 0;
  height: 2.5rem;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--gk-select-text);
  font: inherit;
  text-align: start;
}

.gk-select-search input::placeholder {
  color: var(--gk-select-muted);
}

.gk-select-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
  outline: 0;
}

.gk-select-group {
  padding: 0.5rem 0.6rem 0.25rem;
  color: var(--gk-select-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gk-select-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.gk-select-item.is-active {
  background: var(--gk-select-hover);
}

.gk-select-item.is-selected {
  background: var(--gk-select-active);
  font-weight: 600;
}

.gk-select-item.is-selected.is-active {
  background: #f6ecd3;
}

.gk-select-item.is-blank .gk-select-label {
  color: var(--gk-select-muted);
}

.gk-select-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gk-select-check {
  display: inline-flex;
  flex: none;
  width: 15px;
  color: var(--gk-select-accent);
}

.gk-select-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.gk-select-empty {
  padding: 1.25rem 0.75rem;
  color: var(--gk-select-muted);
  text-align: center;
}

.gk-select-foot {
  flex: none;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
  color: var(--gk-select-muted);
  font-size: 0.75rem;
}

.gk-select-list::-webkit-scrollbar {
  width: 8px;
}

.gk-select-list::-webkit-scrollbar-thumb {
  background: #d5dae2;
  border: 2px solid #fff;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .gk-select-pop,
  .gk-select-pop.is-above {
    transition: none;
    transform: none;
  }
}

@media print {
  .gk-select-pop {
    display: none !important;
  }
}
