/* =====================================================================
   AVIS CLIENTS : page /avis-clients et carrousel d'avis (04-12-2026)
   Reprend les couleurs du nouveau look (nouveau-look.css).
   ===================================================================== */
:root {
  --av-etoile: #f2b705;        /* étoiles jaunes */
  --av-etoile-vide: #ded5c8;   /* contour des étoiles vides */
  --av-encre: #8a4424;         /* encre du tampon (brique du site) */
}

/* ---------- Étoiles ---------- */
.av-etoiles { display: inline-flex; gap: 2px; vertical-align: middle; line-height: 0; }
.av-etoile { position: relative; display: inline-block; width: 1.15rem; height: 1.15rem; }
.av-etoile svg { width: 100%; height: 100%; display: block; fill: transparent; stroke: var(--av-etoile-vide); stroke-width: 1.6; stroke-linejoin: round; }
.av-etoile::after {
  content: ""; position: absolute; inset: 0;
  background: var(--av-etoile);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.4l2.92 5.92 6.53.95-4.72 4.6 1.11 6.5L12 17.3l-5.84 3.07 1.11-6.5-4.72-4.6 6.53-.95z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.4l2.92 5.92 6.53.95-4.72 4.6 1.11 6.5L12 17.3l-5.84 3.07 1.11-6.5-4.72-4.6 6.53-.95z'/%3E%3C/svg%3E") center / contain no-repeat;
  clip-path: inset(0 calc(100% - var(--plein, 0%)) 0 0);
}
.av-etoiles-grandes .av-etoile { width: 1.6rem; height: 1.6rem; }
.av-etoiles-petites .av-etoile { width: .95rem; height: .95rem; }

/* ---------- Page ---------- */
.av-page .m-section { padding-top: clamp(1.5rem, 4vw, 3rem); }
.av-entete { max-width: 46rem; margin-bottom: clamp(1.5rem, 4vw, 2.75rem); }
.av-entete h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.1; margin: 0 0 .75rem; }
.av-entete p { color: var(--brun-moyen); margin: 0; }

