/* T559 (#634) : avis clients réels (accueil, créer, avis.html, mon-avis.html). Chargée par avis.js seulement quand un avis publié est à
   montrer (accueil, créer), directement sur les deux pages d'avis. Reprend la maquette validée par Benjamin le 12/11. */
:root { --av-star: #e2a12b; --av-off: #e6dccd; --av-ok: #2f7d4f; --av-creme: #fffaf2; --av-miel: #ead2aa; --av-bord: #eadfce; }

/* Étoiles : une rangée grise, une rangée dorée coupée à la note (4,8 => 96 %) */
.av-st { position: relative; display: inline-flex; vertical-align: middle; line-height: 0; color: var(--av-off); }
.av-st > span { display: inline-flex; gap: 1px; }
.av-st svg { flex: none; width: var(--s, 16px); height: var(--s, 16px); fill: currentColor; }
.av-st .av-st-f { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 100%); overflow: hidden; color: var(--av-star); }

/* Barre de note sous l'accroche : centrée, sur toute la largeur (Benjamin, 12/11) */
.av-hero { margin: 12px 0 0; }
.av-mini { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; background: #fff;
  border: 1px solid var(--hm-line, #e5d3b8); color: var(--hm-ink, #3b2a1c); font-size: 14px; line-height: 20px; text-decoration: none; box-shadow: 0 1px 3px rgba(59, 42, 28, .08); }
.av-mini b { font-weight: 800; }
.av-mini .av-n { color: var(--hm-muted, #6b5a4a); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* Section de l'accueil : bandeau de note moyenne puis les cartes */
.av-sec { margin: 32px 0; }
.av-sum { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 14px; margin: 12px 0 14px; padding: 14px 16px; border-radius: 16px;
  background: var(--av-creme); border: 1px solid var(--av-miel); color: var(--hm-ink, #3b2a1c); text-decoration: none; }
.av-sum.av-sum-n { grid-template-columns: 1fr auto; }
.av-big { font-family: var(--hm-serif, Georgia, serif); font-weight: 700; font-size: 42px; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.av-big small { font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--hm-muted, #6b5a4a); }
.av-mid { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.av-mid > span:last-child { font-size: 14px; line-height: 19px; color: var(--hm-muted, #6b5a4a); }
.av-mid > span:last-child b { color: var(--hm-ink, #3b2a1c); }
.av-go { font-weight: 600; font-size: 15px; color: var(--hm-acc, #b5542a); white-space: nowrap; }
@media (max-width: 479px) { .av-sum, .av-sum.av-sum-n { grid-template-columns: auto 1fr; } .av-sum.av-sum-n .av-mid { grid-column: 1 / -1; } .av-go { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--av-miel); text-align: center; } }

/* Rangée de cartes : défilement au doigt au téléphone (la carte suivante dépasse), grille de 3 sur ordinateur */
.av-rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -10px; padding: 2px 10px 12px; scroll-padding: 0 10px; scrollbar-width: none; }
.av-rail::-webkit-scrollbar { display: none; }
.av-rail > .av-card { flex: 0 0 80%; scroll-snap-align: start; }
.av-rail > .av-card:only-child { flex-basis: 100%; }
@media (min-width: 720px) { .av-rail { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0 0 4px; } }
.av-rail .av-rep { display: none; } /* la réponse de la boutique se lit sur la page « Tous les avis » */
.av-how { margin: 10px 0 0; font-size: 13px; line-height: 18px; color: var(--hm-muted, #6b5a4a); text-align: left; }
.av-how a { color: var(--hm-acc, #b5542a); text-decoration: underline; text-underline-offset: 2px; }

/* Carte d'avis */
.av-card { position: relative; display: flex; flex-direction: column; box-sizing: border-box; min-width: 0; background: #fff; border: 1px solid var(--av-bord); border-radius: 14px;
  overflow: hidden; box-shadow: 0 8px 18px -12px rgba(59, 42, 28, .45); text-align: left; color: var(--hm-ink, #3b2a1c); }
.av-ph { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: #f3ece2; }
.av-ph img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.av-bd { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 14px 14px; }
.av-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.av-date { font-size: 13px; line-height: 18px; color: var(--hm-muted, #6b5a4a); white-space: nowrap; }
.av-txt { margin: 0; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.av-rep { margin: 2px 0 0; padding: 8px 10px; border-left: 3px solid var(--hm-acc, #b5542a); border-radius: 0 8px 8px 0; background: var(--av-creme); font-size: 14px; line-height: 19px; color: #4a3424; }
.av-rep b { display: block; font-size: 13px; color: var(--hm-acc, #b5542a); }
.av-who { margin: auto 0 0; padding-top: 4px; font-size: 14px; line-height: 19px; }
.av-who b { font-weight: 700; }
.av-ok { display: flex; align-items: center; flex-wrap: wrap; gap: 0 5px; margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--av-ok); }
.av-ok svg { flex: none; width: 16px; height: 16px; }
.av-ok small { flex-basis: 100%; padding-left: 21px; font-size: 13px; font-weight: 400; color: var(--hm-muted, #6b5a4a); }

/* Carte compacte (page de création) : photo à gauche, texte à droite ; conteneur à part sous l'étape 3 (Benjamin, 12/11) */
.av-card.av-c { display: grid; grid-template-columns: 96px 1fr; }
.av-card.av-c.av-np { grid-template-columns: 1fr; }
.av-card.av-c .av-ph { aspect-ratio: auto; height: 100%; min-height: 132px; }
.av-card.av-c .av-bd { gap: 4px; padding: 10px 12px 10px; }
.av-card.av-c .av-txt { font-size: 14px; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.av-card.av-c .av-who, .av-card.av-c .av-ok { font-size: 13px; line-height: 17px; }
.av-cre { box-sizing: border-box; margin: 28px 0 16px; padding: 16px 12px 12px; background: #fff; border: 1.5px solid var(--av-bord); border-radius: 16px; text-align: left; scroll-margin-top: 84px; }
@media (min-width: 700px) { .av-cre { max-width: 620px; margin: 28px auto 16px; padding: 16px 14px 14px; } }
.av-cre-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-weight: 800; font-size: 16px; line-height: 22px; color: var(--hm-ink, #3b2a1c); }
.av-cre-t a { font-weight: 600; font-size: 14px; color: var(--hm-acc, #b5542a); white-space: nowrap; }
.av-rail2 { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 2px 12px 10px; scroll-padding: 0 12px; scrollbar-width: none; }
.av-rail2::-webkit-scrollbar { display: none; }
.av-rail2 > .av-card { flex: 0 0 88%; scroll-snap-align: start; }
.av-rail2 > .av-card:only-child { flex-basis: 100%; }
@media (min-width: 720px) { .av-rail2 > .av-card { flex-basis: 47%; } }

/* Page « Tous les avis » */
.av-head { display: grid; gap: 14px; margin: 0 0 14px; padding: 16px; border-radius: 16px; background: var(--av-creme); border: 1px solid var(--av-miel); }
.av-head .av-sc { display: flex; align-items: center; gap: 14px; }
.av-dist { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 16px; color: var(--hm-muted, #6b5a4a); }
.av-dist:empty { display: none; }
.av-dist li { display: grid; grid-template-columns: 62px 1fr 24px; align-items: center; gap: 8px; }
.av-dist li span:last-child { text-align: right; }
.av-bar { height: 8px; border-radius: 99px; background: #efe6d8; overflow: hidden; }
.av-bar i { display: block; height: 100%; border-radius: 99px; background: var(--av-star); }
@media (min-width: 720px) { .av-head { grid-template-columns: 300px 1fr; align-items: center; } }
.av-vide { margin: 0 0 14px; padding: 14px; border: 1.5px dashed #e2d3c0; border-radius: 12px; color: var(--hm-muted, #6b5a4a); }
.av-verif { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #f1f7f2; border: 1px solid #cfe3d5; color: #2f4a3a; font-size: 14px; line-height: 20px; scroll-margin-top: 96px; }
.av-verif > summary { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; list-style: none; font-weight: 700; color: var(--av-ok); }
.av-verif > summary::-webkit-details-marker { display: none; }
.av-verif > summary svg { flex: none; width: 20px; height: 20px; }
.av-verif ul { margin: 8px 0 0; padding: 0 0 0 18px; }
.av-verif li { margin: 0 0 5px; }
.av-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -8px 8px; padding: 0 8px 4px; scrollbar-width: none; }
.av-chips button { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--hm-line, #e5d3b8); background: #fff; font: inherit; font-size: 14px; color: var(--hm-ink, #3b2a1c); cursor: pointer; }
.av-chips button[aria-pressed="true"] { background: var(--hm-ink, #3b2a1c); border-color: var(--hm-ink, #3b2a1c); color: #fff; }
.av-sort { margin: 0 0 10px; font-size: 13px; line-height: 18px; color: var(--hm-muted, #6b5a4a); }
.av-list { display: grid; gap: 12px; margin: 0 0 16px; }
@media (min-width: 720px) { .av-list { grid-template-columns: repeat(2, 1fr); } }
.av-empty { margin: 8px 0; padding: 14px; border: 1.5px dashed #e2d3c0; border-radius: 12px; text-align: center; color: var(--hm-muted, #6b5a4a); }

/* Formulaire « Votre avis » (lien de l'e-mail de livraison) */
.av-form { max-width: 560px; margin: 0 auto; text-align: left; }
.av-form[hidden], .av-merci[hidden], .av-err[hidden], .av-pv[hidden], .av-drop[hidden] { display: none; }
.av-cmd { display: flex; flex-direction: column; gap: 2px; margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--av-bord); font-size: 14px; line-height: 19px; color: var(--hm-muted, #6b5a4a); }
.av-cmd b { color: var(--hm-ink, #3b2a1c); }
.av-q { display: block; margin: 0 0 6px; font-weight: 700; font-size: 16px; line-height: 22px; color: var(--hm-ink, #3b2a1c); }
.av-q small { font-weight: 400; color: var(--hm-muted, #6b5a4a); }
.av-rate { display: flex; align-items: center; gap: 2px; margin: 0 0 18px; }
.av-rate button { width: 50px; height: 50px; padding: 4px; border: 0; background: none; color: var(--av-off); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.av-rate button svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.av-rate button.on { color: var(--av-star); }
.av-rate output { margin-left: 8px; font-weight: 700; font-size: 15px; color: var(--hm-ink, #3b2a1c); }
.av-f { display: block; margin: 0 0 16px; }
.av-f input[type="text"], .av-f textarea { display: block; box-sizing: border-box; width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--hm-ink, #3b2a1c);
  background: #fff; border: 1px solid var(--hm-line, #e5d3b8); border-radius: 8px; }
.av-f textarea { height: 112px; padding: 10px 14px; line-height: 1.4; resize: vertical; }
.av-f input:focus, .av-f textarea:focus { outline: 2px solid var(--hm-acc, #b5542a); outline-offset: 1px; border-color: transparent; }
.av-cnt { display: block; margin-top: 3px; font-size: 12px; text-align: right; color: var(--hm-muted, #6b5a4a); }
.av-3 { display: grid; grid-template-columns: 1fr 76px; gap: 10px; }
.av-3 .av-f { margin-bottom: 12px; }
.av-3 .av-q { font-size: 14px; font-weight: 600; }
.av-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px dashed #e2c7ae; border-radius: 12px; background: #fff8f1; color: #6b3a1f; cursor: pointer; font-size: 14px; line-height: 19px; }
.av-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.av-drop svg { flex: none; width: 34px; height: 34px; color: var(--hm-acc, #b5542a); }
.av-drop b { display: block; font-size: 16px; color: var(--hm-ink, #3b2a1c); }
.av-pv { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--av-bord); border-radius: 12px; background: #fff; font-size: 14px; line-height: 19px; }
.av-pv img { width: 112px; height: 84px; object-fit: cover; border-radius: 8px; }
.av-pv button { min-height: 36px; margin-top: 2px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--hm-acc, #b5542a); text-decoration: underline; cursor: pointer; }
.av-tip { margin: 6px 0 16px; font-size: 13px; line-height: 18px; color: var(--hm-muted, #6b5a4a); }
.av-chk { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; font-size: 14px; line-height: 20px; color: #4a3424; cursor: pointer; }
.av-chk input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--hm-acc, #b5542a); }
.av-apercu { margin: 18px 0 14px; }
.av-apercu .av-card { max-width: 340px; }
.av-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fdeee8; border: 1px solid #f0c3b5; color: #8a2e1c; font-size: 14px; line-height: 19px; }
.av-err a { color: inherit; }
.av-legal { margin: 10px 0 0; font-size: 12px; line-height: 17px; color: var(--hm-muted, #6b5a4a); }
.av-legal a { color: var(--hm-acc, #b5542a); }
#avEnvoyer:disabled { opacity: .6; cursor: progress; }
.av-merci { max-width: 520px; margin: 0 auto; text-align: center; }
.av-merci .av-rond { display: grid; place-items: center; width: 72px; height: 72px; margin: 8px auto 12px; border-radius: 50%; background: #e7f1ea; color: var(--av-ok); }
.av-merci .av-rond svg { width: 38px; height: 38px; }
.av-merci-t { margin: 0 0 10px; font-family: var(--hm-serif, Georgia, serif); font-weight: 700; font-size: 28px; line-height: 34px; color: var(--hm-ink, #3b2a1c); }
.av-merci p { margin: 0 0 12px; font-size: 16px; line-height: 23px; color: #4a3424; }
