/* =====================================================================
   CE Widget — Widget « Barre de filtres (pills) »
   Barre horizontale de facettes ps_facetedsearch, style « okihigh ».
   Couleurs/rayons surchargés par les contrôles de Style du widget.
   ===================================================================== */

.cew-fbar {
  background: #fff;
  border: 1px solid #eceaf0;
  border-radius: 18px;
  padding: 11px 18px;
  box-shadow: 0 8px 24px rgba(23, 23, 28, .05);
  font-family: inherit;
}

/* Rangée principale */
.cew-fbar__main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Groupe (libellé + pills) */
.cew-fbar__group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.cew-fbar__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a889a;
  white-space: nowrap;
}

/* Pilule */
.cew-fbar__pill {
  display: inline-block;
  border: 1px solid #e4e2ea;
  background: transparent;
  color: #3a3944;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  white-space: nowrap;
}
.cew-fbar__pill:hover { border-color: #2e6bf0; color: #2e6bf0; }
.cew-fbar__pill.is-active {
  background: #111117;
  border-color: #111117;
  color: #fff;
  font-weight: 800;
}

/* Bouton « Tous les filtres » */
.cew-fbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #111117;
  background: #111117;
  color: #fff;
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;   /* pas de retour à la ligne → reste une pilule */
  cursor: pointer;
}
.cew-fbar__toggle-caret { transition: transform .18s ease; font-size: 10px; }
.cew-fbar.is-open .cew-fbar__toggle-caret { transform: rotate(180deg); }

/* Tri (poussé à droite) */
.cew-fbar__sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cew-fbar__select {
  background: #f4f3f8;
  border: 1px solid #e7e5ee;
  border-radius: 999px;
  padding: 8px 14px;
  color: #17171c;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cew-fbar__select:focus { outline: none; }

/* Panneau dépliable (facettes secondaires) */
.cew-fbar__panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eceaf0;
}
.cew-fbar__panel[hidden] { display: none; }
.cew-fbar__panel-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cew-fbar__panel-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.cew-fbar__panel-footer--inline { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eceaf0; }
.cew-fbar__reset {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: #8a889a;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cew-fbar__reset:hover { color: #e93a9c; }

/* Interrupteur Disponibilité */
.cew-fbar__switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.cew-fbar__switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d9d7e2;
  position: relative;
  flex-shrink: 0;
  transition: background .18s ease;
}
.cew-fbar__switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s ease;
}
.cew-fbar__switch.is-on .cew-fbar__switch-track { background: #111117; }
.cew-fbar__switch.is-on .cew-fbar__switch-knob { transform: translateX(18px); }
.cew-fbar__switch-label { font-size: 13px; font-weight: 700; }

/* Curseur double (prix / poids) dans la DA */
.cew-fbar__group--range { gap: 10px; }
.cew-fbar__range {
  position: relative;
  width: 160px;
  height: 22px;
  flex-shrink: 0;
}
.cew-fbar__range-track {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 999px;
  background: #e4e2ea;
}
.cew-fbar__range-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
  background: #111117;
}
/* Les deux <input range> se superposent sur la même piste */
.cew-fbar__range input[type="range"] {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  pointer-events: none;      /* seuls les pouces captent la souris */
  -webkit-appearance: none;
  appearance: none;
}
.cew-fbar__range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111117;
  box-shadow: 0 1px 4px rgba(23, 23, 28, .25);
  cursor: pointer;
}
.cew-fbar__range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px; height: 16px;
  border: 2px solid #111117;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(23, 23, 28, .25);
  cursor: pointer;
}
.cew-fbar__range input[type="range"]::-moz-range-track { background: none; }
.cew-fbar__range-out {
  font-size: 12px;
  font-weight: 800;
  color: #17171c;
  white-space: nowrap;
}

/* ------------------------- Responsive / mobile ------------------------- */
/* La 1re rangée défile horizontalement (comme la maquette), le panneau
   déplié passe en colonne classique. */
@media (max-width: 768px) {
  .cew-fbar__main {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;              /* Firefox */
    gap: 12px;
  }
  .cew-fbar__main::-webkit-scrollbar { display: none; } /* WebKit */
  /* Aucun élément ne se comprime → ils défilent au lieu de se déformer. */
  .cew-fbar__group,
  .cew-fbar__toggle,
  .cew-fbar__sort { flex-shrink: 0; }
  .cew-fbar__group { flex-wrap: nowrap; }
  .cew-fbar__sort { margin-left: 0; }   /* reste dans le flux scrollable */
  .cew-fbar__label { white-space: nowrap; }
  .cew-fbar__panel-groups { gap: 14px; }
  .cew-fbar__panel-footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .cew-fbar__pill, .cew-fbar__toggle-caret, .cew-fbar__switch-track, .cew-fbar__switch-knob { transition: none; }
}
