/**
 * =============================================================================
 * FILTRES DE PRODUITS - STYLES COMPLETS
 * =============================================================================
 * Organisation:
 * 1. Styles de base des filtres
 * 2. Filtres de marques et promotions
 * 3. Filtre de prix (inputs + sliders)
 * 4. Sidebar desktop sticky
 * 5. Drawer mobile
 * 6. Indicateurs de chargement
 * 7. Encart publicitaire
 * 8. Badge stock faible
 * =============================================================================
 */

/* =============================================================================
   1. STYLES DE BASE DES FILTRES
   ============================================================================= */

.category-filter-sidebar .filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid var(--wp--preset--color--color-text);
  padding-bottom: 10px;
  margin-bottom: 20px;
  margin-top: 20px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.category-filter-sidebar .filter-title:hover {
  color: var(--wp--preset--color--color-1);
}

.category-filter-sidebar .filter-title .toggle-icon {
  color: var(--wp--preset--color--color-1);
  transition: transform 0.3s ease;
}

/* Fleche : vers le bas fermee, vers le haut ouverte (product-filters.js). */
.category-filter-sidebar .filter-section.open > .filter-title .toggle-icon {
  transform: rotate(180deg);
}

/* Section qui filtre la liste : titre rose et nombre de filtres actifs. */
.category-filter-sidebar .filter-section.has-actif > .filter-title {
  color: var(--wp--preset--color--color-1);
}

.category-filter-sidebar .filter-title__actifs {
  margin-left: auto;
  margin-right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--wp--preset--color--color-1);
  color: #fff;
  font-size: 0.75rem;
  line-height: 20px;
  text-align: center;
}

.category-filter-sidebar .filter-title__actifs:empty {
  display: none;
}

.category-filter-sidebar .filter-content ul {
  padding-left: 0;
  list-style-type: none;
  margin-bottom: 25px;
}

.category-filter-sidebar .filter-content ul li {
  margin-bottom: 15px;
}

.category-filter-sidebar .filter-content ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  gap: 10px;
  font-weight: 400;
  transition: all 0.2s ease;
}

.category-filter-sidebar .filter-content ul li a .product-count {
  text-transform: inherit;
  font-size: 0.875rem;
  background-color: #e9ecef;
  padding: 5px 15px;
  border-radius: 25px;
  text-align: center;
}

/* =============================================================================
   2. FILTRES DE MARQUES ET PROMOTIONS
   ============================================================================= */

.brand-list,
.subcat-filter-list,
.promotion-list {
  padding-left: 0;
  list-style-type: none;
  margin-bottom: 25px;
}

.brand-list li,
.subcat-filter-list li,
.promotion-list li {
  margin-bottom: 15px;
}

.brand-list li a,
.subcat-filter-list li a,
.promotion-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  gap: 10px;
  font-weight: 400;
  text-decoration: none;
  color: inherit;
  padding: 5px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.promotion-list li a {
  background-color: var(--wp--preset--color--color-6);
  color: var(--wp--preset--color--color-1);
  font-weight: 600 !important;
  justify-content: center !important;
}

.brand-list li a:hover,
.subcat-filter-list li a:hover,
.promotion-list li a:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
}

.brand-list li a.active,
.subcat-filter-list li a.active,
.promotion-list li a.active {
  background-color: var(--wp--preset--color--color-1);
  color: white;
  transform: translateX(5px);
}

.brand-list li a .product-count,
.subcat-filter-list li a .product-count {
  text-transform: inherit;
  font-size: 0.75rem;
  background-color: #e9ecef;
  padding: 5px 15px;
  border-radius: 25px;
  text-align: center;
}

.brand-list li a.active .product-count,
.subcat-filter-list li a.active .product-count {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--wp--preset--color--color-1);
  font-weight: 600;
}

/* =============================================================================
   3. FILTRE DE PRIX - INPUTS ET SLIDERS
   ============================================================================= */

/* --- Container principal --- */
.price-range-container {
  padding: 20px 0;
}

/* --- Inputs de prix --- */
.price-inputs-modern {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.price-field {
  flex: 1;
  min-width: 120px;
}

.price-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wp--preset--color--color-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.price-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.price-input-container:hover {
  border-color: var(--wp--preset--color--color-1);
  box-shadow: 0 0 0 4px rgba(230, 44, 161, 0.1);
}

.price-input-container:focus-within {
  border-color: var(--wp--preset--color--color-1);
  box-shadow: 0 0 0 4px rgba(230, 44, 161, 0.15);
}

.price-currency {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--wp--preset--color--color-1);
  color: white;
  font-weight: 400;
  font-size: 0.875rem;
  height: 40px;
  min-width: 40px;
}

.price-input-container input[type="number"] {
  flex: 1;
  border: none;
  padding: 15px 16px;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: #333;
  outline: none;
  height: 40px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.price-input-container input[type="number"]::-webkit-outer-spin-button,
.price-input-container input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-input-container input[type="number"]::placeholder {
  color: #adb5bd;
  font-weight: 400;
}

.price-separator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px;
  height: 48px;
}

.separator-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e9ecef, transparent);
  border-radius: 1px;
}

.separator-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--wp--preset--color--color-1);
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 8px;
  text-transform: lowercase;
}

/* --- Sliders de prix --- */
.price-range-slider {
  position: relative;
  height: 20px;
  margin: 15px 0 25px 0;
  padding: 0 8px;
}

.range-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background-color: var(--wp--preset--color--color-1);
  border-radius: 2px;
  z-index: 2;
}

.price-range-slider input[type="range"] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 4px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  z-index: 3;
}

/* Track du slider */
.price-range-slider input[type="range"]::-webkit-slider-track {
  background: #e9ecef;
  height: 4px;
  border-radius: 2px;
  border: none;
}

.price-range-slider input[type="range"]::-moz-range-track {
  background: #e9ecef;
  height: 4px;
  border-radius: 2px;
  border: none;
}

