:root {
  --couleur-principale: #00564F;
  --couleur-secondaire: #b7fff3;
  --fond-gris: #566462;
  --fond-facette: #fff;
  --texte-primaire: #070600;
  --texte-secondaire: #20A4F3;
  --bord-rond: 0px;
  --ombre-légère: 0 10px 20px rgba(0, 0, 0, 0.12);
  --fond-carte: #fff;

  --filtre-color-1: #fff;
  --filtre-color-2: #435e96;
  --filtre-color-3: #14223d;
  --filtre-accent: #00ffe0;
  --filtre-jauge: #ff5100;
}

body { font-family: 'Segoe UI', sans-serif; }

/* Layout global */
.filtre-resultats-conteneur {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 30px;
  flex-wrap: wrap;
}
.filtres-wrap {
  padding: 24px;
  max-width: 320px;
  width: 320px;
  border: none;
  border-radius: 16px;
  background: #38363682;
}
.resultats-wrap { flex: 1; min-width: 300px; }

/* Bloc filtre */
.filtre-block { margin-bottom: 10px; padding: 16px 18px; }
.filtre-prix-titre {
  font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
  color: var(--filtre-color-1); font-weight: 600; cursor: pointer; font-family: monospace;
}
.titre-facette {
  font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
  color: var(--filtre-color-1); font-weight: 600; cursor: pointer;
}
.filtre-checkbox { display: flex; flex-direction: column; gap: 3px; }
.facette-contenu-cacher { display: none; }
.arrow {
  color: var(--filtre-color-1); border: 1px solid rgba(255, 255, 255, 0.1); padding: 2px 6px; font-size: 10px; border-radius: 5px;
}
.filtre-ligne label {
  font-size: 13px; color: var(--filtre-color-1); display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.filtre-ligne input[type="checkbox"] {
  margin-right: 8px; width: 14px; height: 14px; transform: scale(0.85);
}
.checkbox-count { margin-left: auto; color: var(--filtre-color-1); font-size: 0.85em; }

/* Slider prix */
.filtre-prix-range { display: flex; flex-direction: column; margin-bottom: 20px; }
.range-wrapper { position: relative; height: 35px; }
.range-wrapper input[type=range] {
  position: absolute; width: 100%; pointer-events: none; appearance: none; height: 6px; border-radius: 3px; background: #ccc; top: 13px;
}
.range-wrapper input[type=range]::-webkit-slider-thumb {
  pointer-events: auto; -webkit-appearance: none; height: 20px; width: 20px; background: var(--filtre-jauge);
  border: 3px solid white; border-radius: 25%; box-shadow: 0 0 3px rgba(0,0,0,0.4); cursor: pointer; position: relative; z-index: 2;
}
.range-wrapper input[type=range]::-moz-range-thumb {
  pointer-events: auto; height: 20px; width: 20px; background: var(--filtre-color-1);
  border: 3px solid white; border-radius: 50%; box-shadow: 0 0 3px rgba(0,0,0,0.4); cursor: pointer; position: relative; z-index: 2;
}
.range-wrapper .range-track {
  position: absolute; height: 6px; border-radius: 3px; top: 13px; left: 0; right: 0; background: linear-gradient(to right, #ccc 0%, #ccc 100%); z-index: 1;
}
.valeurs-affichees { font-size: 13px; margin-top: 10px; text-align: center; color: var(--filtre-color-1); }

/* ====== Grille des résultats (4 colonnes) ====== */
#liste-produits #result-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1280px) {
  #liste-produits #result-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  #liste-produits #result-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    #liste-produits #result-items { grid-template-columns: repeat(3, minmax(0, 1fr)); } 
}
@media (max-width: 650px) {
  #liste-produits #result-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  #liste-produits #result-items { grid-template-columns: 1fr; }
}
 
/* ====== Carte produit ====== */
.product-card {
  display: flex; flex-direction: column; background: #2c2b2b75;
  border-radius: 25px; overflow: hidden; box-shadow: none; transition: transform .2s ease;
}
.product-card:hover { transform: translateY(-4px); }

/* Media */
.product-media {
  display: block; background: #fff; position: relative;
}
.product-media img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; padding: 14px;transition: transform .2s;
}
.product-card:hover .product-media img {
  transform: scale(1.05);
}
.product-media.no-img { background: #38363682; height: 180px; }

/* Contenu */
.product-content { display: flex; flex-direction: column; justify-content: space-evenly; padding: 14px; min-height: 180px;}
.product-title {
  color: #fff; font-size: 16px; font-weight: 700; font-family: monospace; margin: 0; max-height: 50px; min-height: 50px;transition: max-height 0.5s ease; overflow: hidden;
}
.product-content:hover .product-title {
    max-height: 100px;
}

/* Note/étoiles */
.note-expert-row { display: flex; align-items: center; gap: 4px; }
.note-etoiles { display: flex; gap: 2px; }
.etoile-pleine { font-size: 16px; color: #ff9665; }
.etoile-vide   { font-size: 16px; color: #ccc; }

/* Prix */
.price-row { display: flex; justify-content: space-between; align-items: center; }
.prix-produit { font-size: 18px; color: #fff; }

/* Boutons */
.btn-row { display: flex; gap: 8px; margin-top: 6px; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }

/* Bouton avis */
.btn-avis {
  display: inline-flex; align-items: center; gap: 10px; color: #fff; padding: 10px 22px;
  border-radius: 10px; font-size: 14px; text-decoration: none; font-weight: 600; transition: all 0.2s ease;
  background: #38363682; border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-avis:hover { background: #ffffff; color: #1a1a1a; }
.btn-avis .material-symbols-rounded { font-size: 20px; }
.btn-avis.btn-sm { padding: 8px 12px; }

/* Bouton Amazon */
.btn-amazon {
  position: relative; background-color: #ff5100; color: white; padding: 10px 20px; font-size: 15px; font-weight: bold; text-decoration: none !important;
  outline: none; display: inline-block; white-space: nowrap; box-shadow: var(--ombre-légère, 0 2px 6px rgba(0, 0, 0, 0.1));
  border-radius: 10px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease; z-index: 0;
}
.btn-amazon span { position: relative; z-index: 1; }
.btn-amazon::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
  transform: rotate(-45deg); opacity: 0; transition: transform 0.5s ease, opacity 0.5s ease; z-index: 0; pointer-events: none;
}
.btn-amazon:hover, .btn-amazon:focus, .btn-amazon:active {
  background-color: #000; color: #ff9900; transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 153, 0, 0.5); cursor: pointer;
}
.btn-amazon:hover::before { opacity: 1; transform: rotate(-45deg) translateY(120%); }
.btn-amazon.btn-sm { padding: 8px 12px; width: 100%; border-radius: 50px; text-align: center; font-family: monospace;}

/* Détails pliables */
.details-toggle {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
  background: #38363682; color: #fff; border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; transition: all .2s ease;
}
.details-toggle:hover { background: #fff; color: #1a1a1a; }
.details-cache { display: none; } /* slideToggle + [hidden] gérés en JS */

/* Catégories (tags) */
.categorie-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cat-tag {
  display: flex; align-items: center; gap: 4px; background: #38363682; color: #fff;
  padding: 4px 10px; border-radius: 20px; text-decoration: none; font-size: 13px; transition: all 0.2s ease;
}
.cat-tag .material-symbols-rounded { font-size: 16px; }
.cat-tag:hover { background: #fff; color: #1a1a1a; }

/* Caractéristiques */
.caracteristiques-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.carac-item {
  display: flex; justify-content: space-between; background: #38363682; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: #ffffff; transition: all 0.2s ease-in-out;
}
.carac-item:hover { transform: translateX(6px); }
.carac-valeur { color: #00e6c0; }

/* No results */
.no-results {
  color: #fff; background: #38363682; padding: 16px; border-radius: 10px; text-align: center;
}

/* Sticky compteur résultats */
#filtre-sticky-resultat {
  position: fixed; bottom: 10px; left: 50%; transform: translate(-50%, 10px);
  width: 320px; max-width: 90vw; background: rgba(30, 30, 30, 0.7);
  text-align: center; color: #fff; padding: 10px; font-size: 14px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; z-index: 999;
}
#filtre-sticky-resultat.visible { opacity: 1; transform: translate(-50%, 0); }

/* Bouton scroll top */
#scrollToTop {
  background: #38363682; font-weight: bold; position: fixed; bottom: 10px; right: 20px; z-index: 999; color: #fff;
  border: none; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; display: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); width: 40px; transition: all 0.2s ease;
}
#scrollToTop:hover { background: #fff; color: #000; }

/* Bouton "voir plus" dans chaque facette */
.filtre-checkbox .btn-show-more {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 8px; padding: 6px 10px;
  border-radius: 999px; font-size: 12px; line-height: 1; cursor: pointer; border: 1px solid #ddd; background: transparent; color: #fff; width: 60px;
}
.filtre-checkbox .btn-show-more:hover { background: #38363682; color: #fff; }
.filtre-checkbox .btn-show-more[aria-expanded="true"] { background: #38363682; color: #fff; }
.filtre-checkbox .overflow-option { display: none; }

/* Barre des filtres actifs */
#active-filters-bar {
  display: none;
  align-items: center; gap: 8px; flex-wrap: wrap; color: #fff; margin: 0 0 16px 0;
}
#active-filters-bar.visible { display: flex; }
#active-filters-bar .chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#active-filters-bar .chip {
  display: inline-flex; align-items: center; gap: 6px; background: #292929;
  border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; padding: 6px 10px; border-radius: 20px; font-size: 12px; line-height: 1; transition: all 0.2s ease;
}
#active-filters-bar .chip:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
#active-filters-bar .chip .chip-remove {
  border: 0; background: transparent; cursor: pointer; color: inherit; padding: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; transition: all 0.2s ease;
}
#active-filters-bar .chip .chip-remove:hover { background: rgba(255, 255, 255, 0.851); color: #fff; }
#active-filters-bar .chip .material-symbols-rounded { font-size: 16px; color: var(--filtre-jauge);}
#active-filters-bar #clear-all-filters {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: #38363682; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1); padding: 6px 10px; border-radius: 50px; font-size: 12px; cursor: pointer; transition: all 0.2s ease;
}
#active-filters-bar #clear-all-filters .material-symbols-rounded { font-size: 18px; color: var(--filtre-jauge); }
#active-filters-bar #clear-all-filters:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
#active-filters-bar #clear-all-filters:hover .material-symbols-rounded { color: #1a1a1a; }

/* Responsive bloc filtres */
@media (max-width: 768px) {
  .filtre-resultats-conteneur { flex-direction: column; gap: 20px; }
  .filtres-wrap { max-width: 100%; width: 100%; }
  .filtre-block { padding: 12px 14px; margin-bottom: 8px; }
  .resultats-wrap { width: 100%; }
}
.product-media {
  position: relative;
  display: block;
  overflow: hidden;
}

.product-media .overlay-test {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover .overlay-test {
  opacity: 1;
}

/* Conteneur */
.badges-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Pas de gap ici pour mieux gérer l'animation de hauteur, on gère l'espacement via margin */
}

/* Style de base du badge */
.badge-produit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 6px; /* Espace entre les badges */
  border-radius: 50px;
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  
  /* Transition pour ceux qui sont toujours visibles */
  transition: transform 0.2s ease;
}

.badge-produit .material-symbols-rounded {
  font-size: 14px;
  line-height: 1;
}

/* --- ANIMATION DES BADGES CACHÉS --- */

/* État initial (caché) pour les badges > 2 */
.badge-extra {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateX(-20px); /* Décalé vers la gauche */
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* État au survol de la carte (visible) */
.product-card:hover .badge-extra {
  opacity: 1;
  max-height: 30px; /* Hauteur suffisante pour le contenu */
  margin-bottom: 6px;
  padding-top: 6px;
  padding-bottom: 6px;
  transform: translateX(0); /* Revient à sa place (effet gauche vers droite) */
}

/* Petit délai en cascade pour un effet "vague" (optionnel mais élégant) */
.product-card:hover .badge-extra:nth-child(3) { transition-delay: 0.05s; }
.product-card:hover .badge-extra:nth-child(4) { transition-delay: 0.1s; }
.product-card:hover .badge-extra:nth-child(5) { transition-delay: 0.15s; }
.product-card:hover .badge-extra:nth-child(6) { transition-delay: 0.2s; }

/* Conteneur du prix : on empile le texte et le chiffre */
.prix-produit {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    margin-top: 5px;
}

/* Le libellé "à partir de" */
.label-a-partir {
  font-size: 11px;
  color: #b0b0b0; /* Gris clair pour être discret sur fond sombre */
  font-weight: 400;
  margin-bottom: 2px;
  font-family: 'Segoe UI', sans-serif;
  text-transform: lowercase; /* Optionnel */
}

/* Le prix en lui-même (le <strong>) */
.prix-produit strong {
  font-size: 16px; /* Un peu plus gros pour l'impact */
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Cas où il n'y a pas de prix */
.prix-non-communique {
    font-size: 13px;
    color: #888;
    font-style: italic;
}