/**
 * Sélecteur filtrable — habillage de fcg-searchable-select.js
 *
 * Le champ visible reprend l'apparence du <select> qu'il remplace : l'utilisateur
 * ne doit pas avoir l'impression de changer de type de contrôle, seulement de
 * gagner une recherche.
 */

.fcg-ss {
  position: relative;
  display: block;
}

/* Le <select> natif reste dans le document (POST, lecteurs d'écran, code existant)
   mais disparaît visuellement. On évite display:none, qui le retirerait de
   l'arbre d'accessibilité et du formulaire dans certains navigateurs. */
.fcg-ss__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.fcg-ss__input {
  width: 100%;
  cursor: pointer;
  /* L'input hérite des classes du <select> d'origine (.fcg-select…), donc de
     son chevron en background — qui se superposait au caret du composant.
     !important : dans le héros, « .fcg-hero__panel .fixed_select » est plus
     spécifique et remettait le second chevron. Un seul chevron : celui du
     composant, qui pivote à l'ouverture. */
  background-image: none !important;
}
.fcg-ss__input::placeholder {
  color: #6a7787;
  opacity: 1;
}
/* Une valeur choisie se lit comme une valeur, pas comme une suggestion. */
.fcg-ss__input.is-chosen {
  font-weight: 600;
  color: #0f1c2e;
}

/* Chevron : reprend le repère visuel d'une liste déroulante */
.fcg-ss__caret {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  pointer-events: auto;
  cursor: pointer;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%230a1e44' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform .18s ease;
}
.fcg-ss__input[aria-expanded="true"] ~ .fcg-ss__caret {
  transform: rotate(180deg);
}

/* ── Liste filtrée ────────────────────────────────────────────────────── */
.fcg-ss__list {
  position: absolute;
  z-index: 70;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cfdae7;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 28, 46, 0.18);
  -webkit-overflow-scrolling: touch;
}
.fcg-ss__list[hidden] {
  display: none;
}

.fcg-ss__list li {
  display: flex;
  align-items: center;
  min-height: 44px;      /* confort tactile */
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f1c2e;
  cursor: pointer;
  line-height: 1.3;
}
.fcg-ss__list li:hover,
.fcg-ss__list li.is-active {
  background: #eaf3fb;
}
/* Repère non chromatique de l'option survolée au clavier */
.fcg-ss__list li.is-active {
  box-shadow: inset 3px 0 0 #12557f;
}
/* Valeur actuellement retenue */
.fcg-ss__list li.is-current {
  font-weight: 700;
  color: #12557f;
}
.fcg-ss__list li.is-current::after {
  content: '✓';
  margin-left: auto;
  padding-left: 10px;
  font-weight: 700;
}

.fcg-ss__empty {
  padding: 12px;
  font-size: 0.88rem;
  color: #556475;
  cursor: default;
}

.fcg-ss__status {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #556475;
  min-height: 1em;
}
.fcg-ss__status:empty {
  margin: 0;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .fcg-ss__caret { transition: none; }
}