/* Thumb du slider - Webkit (Chrome, Safari) */
.price-range-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--wp--preset--color--color-1);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.price-range-slider input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

/* Thumb du slider - Firefox */
.price-range-slider input[type="range"]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--wp--preset--color--color-1);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.price-range-slider input[type="range"]::-moz-range-thumb:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

/* =============================================================================
   4. SIDEBAR DESKTOP STICKY
   ============================================================================= */

@media screen and (min-width: 992px) {
  .col-lg-3.sticky-lg-top {
    position: sticky;
    top: 170px;
    height: fit-content;
    max-height: calc(100vh - 195px);
    overflow-y: auto;
    padding-bottom: 20px;
    z-index: 1; /* override Bootstrap z-index:1020 — sinon les filtres
                   passent au-dessus du mega menu (header z-index:1000) */
  }

  /* Scrollbar discrète */
  .col-lg-3.sticky-lg-top::-webkit-scrollbar {
    width: 4px;
  }

  .col-lg-3.sticky-lg-top::-webkit-scrollbar-track {
    background: transparent;
  }

  .col-lg-3.sticky-lg-top::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
}

/* =============================================================================
   5. DRAWER MOBILE
   ============================================================================= */

@media screen and (max-width: 991px) {
  /* Masquer la sidebar desktop */
  .category-filter-sidebar-desktop {
    display: none !important;
  }

  /* --- Sticky footer : nb de produits à gauche, bouton "Filtrer" à droite ---
     Collée aux bords bas/gauche/droite de l'écran. En position:fixed elle sort
     du flux : sa place dans le .row n'a plus d'incidence sur la mise en page. */
  .mobile-filter-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    width: auto;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    /* Marge de sécurité sous l'indicateur d'accueil iOS */
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border: 0;
    border-top: 1px solid #e5e7eb;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  }

  /* La barre d'outils est passée en haut de la grille (2026-11-12) : plus
     rien ne flotte en bas de l'écran, donc plus de place à réserver. C'est
     ce creux de 110 px qui séparait la pagination du texte en dessous. */
  .rayon__corps {
    padding-bottom: 0;
  }

  .mobile-filter-count {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-filter-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--wp--preset--color--color-1);
    color: #fff;
    border: none;
    padding: 17px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    transition:
      filter 0.2s ease,
      transform 0.1s ease;
  }

  .mobile-filter-toggle:hover {
    filter: brightness(0.94);
  }

  .mobile-filter-toggle:active {
    transform: translateY(1px);
  }

  .mobile-filter-toggle i {
    font-size: 1.15rem;
  }

  /* Badge compteur de filtres actifs */
  .filter-count-badge {
    background-color: #fff;
    color: var(--wp--preset--color--color-1);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
  }

  .filter-count-badge:empty,
  .filter-count-badge[data-count="0"] {
    display: none;
  }

  /* --- Overlay sombre --- */
  .mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-filter-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* --- Drawer des filtres --- */
  .mobile-filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background-color: #fff;
    z-index: 1002;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mobile-filter-drawer.active {
    transform: translateY(0);
  }

  /* --- Header du drawer --- */
  .mobile-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
  }

  .mobile-filter-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wp--preset--color--color-8);
  }

  .mobile-filter-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
  }

  .mobile-filter-close:hover {
    color: var(--wp--preset--color--color-1);
  }

  /* Indicateur de drag */
  .mobile-filter-drag-indicator {
    width: 40px;
    height: 4px;
    background-color: #d1d5db;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

  /* --- Contenu scrollable du drawer --- */
  .mobile-filter-content {
    flex: 1;
    min-height: 0; /* CRITIQUE: Permet au flex child de scroller */
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .mobile-filter-content .filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
  }

  .mobile-filter-content .filter-section:last-child {
    border-bottom: none;
  }

  .mobile-filter-content .filter-title {
    margin-top: 0;
  }

  /* --- Footer du drawer --- */
  .mobile-filter-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    background-color: #f8f9fa;
    flex-shrink: 0;
  }

  /* Deux boutons de 50 px de haut en travers de l'écran, c'était beaucoup
     pour un pied de tiroir : ils tiennent la même place utile en 42. */
  .mobile-filter-reset {
    flex: 0 0 auto;
    padding: 0 16px;
    height: 42px;
    border: 1px solid #e0e0e3;
    background-color: #fff;
    color: #5e6470;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-filter-reset:hover {
    border-color: var(--wp--preset--color--color-1);
    color: var(--wp--preset--color--color-1);
  }

  .mobile-filter-apply {
    flex: 1 1 auto;
    padding: 0 16px;
    height: 42px;
    border: none;
    background-color: var(--wp--preset--color--color-1);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .mobile-filter-apply:hover {
    background-color: #c4289a;
  }

  /* --- Sliders de prix sur mobile --- */
  .price-range-slider {
    padding: 25px 8px;
    margin: 20px 0;
  }

  /* FIX CRITIQUE: touch-action: pan-x permet le mouvement horizontal du slider
     SANS bloquer le scroll vertical du drawer */
  #range-min,
  #range-max {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto !important;
    cursor: pointer;
    width: 100%;
    touch-action: pan-x !important;
  }

  /* Thumbs plus gros pour mobile */
  #range-min::-webkit-slider-thumb,
  #range-max::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    cursor: grab;
    pointer-events: auto !important;
    border-radius: 50%;
    background: var(--wp--preset--color--color-1);
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  }

  #range-min:active::-webkit-slider-thumb,
  #range-max:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  #range-min::-moz-range-thumb,
  #range-max::-moz-range-thumb {
    width: 28px;
    height: 28px;
    cursor: grab;
    pointer-events: auto !important;
    border-radius: 50%;
    background: var(--wp--preset--color--color-1);
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  }

  #range-min:active::-moz-range-thumb,
  #range-max:active::-moz-range-thumb {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  /* Inputs de prix sur mobile */
  .price-inputs-modern {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .price-field {
    width: 100%;
  }

  /* En colonne, le « a » tombait sous les deux champs, tout seul au milieu
     de rien. Les libelles MINIMUM et MAXIMUM disent deja ce qu'il disait. */
  .price-separator {
    display: none;
  }

  .separator-line {
    display: none;
  }

  .separator-text {
    background: #f8f9fa;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: var(--wp--preset--color--color-1);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .price-input-container {
    border-radius: 10px;
  }

  .price-input-container input[type="number"] {
    font-size: 0.95rem;
    padding: 12px 14px;
    height: 44px;
  }

  .price-currency {
    height: 44px;
    font-size: 0.8rem;
    min-width: 38px;
    padding: 0 10px;
  }

  .price-label {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }
}