.av-grille {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* Colonne de gauche, fixe pendant le défilement */
.av-resume {
  position: sticky;
  top: 110px;
  background: var(--sable-fonce);
  border-radius: var(--rayon);
  padding: 1.75rem 1.5rem 1.5rem;
}
.av-tampon-zone { display: flex; align-items: center; gap: 1rem; }
.av-tampon { width: 132px; height: 132px; flex: none; transform: rotate(-9deg); mix-blend-mode: multiply; }
.av-tampon-trait { fill: none; stroke: var(--av-encre); }
.av-tampon-tour { fill: var(--av-encre); font-family: var(--texte); font-size: 12.5px; font-weight: 600; letter-spacing: .12em; }
.av-tampon-note { fill: var(--av-encre); font-family: var(--titre); font-size: 58px; font-weight: 500; }
.av-tampon-sur { fill: var(--av-encre); font-family: var(--titre); font-size: 17px; font-style: italic; }
.av-tampon-texte p { margin: .4rem 0 0; color: var(--brun-moyen); font-size: .95rem; }

.av-barres { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .45rem; }
.av-barres li { display: grid; grid-template-columns: 5.2rem 1fr 2.8rem; align-items: center; gap: .6rem; font-size: .92rem; }
.av-barre { height: .7rem; background: #fff; border: 1px solid var(--terre); border-radius: 99px; overflow: hidden; }
.av-barre span { display: block; height: 100%; background: var(--av-etoile); border-radius: 99px; }
.av-barre-pct { text-align: right; color: var(--brun-moyen); font-variant-numeric: tabular-nums; }

.av-produits { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--terre); }
.av-produits h2 { font-size: 1.35rem; margin: 0 0 1rem; }
.av-produits-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.av-produits figure { margin: 0; text-align: center; }
.av-produits img { width: 88px; height: auto; border-radius: 4px; box-shadow: var(--ombre); }
.av-produits figcaption { margin-top: .6rem; font-size: .9rem; line-height: 1.35; }
.av-produits figcaption strong { display: block; font-size: 1.05rem; }
.av-btn-commande { width: 100%; justify-content: center; margin-top: 1.25rem; }

.av-comment { margin-top: 1.25rem; font-size: .9rem; color: var(--brun-moyen); }
.av-comment summary { cursor: pointer; color: var(--brique); }
.av-comment p { margin: .6rem 0 0; }

/* Liste des avis */
.av-liste-titre { font-size: 1.5rem; margin: 0 0 .5rem; }
.av-vide { color: var(--brun-moyen); }
.av-avis { padding: 1.6rem 0 1.75rem; border-bottom: 1px solid var(--terre); scroll-margin-top: 110px; }
.av-avis:last-child { border-bottom: 0; }
.av-avis:target { background: linear-gradient(90deg, var(--sable-clair), transparent); }

.av-avis-auteur { display: flex; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.av-initiale {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brun); color: var(--sable-fonce);
  font-family: var(--titre); font-size: 1.15rem; line-height: 1;
}
.av-prenom { font-weight: 600; }

.av-avis-titre { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .75rem; }
.av-avis-titre h3 { font-size: 1.3rem; margin: 0; line-height: 1.25; }

.av-criteres { margin: .8rem 0 0; display: grid; gap: .25rem; }
.av-criteres div { display: flex; align-items: center; gap: .7rem; }
.av-criteres dt { order: 2; font-weight: 400; font-size: .92rem; color: var(--brun); }
.av-criteres dd { order: 1; margin: 0; display: flex; align-items: center; gap: .5rem; }
.av-non-lu { margin-left: .4rem; font-size: .82rem; color: var(--brun-moyen); font-style: italic; }

.av-meta { margin: .9rem 0 0; font-size: .88rem; color: var(--brun-moyen); display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; }
.av-badge { display: inline-flex; align-items: center; gap: .35rem; color: var(--brique); font-weight: 600; }
.av-texte { margin: .8rem 0 0; max-width: 42rem; }

.av-photos { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.av-photo { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--rayon-petit); overflow: hidden; display: block; }
.av-photo img { display: block; width: 132px; height: 99px; object-fit: cover; transition: transform .25s ease; }
.av-photo:hover img { transform: scale(1.04); }
.av-photo:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }

/* Fenêtre photo */
.av-modale { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 92vh; overflow: visible; }
.av-modale::backdrop { background: rgba(36, 26, 20, .86); }
.av-modale[open] { animation: av-ouvrir .2s ease-out; }
.av-modale img { display: block; max-width: 100%; max-height: 84vh; width: auto; height: auto; border-radius: var(--rayon-petit); margin-inline: auto; }
.av-modale-legende { color: var(--nuit-texte); text-align: center; margin: .6rem 0 0; font-size: .9rem; }
.av-modale-fermer {
  position: absolute; top: -.9rem; right: -.9rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 0; background: var(--jaune); color: var(--brun); font-size: 1.7rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
@keyframes av-ouvrir { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* Tablette : deux colonnes plus serrées, la colonne de gauche reste fixe */
@media (min-width: 768px) and (max-width: 991px) {
  .av-grille { grid-template-columns: minmax(250px, 290px) minmax(0, 1fr); gap: 1.75rem; }
  .av-resume { padding: 1.4rem 1.1rem 1.2rem; }
  .av-tampon { width: 104px; height: 104px; }
}
/* Téléphone : une seule colonne, rien de fixe */
@media (max-width: 767px) {
  .av-grille { grid-template-columns: 1fr; }
  .av-resume { position: static; max-height: none; overflow: visible; }
  .av-produits-liste { max-width: 22rem; }
}
@media (max-width: 575px) {
  .av-tampon { width: 112px; height: 112px; }
  .av-photo img { width: 104px; height: 78px; }
  .av-modale-fermer { top: .4rem; right: .4rem; }
}

/* =====================================================================
   CARROUSEL D'AVIS (accueil et page de commande)
   ===================================================================== */
.av-carrousel-section { padding-top: 0; }
.av-carrousel-entete { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1.25rem; }
.av-carrousel-entete h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.av-carrousel-resume { display: flex; align-items: center; gap: .6rem; margin: .35rem 0 0; color: var(--brun-moyen); font-size: .95rem; }
.av-carrousel-resume strong { color: var(--brun); font-size: 1.05rem; }

.av-carrousel { position: relative; background: var(--sable-fonce); border-radius: var(--rayon); padding: 1.25rem 3.4rem; }
.av-piste {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 1rem) / 3);
  gap: 1rem; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none; padding: .25rem;
}
/* Calage des cartes activé au premier geste du visiteur (voir avis-clients.js) :
   actif dès le chargement, il empêche Chrome de mesurer le LCP de la page. */
