/* =========================================================
   FILTRE WOO AJAX — Style
   Palette : #f5f5f5 / #c9c9c9 / #000 / #fff
   Typography : Cormorant Garamond (titres), Inter (UI)
   ========================================================= */

:root {
  --fwa-bg:        #f5f5f5;
  --fwa-border:    #c9c9c9;
  --fwa-black:     #000000;
  --fwa-white:     #ffffff;
  --fwa-gray:      #888888;
  --fwa-light:     #e8e8e8;
  --fwa-font-ui:   'Inter', 'Helvetica Neue', Arial, sans-serif;
  --fwa-font-title:'Cormorant Garamond', Georgia, serif;
  --fwa-sidebar-w: 280px;
  --fwa-gap:       32px;
  --fwa-radius:    0px;
  --fwa-transition:0.2s ease;
}

/* ── Wrapper global ─────────────────────────────────────── */
.fwa-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--fwa-gap);
  font-family: var(--fwa-font-ui);
  background: var(--fwa-bg);
  padding: 40px 0 40px var(--fwa-wrapper-pl, 0px);
  min-height: 60vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.fwa-sidebar {
  flex: 0 0 var(--fwa-sidebar-w);
  width: var(--fwa-sidebar-w);
  background: var(--fwa-bg);
  padding-right: 24px;
  position: sticky;
  top: 120px;
}

.fwa-title {
  font-family: var(--fwa-font-title);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--fwa-black);
  margin: 0 0 16px;
}

.fwa-divider {
  border: none;
  border-top: 1px solid var(--fwa-border);
  margin: 16px 0;
}

/* ── Section accordéon ──────────────────────────────────── */
.fwa-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0 8px;
  cursor: pointer;
  font-family: var(--fwa-font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fwa-black);
}

.fwa-section-toggle:hover { opacity: 0.6; }

.fwa-icon {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--fwa-transition);
  color: var(--fwa-gray);
}

.fwa-section-toggle[aria-expanded="false"] .fwa-icon--minus {
  transform: rotate(90deg);
}

.fwa-section-body {
  overflow: visible;       /* visible quand ouvert — handles slider non coupés */
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 600px;
  opacity: 1;
}

.fwa-section-body.collapsed {
  overflow: hidden;        /* hidden seulement quand fermé — animation propre */
  max-height: 0;
  opacity: 0;
}

/* ── Sous-catégories — base commune ─────────────────────── */

.fwa-cat-item {
  position: relative;
}

/* Liste sous-catégories : visible par défaut */
.fwa-subcat-list {
  list-style: none;
  margin:  2px 0 4px 0;
  padding: 0;
  overflow: hidden;
  max-height: 200px;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

/* Mode hover : masqué jusqu'au survol */
.fwa-subcat-list--hover {
  max-height:     0;
  opacity:        0;
  pointer-events: none;
}

.fwa-cat-item--has-children:hover .fwa-subcat-list--hover,
.fwa-cat-item--has-children:focus-within .fwa-subcat-list--hover {
  max-height:     200px;
  opacity:        1;
  pointer-events: auto;
}

/* ── Bouton enfant — base ─────────────────────────────────── */
.fwa-cat-btn--child {
  display:     flex;
  align-items: center;
  gap:         6px;
  width:       100%;
  text-align:  left;
  background:  none;
  border:      none;
  padding:     5px 0;
  font-family: var(--fwa-font-ui);
  font-size:   var(--fwa-font-size-base, 13px);
  color:       var(--fwa-gray);
  letter-spacing: 0.01em;
  cursor:      pointer;
  transition:  color 0.2s ease, background 0.2s ease;
}

.fwa-cat-btn--child:hover { color: var(--fwa-black); }

.fwa-cat-btn--child.active {
  color:       var(--fwa-white) !important;
  font-weight: 600;
}

/* ── Style : TIRET ────────────────────────────────────────── */
.fwa-subcat-list--dash {
  padding-left: 10px;
}

.fwa-subcat-list--dash .fwa-cat-btn--child::before {
  content:     '–';
  color:       var(--fwa-border);
  font-size:   11px;
  flex-shrink: 0;
  transition:  color 0.2s ease;
}

.fwa-subcat-list--dash .fwa-cat-btn--child:hover::before,
.fwa-subcat-list--dash .fwa-cat-btn--child.active::before {
  color: currentColor;
}

.fwa-subcat-list--dash .fwa-cat-btn--child.active {
  background:    var(--fwa-black);
  padding-left:  6px;
  padding-right: 6px;
  color:         var(--fwa-white) !important;
}

/* ── Supprimer les bullets — spécificité haute pour écraser Divi ── */
.fwa-wrapper .fwa-subcat-list,
.fwa-wrapper .fwa-subcat-list li,
.fwa-wrapper ul.fwa-subcat-list,
.fwa-wrapper ul.fwa-subcat-list li {
  list-style:      none !important;
  list-style-type: none !important;
  padding-left:    0;
}
.fwa-wrapper .fwa-subcat-list li::before,
.fwa-wrapper .fwa-subcat-list li::marker {
  display: none !important;
  content: '' !important;
}

/* ── Style : LIGNE VERTICALE ─────────────────────────────── */
.fwa-subcat-list--line {
  padding-left:  0;
  border-left:   1px solid var(--fwa-border);
  margin-left:   4px;
}

.fwa-subcat-list--line .fwa-cat-btn--child {
  font-size:    12px;
  color:        #aaa;
  padding-left: 10px;  /* espace entre trait et texte */
  border-radius: 0 2px 2px 0;
}

.fwa-subcat-list--line .fwa-cat-btn--child:hover {
  color:      var(--fwa-black);
  background: var(--fwa-light); /* gris doux au survol */
}

.fwa-subcat-list--line .fwa-cat-btn--child.active {
  color:        var(--fwa-white) !important;
  background:   var(--fwa-black);
  padding-left: 10px;
}

/* ── Style : CHIPS ────────────────────────────────────────── */
.fwa-subcat-list--chip {
  padding-left: 12px;
  margin-top:   2px;
}

.fwa-subcat-list--chip .fwa-cat-btn--child {
  background:    #ebebeb;
  border-radius: 2px;
  padding:       4px 8px;
  margin:        2px 0;
  font-size:     11px;
  color:         #888;
}

.fwa-subcat-list--chip .fwa-cat-btn--child:hover {
  background: #d8d8d8;
  color:      var(--fwa-black);
}

.fwa-subcat-list--chip .fwa-cat-btn--child.active {
  background:    var(--fwa-black) !important;
  color:         var(--fwa-white) !important;
}

/* Point décoratif dans les chips */
.fwa-chip-dot {
  width:        4px;
  height:       4px;
  border-radius: 50%;
  background:   currentColor;
  flex-shrink:  0;
  opacity:      0.6;
}

/* ── Liste catégories ───────────────────────────────────── */
.fwa-category-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
}