/* --- Bloquer le scroll du body quand drawer ouvert --- */
body.drawer-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* =============================================================================
   6. RESPONSIVE - TABLETTES ET PETITS ÉCRANS
   ============================================================================= */

@media (min-width: 769px) and (max-width: 991px) {
  .price-inputs-modern {
    gap: 10px;
  }

  .price-separator {
    margin: 0 2px;
  }

  .separator-text {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  .price-input-container input[type="number"] {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .price-currency {
    min-width: 38px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .price-range-container {
    padding: 16px 0;
  }

  .price-inputs-modern {
    gap: 12px;
  }

  .price-input-container input[type="number"] {
    font-size: 0.9rem;
    padding: 10px 12px;
    height: 40px;
  }

  .price-currency {
    height: 40px;
    font-size: 0.75rem;
    min-width: 34px;
    padding: 0 8px;
  }

  .price-label {
    font-size: 0.65rem;
    margin-bottom: 4px;
  }

  .separator-text {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .price-field {
    min-width: 100px;
  }
}

@media (max-width: 360px) {
  .price-range-container {
    padding: 12px 0;
  }

  .price-inputs-modern {
    gap: 10px;
  }

  .price-input-container input[type="number"] {
    font-size: 0.85rem;
    padding: 8px 10px;
    height: 36px;
  }

  .price-currency {
    height: 36px;
    font-size: 0.7rem;
    min-width: 30px;
    padding: 0 6px;
  }

  .price-label {
    font-size: 0.6rem;
    margin-bottom: 3px;
  }

  .separator-text {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .price-field {
    min-width: 90px;
  }
}

/* =============================================================================
   7. INDICATEURS DE CHARGEMENT ET MESSAGES
   ============================================================================= */

.products-loading {
  text-align: center;
  padding: 40px 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
}

.products-loading .spinner-border {
  color: var(--wp--preset--color--color-1);
  margin-bottom: 15px;
}

.products-loading p {
  margin: 0;
  color: #666;
  font-style: italic;
}

.no-products-message {
  text-align: center;
  padding: 60px 20px;
  background-color: #f8f9fa;
  border-radius: 12px;
  margin: 40px 0;
  border: 2px dashed #e9ecef;
}

.no-products-message h3 {
  color: var(--wp--preset--color--color-1);
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.no-products-message p {
  color: #666;
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

/* =============================================================================
   8. ENCART PUBLICITAIRE SIDEBAR
   ============================================================================= */

.sidebar-ad-container {
  margin-top: 30px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar-ad-container:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.sidebar-ad-link {
  display: block;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}

.sidebar-ad-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: cover;
}

.sidebar-ad-container:hover .sidebar-ad-image {
  transform: scale(1.03);
}

.sidebar-ad-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 10px;
  border-radius: 20px;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.sidebar-ad-container:hover .sidebar-ad-badge {
  opacity: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-ad-container {
  animation: fadeInUp 0.5s ease forwards;
}

@media (max-width: 991px) {
  .sidebar-ad-container {
    margin-top: 20px;
    border-radius: 12px;
  }

  .sidebar-ad-badge {
    font-size: 0.6rem;
    padding: 4px 8px;
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 767px) {
  .sidebar-ad-container {
    margin-top: 25px;
    margin-bottom: 15px;
    max-width: 100%;
  }
}

/* =============================================================================
   9. BADGE STOCK FAIBLE
   ============================================================================= */

.badge-low-stock {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  background-color: #ff6b35;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: pulse-stock 2s infinite;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-low-stock i {
  font-size: 0.75rem;
}

@keyframes pulse-stock {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 2px 15px rgba(255, 107, 53, 0.6);
  }
}

.badge-low-stock.critical {
  background-color: #dc3545;
  animation: pulse-stock-critical 1.5s infinite;
}

@keyframes pulse-stock-critical {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 2px 15px rgba(220, 53, 69, 0.6);
    transform: scale(1.02);
  }
}

@media screen and (max-width: 767px) {
  .badge-low-stock {
    font-size: 0.65rem;
    padding: 4px 8px;
    bottom: 8px;
    right: 8px;
  }
}

/* =============================================================================
   9. LA PAGE DE RAYON  (2026-11-12)

   La page s'étalait sur toute la largeur de l'écran alors que le header et
   l'accueil sont centrés dans une colonne plus étroite. On reprend ici
   exactement les paliers du header (assets/css/header.css) : même max-width,
   même padding, donc même bord gauche pour le logo, le titre et la première
   carte produit.
   ============================================================================= */

.rayon .container.large {
  padding-left: 40px;
  padding-right: 40px;
}

@media screen and (min-width: 1200px) {
  .rayon .container.large {
    max-width: 1400px;
    padding-left: 80px;
    padding-right: 80px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (min-width: 1400px) {
  .rayon .container.large {
    max-width: 1600px;
    padding-left: 120px;
    padding-right: 120px;
  }
}

@media screen and (min-width: 1600px) {
  .rayon .container.large {
    max-width: 1800px;
    padding-left: 160px;
    padding-right: 160px;
  }
}

@media screen and (max-width: 991px) {
  .rayon .container.large {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* --- En-tête : fil d'Ariane, titre, « En savoir plus » ------------------- */

.rayon__entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-top: 26px;
  padding-bottom: 16px;
}

.rayon__entete-texte {
  min-width: 0;
}

.rayon__entete .woocommerce-breadcrumb,
.rayon__entete .rank-math-breadcrumb {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #6b7280;
}

.rayon__entete .woocommerce-breadcrumb a,
.rayon__entete .rank-math-breadcrumb a {
  color: #6b7280;
}

.rayon__entete .woocommerce-breadcrumb a:hover,
.rayon__entete .rank-math-breadcrumb a:hover {
  color: var(--wp--preset--color--color-1);
}

.rayon__titre {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.12;
}

@media screen and (min-width: 992px) {
  .rayon__titre {
    font-size: 2.5rem;
  }
}

@media screen and (min-width: 1400px) {
  .rayon__titre {
    font-size: 2.75rem;
  }
}

/* « En savoir plus » descend au texte de bas de page : un rayon porte souvent
   800 mots de conseil, personne ne descend les chercher sans y être invité. */
.rayon__savoir-plus {
  margin: 10px 0 0;
  font-size: 0.9375rem;
}

/* Le thème pose une barre rose animée en ::before sur tous les <a>. */
.rayon__savoir-plus a::before,
.rayon__savoir-plus a::after {
  display: none !important;
  content: none !important;
}

.rayon__savoir-plus a {
  color: #5e6470;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rayon__savoir-plus a:hover,
.rayon__savoir-plus a:focus-visible {
  color: var(--wp--preset--color--color-1);
}

.rayon__logo-marque {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 8px 0;
}

.rayon__logo-marque .brand-logo__img {
  max-width: 220px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* --- Les deux colonnes : 25 % de filtres, 75 % de produits ---------------- */

.rayon__corps {
  margin-top: 4px;
}

.rayon__colonne {
  min-width: 0;
}

/* --- Bannière du rayon, au-dessus de la première rangée ------------------ */

.rayon__banniere {
  margin: 0 0 20px;
}

.rayon__banniere img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* --- Barre de tri --------------------------------------------------------- */

.rayon__barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #ececf0;
}

.rayon__compte {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.rayon-tri {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.rayon-tri__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}

/* Le chevron est dessiné en fond : les flèches natives des <select> ne se
   mettent pas en forme et changent d'un navigateur à l'autre. */
.rayon-tri__select {
  -webkit-appearance: none;
  appearance: none;
  padding: 9px 36px 9px 14px;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e6470' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px 15px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2b2b2b;
  line-height: 1.2;
  cursor: pointer;
}

.rayon-tri__select:hover,
.rayon-tri__select:focus-visible {
  border-color: var(--wp--preset--color--color-1);
  outline: none;
}

/* --- La grille : quatre cartes par rangée ---------------------------------
   À partir de 1200px seulement. Entre 992 et 1200px, la colonne produits
   fait 684px : quatre cartes y tiendraient sur 160px chacune, l'image du
   produit n'y serait plus lisible. Trois cartes, donc, jusqu'à 1200px. */

.rayon__carte {
  margin-bottom: 22px;
}

/* --- État : en promotion, en stock, bio ----------------------------------- */

.etat-list {
  list-style: none;
  margin: 0 0 25px;
  padding: 0;
}

.etat-list li {
  margin: 0;
}

.etat-list input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.etat-list label {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 4px;
  margin: 0;
  font-size: 0.9375rem;
  color: #3f4652;
  cursor: pointer;
}

.etat-list label::before {
  content: "";
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border: 1.5px solid #c9ccd3;
  border-radius: 5px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.etat-list label:hover::before {
  border-color: var(--wp--preset--color--color-1);
}

.etat-list input:checked + label::before {
  border-color: var(--wp--preset--color--color-1);
  background-color: var(--wp--preset--color--color-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 5 5 9-10'/%3E%3C/svg%3E");
}

.etat-list input:checked + label {
  color: #1a1a1a;
  font-weight: 600;
}

.etat-list input:focus-visible + label::before {
  outline: 2px solid var(--wp--preset--color--color-1);
  outline-offset: 2px;
}

/* --- Listes longues : cinq lignes, puis « Voir les X autres » -------------
   Les sections sont dépliées au chargement : sans plafond, 350 marques
   pousseraient le prix et les sous-catégories à dix écrans plus bas.
   C'est product-filters.js qui pose est-cachee, parce qu'il faut compter les
   lignes réellement disponibles, pas leur rang. */

.category-filter-sidebar .filter-content ul li.est-cachee {
  display: none !important;
}

/* Deplie, « Marques » peut faire 168 lignes : la section se defile au lieu
   de pousser le prix hors de l'ecran. */
.category-filter-sidebar .filter-content ul.est-deplie {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.category-filter-sidebar .filter-content ul.est-deplie::-webkit-scrollbar {
  width: 4px;
}

.category-filter-sidebar .filter-content ul.est-deplie::-webkit-scrollbar-track {
  background: transparent;
}

.category-filter-sidebar .filter-content ul.est-deplie::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.filtre-plus {
  display: inline-block;
  margin: -14px 0 25px;
  padding: 4px 0;
  background: none;
  border: 0;
  color: #5e6470;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.filtre-plus:hover,
.filtre-plus:focus-visible {
  color: var(--wp--preset--color--color-1);
}

/* La liste des sous-catégories n'est pas en capitales : ce sont des noms de
   rayons, parfois longs (« Compléments alimentaires »), lisibles tels quels.
   Sélecteur aligné sur celui de la section 1, sinon il perd contre lui. */
.category-filter-sidebar .filter-content .subcat-filter-list li a {
  text-transform: none;
  font-weight: 500;
}

.category-filter-sidebar .filter-content .subcat-filter-list li a .product-count {
  font-size: 0.75rem;
  flex: 0 0 auto;
}

/* Les cases à cocher portent déjà leur espacement dans le label. */
.category-filter-sidebar .filter-content .etat-list li {
  margin-bottom: 0;
}

/* --- Mobile ---------------------------------------------------------------- */

@media screen and (max-width: 991px) {
  .rayon__entete {
    display: block;
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .rayon__titre {
    font-size: 1.5rem;
  }

  .rayon__logo-marque {
    justify-content: flex-start;
    padding-top: 14px;
  }

  .rayon__banniere {
    margin-bottom: 16px;
  }

  .rayon__barre {
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }

  /* La barre fixe du bas annonce deja le nombre de produits. */
  .rayon__compte {
    display: none;
  }

  .rayon-tri {
    width: 100%;
    justify-content: space-between;
  }

  .rayon-tri__select {
    flex: 1 1 auto;
    max-width: 260px;
  }

  /* Le libelle reste : la place liberee par le compteur lui suffit, et
     un menu seul au milieu de rien ne dit pas ce qu'il trie. */

  .rayon__carte {
    margin-bottom: 16px;
  }
}

/* --- Texte de bas de page (cible de « En savoir plus ») ------------------- */

.rayon__texte {
  margin-top: 40px;
  margin-bottom: 48px;
  /* Le header colle en haut : sans cette marge, l'ancre amenait le titre du
     texte sous le header. */
  scroll-margin-top: 170px;
}

/* =============================================================================
   10. LA CARTE PRODUIT, VERSION ALLÉGÉE  (2026-11-12)

   Volontairement limitée aux listes de produits (.rayon) : l'accueil et les
   carrousels gardent la carte encadrée tant que celle-ci n'est pas validée.
   Pour l'étendre au reste du site, il suffira de retirer le préfixe .rayon.

   Le cadre et l'ombre de la carte disparaissent ; c'est la vignette qui porte
   la forme, en tuile claire. Une rangée de quatre cartes ne montre plus huit
   traits verticaux, et les emballages blancs ressortent sur le gris.
   ============================================================================= */

.rayon .excerpt-product {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.rayon .excerpt-product:hover {
  transform: none;
  box-shadow: none;
}

/* Fond blanc : les emballages sont presque tous rectangulaires et blancs,
   sur un fond gris ils se découpaient en rectangle visible. C'est un filet
   très fin qui délimite la carte, juste assez pour qu'on voie où commence
   et où finit un produit dans une rangée de quatre. */
.rayon .excerpt-product .image {
  height: 255px;
  padding: 18px;
  border: 1px solid #ebebee;
  border-radius: 14px;
  background-color: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.rayon .excerpt-product:hover .image {
  border-color: #d9d9de;
}

/* La marque n'est plus une pilule bordée : trois pilules par carte et seize
   par rangée, ça faisait beaucoup de contours pour une information de
   second plan. */
.rayon .excerpt-product > .cats {
  padding: 0;
  margin-top: 14px;
  margin-bottom: 0;
}

.rayon .excerpt-product > .cats .cat {
  padding: 0;
  border: 0;
  background: none;
  color: #8a909c;
  font-size: 0.6875rem;
  letter-spacing: 0.6px;
}

.rayon .excerpt-product .excerpt-product-content {
  padding: 6px 0 0;
  gap: 4px;
}

.rayon .excerpt-product .excerpt-product-content .title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

/* Le trait au-dessus du prix faisait une deuxième bordure dans une carte qui
   n'en a plus. */
.rayon .excerpt-product .excerpt-product-content .absolute-position {
  border-top: 0;
  padding-top: 4px;
}

.rayon .excerpt-product .excerpt-product-content .price,
.rayon .excerpt-product .excerpt-product-content .price ins {
  font-size: 1.2rem;
}

/* =============================================================================
   LE CHOIX RAPIDE AU SURVOL

   L'habillage du panneau est dans product.css, lu partout ou des cartes
   s'affichent : pose ici, il n'etait pas charge sur l'accueil et le panneau
   (« - 1 + Ajouter ») se retrouvait en clair sous chaque carte du carrousel.
   Ne restent ici que les regles propres aux listes de produits.
   ============================================================================= */

@media (hover: hover) and (min-width: 992px) {
  .rayon .excerpt-product.a-choix-rapide .carte-rapide {
    display: flex;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition:
      opacity 0.18s ease,
      transform 0.18s ease;
  }

  /* :hover et une classe posée en JavaScript : après un filtrage, les cartes
     sont remplacées sous le curseur et le navigateur ne rend pas toujours le
     :hover avant que la souris ne bouge. */
  .rayon .excerpt-product.a-choix-rapide:hover .carte-rapide,
  .rayon .excerpt-product.a-choix-rapide.est-survolee .carte-rapide,
  .rayon .excerpt-product.a-choix-rapide:focus-within .carte-rapide {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  /* Le bouton rond cède la place au panneau : deux façons d'ajouter au panier
     sur la même carte, c'est une de trop. */
  .rayon .excerpt-product.a-choix-rapide .product-actions {
    display: none;
  }

  /* « Plus que 3 en stock » occupe exactement la place du panneau. Il
     s'efface pendant le survol : l'information a déjà été lue, c'est le
     geste d'achat qui prend la main. */
  .rayon .excerpt-product.a-choix-rapide .badge-low-stock {
    transition: opacity 0.18s ease;
  }

  .rayon .excerpt-product.a-choix-rapide:hover .badge-low-stock,
  .rayon .excerpt-product.a-choix-rapide.est-survolee .badge-low-stock,
  .rayon .excerpt-product.a-choix-rapide:focus-within .badge-low-stock {
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rayon .excerpt-product.a-choix-rapide .carte-rapide {
    transition: none;
    transform: none;
  }
}

/* =============================================================================
   11. LES MARQUES DU RAYON, SOUS LE TEXTE DE BAS DE PAGE
   ============================================================================= */

.rayon__marques {
  margin-bottom: 48px;
}

.rayon-marques__titre {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--wp--preset--color--color-text);
}

.rayon-marques__liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rayon-marques__liste li {
  margin: 0;
}

/* Le thème pose une barre rose animée en ::before sur tous les <a>. */
.rayon-marques__liste a::before,
.rayon-marques__liste a::after {
  display: none !important;
  content: none !important;
}

.rayon-marques__liste a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  color: #3f4652;
  font-size: 0.9375rem;
  border-bottom: 1px solid #f1f1f4;
}

.rayon-marques__liste a:hover,
.rayon-marques__liste a:focus-visible {
  color: var(--wp--preset--color--color-1);
}

.rayon-marques__compte {
  flex: 0 0 auto;
  color: #9aa0ab;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 991px) {
  .rayon__marques {
    margin-bottom: 32px;
  }

  .rayon-marques__liste {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0 18px;
  }
}

/* =============================================================================
   12. PAGINATION  (2026-11-12)

   Elle sortait telle quelle de WooCommerce : une suite de nombres soulignés,
   sans zone cliquable, où la page courante ne se distinguait presque pas.
   Mêmes boutons pour la pagination des pages (liens /page/2/) et pour celle
   du filtrage AJAX (.pdc-pagination-filtre), qui porte des ancres #2.
   ============================================================================= */

.rayon .woocommerce-pagination {
  margin: 34px 0 10px;
}

.rayon .woocommerce-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.rayon .woocommerce-pagination ul.page-numbers li {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}

/* Le thème pose une barre rose animée en ::before sur tous les <a>. */
.rayon .woocommerce-pagination a::before,
.rayon .woocommerce-pagination a::after {
  display: none !important;
  content: none !important;
}

.rayon .woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #e3e4e8;
  border-radius: 10px;
  background: #fff;
  color: #3f4652;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.rayon .woocommerce-pagination a.page-numbers:hover,
.rayon .woocommerce-pagination a.page-numbers:focus-visible {
  border-color: var(--wp--preset--color--color-1);
  color: var(--wp--preset--color--color-1);
}

.rayon .woocommerce-pagination .page-numbers.current {
  border-color: var(--wp--preset--color--color-1);
  background: var(--wp--preset--color--color-1);
  color: #fff;
}

/* Les points de suspension ne sont pas un bouton. */
.rayon .woocommerce-pagination .page-numbers.dots {
  min-width: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: #9aa0ab;
}

.rayon .woocommerce-pagination .page-numbers.dots:hover {
  border: 0;
  color: #9aa0ab;
}

/* Précédent / suivant : la flèche seule, sans le mot. */
.rayon .woocommerce-pagination .page-numbers.prev,
.rayon .woocommerce-pagination .page-numbers.next {
  padding: 0;
  font-size: 1.05rem;
}

@media screen and (max-width: 991px) {
  .rayon .woocommerce-pagination {
    margin: 26px 0 6px;
  }

  .rayon .woocommerce-pagination ul.page-numbers {
    gap: 6px;
  }

  .rayon .woocommerce-pagination .page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    font-size: 0.875rem;
  }
}

/* =============================================================================
   13. LA PAGE DE RAYON SUR TÉLÉPHONE  (2026-11-12)

   La page faisait près de 20 000 px de haut : une carte par rangée, quatre
   nouveautés empilées sur 1 700 px, et une barre d'outils qu'il fallait aller
   chercher en bas de l'écran. Tout ce qui se parcourt du regard sur un grand
   écran se parcourt au doigt ici : les listes défilent sur le côté, la grille
   passe à deux colonnes, et la barre d'outils suit le défilement.
   ============================================================================= */

@media screen and (max-width: 991px) {
  /* --- Sous-catégories : un ascenseur horizontal ------------------------- */

  .subcat-chips {
    /* Déborde des marges du conteneur pour que la première pilule commence
       au bord du texte et que la dernière file sous le bord de l'écran :
       c'est ce qui montre qu'il y a quelque chose à faire glisser. */
    margin-left: -20px;
    margin-right: -20px;
  }

  .subcat-chips__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 20px;
    scroll-padding-left: 20px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .subcat-chips__list::-webkit-scrollbar {
    display: none;
  }

  .subcat-chips__list > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .subcat-chips__item {
    white-space: nowrap;
  }

  /* Le repli « Voir les X autres » n'a pas lieu d'être : tout est à portée
     de doigt (product-filters.js laisse la liste entière ici). */
  .subcat-chips__more-item {
    display: none !important;
  }

  /* --- « Nouveau dans ce rayon » : même principe ------------------------- */

  .pdc-nouveau-rayon {
    margin-left: -20px;
    margin-right: -20px;
  }

  .pdc-nouveau-rayon__titre {
    padding-left: 20px;
  }

  .pdc-nouveau-rayon .row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-left: 0;
    margin-right: 0;
    padding: 0 20px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pdc-nouveau-rayon .row::-webkit-scrollbar {
    display: none;
  }

  .pdc-nouveau-rayon .row > [class*="col-"] {
    flex: 0 0 auto;
    width: 46%;
    max-width: 200px;
    scroll-snap-align: start;
  }

  /* --- Bannière au format 1 x 0,75 --------------------------------------- */

  .rayon__banniere.a-version-mobile img {
    aspect-ratio: 1 / 0.75;
    object-fit: cover;
  }

  @media screen and (min-width: 768px) {
    /* Une tablette reçoit le visuel large (lib/banniere-rayon.php) : pas de
       rapport imposé, il garde le sien. */
    .rayon__banniere.a-version-mobile img {
      aspect-ratio: auto;
      object-fit: contain;
    }
  }

  /* --- Barre d'outils, collée sous le header ------------------------------
     --pdc-entete-h est publiée par header-scroll.js et suit le repli du
     bandeau du haut. Le z-index reste bien sous celui du header (1000) :
     la barre passe dessous, elle ne le recouvre jamais. */

  .rayon__barre {
    position: sticky;
    top: var(--pdc-entete-h, 114px);
    z-index: 20;
    display: block;
    margin-left: -20px;
    margin-right: -20px;
    padding: 10px 20px 11px;
    background: #fff;
    border-bottom: 1px solid #ececf0;
  }

  .rayon__compte {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8125rem;
  }

  .rayon__outils {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .rayon__filtrer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 42px;
    padding: 0 16px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #fff;
    color: #2b2b2b;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
  }

  .rayon__filtrer .pdc-icone {
    width: 19px;
    height: 19px;
    color: #5e6470;
  }

  .rayon__filtrer .filter-count-badge:empty {
    display: none;
  }

  .rayon__filtrer .filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--wp--preset--color--color-1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .rayon-tri {
    flex: 1 1 auto;
    min-width: 0;
  }

  .rayon-tri__label {
    display: none;
  }

  .rayon-tri__select {
    width: 100%;
    max-width: none;
    height: 42px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* --- La grille : deux cartes par rangée --------------------------------- */

  .rayon__carte {
    margin-bottom: 18px;
  }

  .rayon .excerpt-product .image {
    height: 150px;
    padding: 10px;
    border-radius: 12px;
  }

  .rayon .excerpt-product > .cats {
    margin-top: 9px;
  }

  .rayon .excerpt-product > .cats .cat {
    font-size: 0.625rem;
  }

  .rayon .excerpt-product .excerpt-product-content {
    padding: 4px 0 0;
  }

  /* Trois lignes de titre : à deux, la moitié des noms de produit étaient
     coupés avant d'avoir dit de quoi il s'agissait. */
  .rayon .excerpt-product .excerpt-product-content .title {
    font-size: 0.8125rem;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    min-height: 4.05em;
  }

  .rayon .excerpt-product .excerpt-product-content .price,
  .rayon .excerpt-product .excerpt-product-content .price ins {
    font-size: 1rem;
  }

  .rayon .excerpt-product .excerpt-product-content .price del {
    font-size: 0.75rem;
  }

  .rayon .excerpt-product .excerpt-product-content .absolute-position {
    gap: 6px;
  }

  /* --- Le bouton d'achat, sur toute la largeur de la carte ---------------
     Une pastille de 38 px à côté du prix, c'était une petite cible et un
     pictogramme à deviner. Le bouton passe sous le prix, sur toute la
     largeur, avec son libellé : « Ajouter », « Choisir » pour un produit à
     options, « Voir le produit » pour un épuisé. */

  .rayon .excerpt-product .excerpt-product-content .absolute-position {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 6px;
  }

  /* Le prix occupe sa propre ligne : il peut s'étaler. */
  .rayon .excerpt-product .excerpt-product-content .price {
    flex: 0 0 auto;
    width: 100%;
  }

  .rayon .excerpt-product .product-actions {
    width: 100%;
  }

  /* Le bouton d'un produit simple est enveloppé dans un <form class="cart"> :
     sans cette ligne, c'est le formulaire qui se réduit à la largeur du
     bouton et le « toute la largeur » ne se voit pas. */
  .rayon .excerpt-product .product-actions form.cart {
    width: 100%;
    flex: 1 1 auto;
    margin: 0;
  }

  .rayon .excerpt-product .product-actions button.add_to_cart_button,
  .rayon .excerpt-product .product-actions a.btn-color-1 {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    gap: 8px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 3px 9px rgba(230, 44, 161, 0.28);
  }

  .rayon .excerpt-product .product-actions button.add_to_cart_button svg,
  .rayon .excerpt-product .product-actions button.add_to_cart_button i,
  .rayon .excerpt-product .product-actions a.btn-color-1 svg,
  .rayon .excerpt-product .product-actions a.btn-color-1 i {
    width: 17px;
    height: 17px;
    font-size: 17px;
    line-height: 17px;
    margin: 0;
  }

  .rayon .excerpt-product .btn-ajouter__texte {
    display: inline;
  }

  /* Sur une carte de 180 px, « Plus que 3 en stock » passait sur deux
     lignes et mangeait le bas de l'image. */
  .rayon .excerpt-product .badge-low-stock {
    font-size: 0.6rem;
    padding: 3px 7px;
    bottom: 7px;
    right: 7px;
    white-space: nowrap;
    max-width: calc(100% - 14px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* --- Le texte de bas de page -------------------------------------------- */

  .rayon__texte {
    margin-top: 26px;
  }

  .rayon__texte p,
  .rayon__texte li {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .rayon__texte h2 {
    font-size: 1.2rem;
  }

  .rayon__texte h3 {
    font-size: 1.05rem;
  }
}

/* Le libellé des boutons de carte est masqué dans assets/css/global.css :
   la carte produit apparaît aussi sur la fiche (« Vous aimerez aussi ») et sur
   l'accueil, où ce fichier n'est pas chargé. */



/* =============================================================================
   14. DÉTAILS DE LA CARTE ET DE LA PAGINATION SUR TÉLÉPHONE  (2026-11-12)
   ============================================================================= */

/* La contenance, sous le titre. Elle existe aussi sur grand écran : c'est la
   même information, et elle y est tout aussi utile. */
.excerpt-product__contenance {
  display: block;
  margin: -2px 0 2px;
  color: #8a909c;
  font-size: 0.75rem;
  font-weight: 500;
}

@media screen and (max-width: 991px) {
  /* --- Prix : barré et remisé côte à côte -------------------------------
     En colonne, le prix barré posait une ligne de plus sur chaque carte en
     promotion, et décalait les prix d'une carte à l'autre dans la rangée. */
  .rayon .excerpt-product .excerpt-product-content .price {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
  }

  .rayon .excerpt-product .excerpt-product-content .price del {
    order: -1;
    font-size: 0.75rem;
  }

  .excerpt-product__contenance {
    font-size: 0.6875rem;
  }

  /* --- Étiquettes : des repères, pas des pancartes ----------------------- */

  /* « Plus que 3 en stock » faisait 138 px sur une carte de 180. Le début de
     la phrase part (il est dans un <span> à part), le reste suffit. */
  .badge-low-stock__long {
    display: none;
  }

  .rayon .excerpt-product .badge-low-stock {
    gap: 4px;
    bottom: 6px;
    right: 6px;
    animation: none; /* une pastille qui clignote sur chaque carte, non */
  }

  .rayon .excerpt-product .badge-low-stock svg,
  .rayon .excerpt-product .badge-low-stock i {
    font-size: 0.6rem;
    width: 0.65em;
  }

  /* La remise occupait le quart de la vignette. */
  .rayon .excerpt-product .badge-sale {
    top: 7px;
    left: 7px;
    padding: 5px 11px;
    font-size: 0.75rem;
    border-radius: 14px;
    box-shadow: 0 2px 7px rgba(230, 44, 161, 0.35);
  }

  .rayon .excerpt-product .badge-sale .bulk {
    font-size: 0.65rem;
  }

  .rayon .excerpt-product .badge-nouveau {
    top: 7px;
    left: 7px;
    padding: 4px 10px;
    font-size: 0.6875rem;
    border-radius: 14px;
  }

  .rayon .excerpt-product .badge-unavailable {
    font-size: 0.6875rem;
    padding: 4px 10px;
  }

  /* --- Pagination : tout sur une ligne ------------------------------------
     Avec un seul numéro de chaque côté (lib/tri-produits.php), sept boutons
     au pire : à 34 px et 6 px d'écart, ils tiennent dans 335 px et la
     flèche ne tombe plus seule à la ligne. */
  .rayon .woocommerce-pagination ul.page-numbers {
    gap: 6px;
  }

  .rayon .woocommerce-pagination .page-numbers {
    min-width: 34px;
    height: 34px;
    padding: 0 7px;
    font-size: 0.8125rem;
    border-radius: 9px;
  }

  .rayon .woocommerce-pagination .page-numbers.dots {
    min-width: 14px;
    padding: 0;
  }
}

/* =============================================================================
   TRÈS PETITS TÉLÉPHONES (moins de 375 px)

   La carte tombe à ~130 px de large : l'image et le titre se resserrent
   encore. Le bouton d'achat, lui, est déjà pleine largeur sur tous les
   téléphones (bloc ci-dessus).
   ============================================================================= */

@media screen and (max-width: 374px) {
  .rayon .excerpt-product .image {
    height: 130px;
  }

  .rayon .excerpt-product .excerpt-product-content .title {
    font-size: 0.75rem;
  }

  .rayon .excerpt-product .product-actions button.add_to_cart_button,
  .rayon .excerpt-product .product-actions a.btn-color-1 {
    height: 40px;
    font-size: 0.8125rem;
    gap: 6px;
  }
}

/* =============================================================================
   15. TABLETTES (768 - 991 px)  (2026-11-12)

   La grille passe a trois cartes par rangee (col-md-4) : a deux, la carte
   faisait 352 px de large pour une vignette de 150 px de haut, le produit
   flottait au milieu de rien. Trois cartes de 230 px, c'est la meme densite
   qu'un ordinateur, et la barre d'outils tient sur une seule ligne.
   ============================================================================= */

@media screen and (min-width: 768px) and (max-width: 991px) {
  /* La vignette suit la largeur de la carte plutot qu'une hauteur fixe. */
  .rayon .excerpt-product .image {
    height: 210px;
  }

  .rayon .excerpt-product .excerpt-product-content .title {
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
    min-height: 2.7em;
  }

  .excerpt-product__contenance {
    font-size: 0.75rem;
  }

  .rayon .excerpt-product .excerpt-product-content .price,
  .rayon .excerpt-product .excerpt-product-content .price ins {
    font-size: 1.1rem;
  }

  /* Le compteur revient a cote des outils : la ligne est assez large.
     flex-wrap et min-width: 0 partout : sans eux, le menu de tri gardait sa
     largeur de contenu (« Prix decroissant ») et sortait de la page par la
     droite au lieu de se retrecir ou de passer a la ligne. */
  .rayon__barre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .rayon__compte {
    display: block;
    flex: 0 0 auto;
    margin-bottom: 0;
    font-size: 0.875rem;
  }

  .rayon__outils {
    flex: 0 1 auto;
    min-width: 0;
  }

  /* Le formulaire reserve par defaut la largeur naturelle du menu (« Prix
     decroissant », 394 px) et le repousse a droite avec space-between : on
     le borne a la largeur reelle de son contenu, libelle + menu. */
  .rayon-tri {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 300px;
    justify-content: flex-start;
  }

  .rayon-tri__label {
    display: inline;
    flex: 0 0 auto;
  }

  /* Largeur fixe, et pas d'etirement : avec un simple max-width, le
     formulaire reservait la largeur naturelle du menu (« Prix decroissant »,
     394 px) alors que le menu s'affichait a 230, et il restait un trou de
     175 px entre « Trier par » et le menu. */
  .rayon-tri__select {
    width: 230px;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
  }

  /* --- Le filtre de prix reprend sa disposition en ligne -------------------
     Le tiroir fait 720 px de large sur une tablette : empiler MINIMUM et
     MAXIMUM sur toute cette largeur etirait deux champs de quatre chiffres
     d'un bord a l'autre. */
  .price-inputs-modern {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
    max-width: 460px;
  }

  .price-field {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .price-separator {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    height: 48px;
    margin: 0;
  }

  .separator-line {
    display: none;
  }

  /* Les nouveautes defilent toujours, mais avec des cartes a la bonne taille. */
  .pdc-nouveau-rayon .row > [class*="col-"] {
    width: 30%;
    max-width: 240px;
  }
}