.av-piste.av-cale { scroll-snap-type: x mandatory; }
.av-piste::-webkit-scrollbar { display: none; }
.av-carte {
  scroll-snap-align: start; background: #fff; border-radius: var(--rayon-petit);
  padding: 1.1rem 1.2rem 1rem; box-shadow: 0 2px 8px rgba(43, 32, 25, .07);
  display: flex; flex-direction: column; min-height: 13.5rem;
}
.av-carte .av-avis-auteur { margin-bottom: .55rem; }
.av-carte-date { display: block; font-size: .8rem; color: var(--brun-moyen); font-weight: 400; }
.av-carte h3 { font-size: 1.12rem; margin: .5rem 0 .25rem; line-height: 1.25; }
.av-carte p { margin: 0; font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.av-carte-lien { margin-top: auto; padding-top: .7rem; font-size: .9rem; }

.av-fleche {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--terre);
  background: #fff; color: var(--brun); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(43, 32, 25, .12); font-size: 1.1rem;
}
.av-fleche:hover { background: var(--jaune); border-color: var(--jaune); }
.av-fleche:disabled { opacity: .35; cursor: default; background: #fff; border-color: var(--terre); }
.av-fleche-g { left: .6rem; }
.av-fleche-d { right: .6rem; }

@media (max-width: 991px) { .av-piste { grid-auto-columns: calc((100% - 1rem) / 2); } }
@media (max-width: 640px) {
  .av-carrousel { padding: 1rem 2.6rem; }
  .av-piste { grid-auto-columns: 100%; }
  .av-fleche { width: 2.1rem; height: 2.1rem; }
  .av-fleche-g { left: .3rem; }
  .av-fleche-d { right: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .av-piste { scroll-behavior: auto; }
  .av-photo img, .av-modale[open] { transition: none; animation: none; }
}

/* Protections : la page de commande et les anciennes feuilles imposent
   leurs propres marges et alignements, on les neutralise ici. */
/* Le site coupe ce qui dépasse des sections (overflow: hidden), ce qui empêche
   la colonne de gauche de rester fixe : on le désactive sur cette page. */
#main.av-page .m-section { overflow: visible; }
/* Si l'écran est peu haut, la colonne fixe défile à l'intérieur d'elle-même */
.av-resume { max-height: calc(100vh - 130px); overflow-y: auto; scrollbar-width: thin; }
#main .av-entete h1 { font-size: clamp(1.9rem, 4.4vw, 3rem) !important; font-weight: 500; color: var(--brun); }
#main .av-carrousel-section { text-align: left; }
#main .av-carrousel-section header.av-avis-auteur { display: flex; justify-content: flex-start; text-align: left; padding: 0; background: none; position: static; }
#main .av-carrousel-section .av-carte p,
#main .av-carrousel-section .av-carte h3,
#main .av-carrousel-section .av-carte a,
#main .av-carrousel-section .av-prenom { text-align: left !important; }
#main .av-carrousel-section .av-carte p { font-size: .93rem; line-height: 1.55; }
#main .av-carrousel-section .av-carte h3 { margin: .5rem 0 .25rem; font-size: 1.12rem; }
#main .av-carrousel-section .av-carte-lien { align-self: flex-start; }
#main .av-carrousel-section .av-carrousel-resume { font-size: .95rem; margin: .35rem 0 0; }
#main .av-carrousel-section .av-carrousel-resume span { font-size: .95rem; }