.fwa-category-list li { margin: 0; }

.fwa-cat-btn {
  background: none;
  border: none;
  padding: 5px 0;
  cursor: pointer;
  font-family: var(--fwa-font-ui);
  font-size: 13px;
  color: var(--fwa-gray);
  letter-spacing: 0.01em;
  transition: color var(--fwa-transition);
  display: block;
  width: 100%;
  text-align: left;
}

.fwa-cat-btn:hover,
.fwa-cat-btn.active {
  color: var(--fwa-black);
  font-weight: 600;
}

/* ── Slider prix ────────────────────────────────────────── */
#fwa-price-slider {
  margin: 12px 0 8px;
  width: calc(var(--fwa-slider-width, 100%) - 8px);
  /* padding horizontal : laisse de la place pour les handles aux extrémités */
  padding: 0 1px;
  box-sizing: border-box;
}

/* Override noUiSlider */
.noUi-target {
  background: var(--fwa-light);
  border: none;
  box-shadow: none;
  border-radius: 0;
  height: 2px;
}

.noUi-connect {
  background: var(--fwa-black);
}

.noUi-handle {
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  background: var(--fwa-black) !important;
  border: none !important;
  box-shadow: none !important;
  top: -6px !important;
  cursor: grab;
}

.noUi-handle::before,
.noUi-handle::after { display: none !important; }

.noUi-handle:active { cursor: grabbing; }

.fwa-price-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fwa-gray);
  margin-top: 10px;
  letter-spacing: 0.02em;
}

/* ── Checkboxes taille ──────────────────────────────────── */
.fwa-size-list {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0;
}

.fwa-size-list li { margin: 0; }

.fwa-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
}

.fwa-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fwa-checkbox-box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--fwa-border);
  background: var(--fwa-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fwa-transition);
}

.fwa-checkbox input:checked + .fwa-checkbox-box {
  background: var(--fwa-black);
  border-color: var(--fwa-black);
}

.fwa-checkbox input:checked + .fwa-checkbox-box::after {
  content: '';
  display: block;
  width: 9px;
  height: 5px;
  border-left: 1.5px solid var(--fwa-white);
  border-bottom: 1.5px solid var(--fwa-white);
  transform: rotate(-45deg) translateY(-1px);
}

.fwa-checkbox-label {
  font-size: 13px;
  color: var(--fwa-gray);
  transition: color var(--fwa-transition);
  letter-spacing: 0.01em;
}

.fwa-checkbox:hover .fwa-checkbox-label,
.fwa-checkbox input:checked ~ .fwa-checkbox-label {
  color: var(--fwa-black);
}

/* ── Bouton effacer ─────────────────────────────────────── */
.fwa-reset {
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-family: var(--fwa-font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fwa-gray);
  transition: color var(--fwa-transition);
  margin-top: 4px;
}

.fwa-reset:hover { color: var(--fwa-black); }

/* ── Zone principale ────────────────────────────────────── */
.fwa-main { flex: 1; min-width: 0; }

/* ── Toolbar tri ────────────────────────────────────────── */
.fwa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fwa-border);
}

