/* select_autocomplete.css — typeahead combobox styling. */

.sac-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* The original <select> stays in the DOM so the form submits its value,
   but is visually hidden once a combobox is wrapping it. */
.sac-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  /* Keep it visible to required-field validation by leaving display alone. */
}

/* Text input that replaces the <select> visually. Tries to match the
   existing form-input look (padding, border, font). */
.sac-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--slate-300, #cbd5e1);
  border-radius: 6px;
  font: inherit;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
    no-repeat right 8px center;
  box-sizing: border-box;
}
.sac-input:focus {
  outline: none;
  border-color: var(--primary-500, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sac-list {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 6px;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  font-size: 13px;
}
.sac-list.sac-open { display: block; }

.sac-option {
  padding: 6px 12px;
  cursor: pointer;
  line-height: 1.4;
  color: var(--slate-800, #1e293b);
}
.sac-option:hover { background: var(--slate-50, #f8fafc); }
.sac-option.sac-active {
  background: var(--primary-500, #3b82f6);
  color: white;
}

.sac-empty {
  padding: 10px 12px;
  color: var(--slate-500, #64748b);
  font-style: italic;
  text-align: center;
  cursor: default;
}

.sac-more {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--slate-500, #64748b);
  border-top: 1px solid var(--slate-100, #f1f5f9);
  text-align: center;
  cursor: default;
}

/* Print: keep the chosen value visible, hide the dropdown chrome. */
@media print {
  .sac-list { display: none !important; }
  .sac-input { border: none; background-image: none; padding-left: 0; }
}