.fwa-count {
  font-size: 12px;
  color: var(--fwa-gray);
  letter-spacing: 0.05em;
}

.fwa-sort-wrapper { position: relative; }

.fwa-sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--fwa-white);
  border: 1px solid var(--fwa-border);
  padding: 9px 16px;
  cursor: pointer;
  font-family: var(--fwa-font-ui);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fwa-black);
  transition: border-color var(--fwa-transition);
  min-width: 200px;
  justify-content: space-between;
}

.fwa-sort-btn:hover { border-color: var(--fwa-black); }

.fwa-chevron {
  transition: transform var(--fwa-transition);
  flex-shrink: 0;
}

.fwa-sort-btn[aria-expanded="true"] .fwa-chevron {
  transform: rotate(180deg);
}

.fwa-sort-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--fwa-white);
  border: 1px solid var(--fwa-border);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 220px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: none;
}

.fwa-sort-dropdown.open { display: block; }

.fwa-sort-header {
  padding: 12px 16px 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fwa-gray);
  border-bottom: 1px solid var(--fwa-light);
  cursor: default;
}

.fwa-sort-option {
  padding: 11px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--fwa-black);
  transition: background var(--fwa-transition);
  letter-spacing: 0.01em;
}

.fwa-sort-option:hover { background: var(--fwa-bg); }

.fwa-sort-option.active {
  background: var(--fwa-bg);
  font-weight: 600;
}

/* ── Grille produits ────────────────────────────────────── */
.fwa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 20px;
}

.fwa-wrapper[data-columns="2"] .fwa-grid { grid-template-columns: repeat(2, 1fr); }
.fwa-wrapper[data-columns="4"] .fwa-grid { grid-template-columns: repeat(4, 1fr); }

/* ── Produit card ───────────────────────────────────────── */
.fwa-product { }

.fwa-product-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.fwa-product-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--fwa-white);
  aspect-ratio: 3/4;
}

.fwa-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.fwa-product-link:hover .fwa-product-img {
  transform: scale(1.04);
}

.fwa-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  font-family: var(--fwa-font-ui);
}

.fwa-badge--sale {
  background: var(--fwa-black);
  color: var(--fwa-white);
}

.fwa-badge--out {
  background: var(--fwa-border);
  color: var(--fwa-black);
}

.fwa-product-info {
  padding: 12px 0 0;
}

.fwa-product-cat {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fwa-gray);
  margin: 0 0 4px;
}

.fwa-product-name {
  font-family: var(--fwa-font-title);
  font-size: 17px;
  font-weight: 400;
  color: var(--fwa-black);
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.fwa-product-price {
  font-size: 13px;
  color: var(--fwa-black);
  margin: 0;
  letter-spacing: 0.02em;
}

.fwa-product-price .woocommerce-Price-amount { font-weight: 500; }
.fwa-product-price ins { text-decoration: none; }
.fwa-product-price del { color: var(--fwa-gray); margin-right: 6px; }

/* ── Loading spinner ────────────────────────────────────── */
.fwa-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 80px 0;
  grid-column: 1 / -1;
}

.fwa-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fwa-black);
  animation: fwa-pulse 1.2s ease-in-out infinite;
}

.fwa-loading span:nth-child(2) { animation-delay: 0.2s; }
.fwa-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes fwa-pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1.1); }
}

/* ── Message vide ───────────────────────────────────────── */
.fwa-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  font-family: var(--fwa-font-title);
  font-size: 20px;
  color: var(--fwa-gray);
  font-style: italic;
}

/* ── Pagination ─────────────────────────────────────────── */
.fwa-pagination { margin-top: 48px; }

.fwa-pages {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.fwa-page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--fwa-border);
  background: var(--fwa-white);
  cursor: pointer;
  font-family: var(--fwa-font-ui);
  font-size: 13px;
  color: var(--fwa-black);
  transition: all var(--fwa-transition);
}

.fwa-page-btn:hover,
.fwa-page-btn.active {
  background: var(--fwa-black);
  border-color: var(--fwa-black);
  color: var(--fwa-white);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .fwa-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .fwa-wrapper {
    flex-direction: column;
    padding: 24px 0;
  }

  .fwa-sidebar {
    flex: unset;
    width: 100%;
    padding-right: 0;
    position: static;
  }

  /* Sidebar rétractable sur mobile */
  .fwa-sidebar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--fwa-white);
    border: 1px solid var(--fwa-border);
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    width: 100%;
    font-family: var(--fwa-font-ui);
  }

  .fwa-sidebar-inner {
    display: none;
  }

  .fwa-sidebar-inner.open {
    display: block;
  }

  .fwa-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 12px;
  }

  .fwa-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .fwa-sort-btn { min-width: unset; width: 100%; }
  .fwa-sort-wrapper { width: 100%; }
  .fwa-sort-dropdown { min-width: unset; width: 100%; right: unset; left: 0; }
}

@media (max-width: 480px) {
  .fwa-grid {
    grid-template-columns: 1fr !important;
  }
}
