/* Fakker ! : page de vente. Page blanche, composants simples, touches d'orange.
   Règle de la marque : aucun angle arrondi, aucune ombre, aucun dégradé. */

:root {
  --blanc: #ffffff;
  --encre: #141414;
  --gris: #6b6b6b;
  --filet: #dcdcdc;
  --orange: #c8622e;
  --orange-fonce: #a94f22;
  --titre: "Alfa Slab One", Georgia, serif;
  --texte: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --marge: 16px;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--blanc);
  color: var(--encre);
  font: 400 16px/1.5 var(--texte);
  overflow-x: clip;
  padding-bottom: 76px; /* place pour la barre collée */
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2 { margin: 0; font-weight: 400; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* En-tête */
.entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--marge);
  background: var(--blanc); border-bottom: 1px solid var(--filet);
}
.logo { font: 26px/1 var(--titre); color: var(--orange); text-decoration: none; letter-spacing: .01em; }
.btn-panier { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.badge {
  position: absolute; top: 2px; right: 0;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--orange); color: var(--blanc);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* Produit */
.produit { padding: 16px var(--marge) 8px; }

.carrousel { margin: 0 calc(var(--marge) * -1); }
.carrousel-piste {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carrousel-piste::-webkit-scrollbar { display: none; }
.carrousel-piste img {
  flex: 0 0 100%; width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
  padding: 0 var(--marge); scroll-snap-align: center;
}
.points { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.points button { width: 12px; height: 12px; background: var(--filet); }
.points button[aria-current="true"] { background: var(--orange); }
.vignettes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 var(--marge); }
.vignettes button { aspect-ratio: 1 / 1; border: 1px solid var(--filet); padding: 4px; background: var(--blanc); }
.vignettes button[aria-current="true"] { border: 2px solid var(--orange); padding: 3px; }
.vignettes img { width: 100%; height: 100%; object-fit: contain; }

.fiche h1 { margin-top: 24px; font: 700 26px/1.2 var(--texte); letter-spacing: -.01em; }
.sous-titre { margin: 6px 0 0; color: var(--gris); }

/* Offres */
.offres { border: 0; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.offre {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 16px;
  border: 1px solid var(--filet); cursor: pointer;
}
.offre input { position: absolute; opacity: 0; pointer-events: none; }
.case { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--gris); }
.offre-nom { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-weight: 700; font-size: 18px; }
/* L'étiquette est posée sur le filet du haut, pour ne pas manger la place du prix */
.etiquette {
  position: absolute; top: -11px; left: 50px;
  font-style: normal; font-size: 12px; line-height: 20px; font-weight: 700;
  background: var(--orange); color: var(--blanc); padding: 0 8px;
}
.offres { gap: 14px; }
.offre-prix { white-space: nowrap; font-size: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 10px 0; }
.offre-nom { white-space: nowrap; }
.offre-prix s { color: var(--gris); font-size: 15px; margin-right: 6px; }
/* Économie de l'achat groupé, sous le prix */
.eco { font-style: normal; font-size: 13px; font-weight: 700; color: var(--orange); border: 1.5px solid var(--orange); padding: 1px 6px; line-height: 1.3; }
.offre:has(input:checked) { border: 2px solid var(--orange); padding: 0 15px; }
.offre input:checked + .case { background: var(--orange); border-color: var(--orange); }
.offre input:focus-visible + .case { outline: 2px solid var(--encre); outline-offset: 2px; }
/* Offre épuisée (stock suivi depuis le dashboard) */
.offre[hidden] { display: none; }
.offre.epuise { cursor: not-allowed; color: var(--gris); }
.offre.epuise .offre-prix { opacity: .5; }
.mot-epuise { font-style: normal; font-size: 12px; font-weight: 700; color: var(--gris); border: 1px solid var(--filet); padding: 0 6px; line-height: 20px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
/* Prix de lancement (le prix ne change pas ensuite, pas de faux prix barré) */
.prix-lancement { margin: 16px 0 0; display: inline-block; padding: 4px 10px; background: var(--orange); color: var(--blanc); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.ligne-livraison { margin: 0; display: flex; justify-content: space-between; color: var(--gris); font-size: 15px; }
.note { margin: 12px 0 0; color: var(--gris); font-size: 15px; }

/* Boutons */
.actions { display: grid; gap: 10px; margin-top: 18px; }
.btn {
  display: block; width: 100%; min-height: 54px; padding: 0 20px;
  font-weight: 700; font-size: 18px; text-align: center;
  transition: background-color .15s;
}
.btn-plein { background: var(--orange); color: var(--blanc); }
.btn-plein:hover { background: var(--orange-fonce); }
.btn-contour { border: 1.5px solid var(--encre); background: var(--blanc); }
.btn-contour:hover { background: #f5f5f5; }
.btn:focus-visible, .capture:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

/* Blocs du bas */
.bloc { padding: 32px var(--marge) 8px; margin-top: 24px; border-top: 1px solid var(--filet); }
.surtitre { margin: 0 0 4px; color: var(--orange); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.bloc h2 { font: 26px/1.15 var(--titre); }
.capture { display: block; width: 100%; margin-top: 18px; border: 1px solid var(--filet); }
.capture img { width: 100%; }
.video video[hidden], .video-vide[hidden] { display: none; }
.legende { margin: 8px 0 24px; color: var(--gris); font-size: 14px; text-align: center; }
.bloc .surtitre + .capture { margin-top: 8px; }

.video { margin-top: 18px; background: var(--encre); max-width: 420px; margin-left: auto; margin-right: auto; }
.video video { display: block; width: 100%; max-height: 80vh; background: var(--encre); }
.video-vide {
  margin: 0; aspect-ratio: 9 / 16; max-height: 80vh; width: 100%; display: grid; place-items: center;
  color: var(--blanc); font-weight: 700;
}

.pied { margin-top: 40px; padding: 24px var(--marge); border-top: 1px solid var(--filet); color: var(--gris); font-size: 14px; }
.pied p { margin: 0 0 4px; }

/* Barre collée en bas */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--marge) calc(10px + env(safe-area-inset-bottom));
  background: var(--blanc); border-top: 1px solid var(--filet);
  font-weight: 700; font-size: 17px;
  transform: translateY(100%); transition: transform .2s;
}
.barre.visible { transform: none; }
.barre .btn { width: auto; min-height: 48px; padding: 0 28px; }

/* Tiroir panier / commande */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.4); }
.tiroir {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(440px, 100%); display: flex; flex-direction: column;
  background: var(--blanc); transform: translateX(100%); transition: transform .25s;
  visibility: hidden;
}
.tiroir.ouvert { transform: none; visibility: visible; }
.tiroir-tete { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 var(--marge); border-bottom: 1px solid var(--filet); }
.tiroir-tete h2 { font: 22px/1 var(--titre); }
.fermer { width: 44px; height: 44px; font-size: 30px; line-height: 1; }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 16px var(--marge) 24px; display: flex; flex-direction: column; gap: 14px; }
.tiroir-corps[hidden] { display: none; }

.lignes { list-style: none; margin: 0; padding: 0; }
.lignes li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--filet); }
.lignes img { width: 52px; border: 1px solid var(--filet); }
.lignes .nom { flex: 1; font-weight: 700; }
.lignes .nom small { display: block; color: var(--gris); font-weight: 400; }
.qte { display: flex; align-items: center; border: 1px solid var(--filet); }
.qte button { width: 34px; height: 34px; font-size: 18px; }
.qte span { min-width: 22px; text-align: center; }
.vide { color: var(--gris); margin: 0; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--encre); margin-top: auto; }
/* Récapitulatif du panier, collé en bas du tiroir */
.recap-panier { margin-top: auto; display: grid; gap: 6px; }
.recap-panier .total { margin-top: 4px; }
.total b { font-size: 20px; }

#vue-commande label { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
#vue-commande input, #vue-commande select {
  width: 100%; height: 50px; padding: 0 12px;
  font: 16px var(--texte); color: var(--encre);
  border: 1px solid #bdbdbd; background: var(--blanc); appearance: none;
}
#vue-commande select { background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23141414' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; }
#vue-commande input:focus, #vue-commande select:focus { outline: none; border: 2px solid var(--orange); padding: 0 11px; }
#vue-commande .invalide { border-color: #b3261e; }
.recap { padding: 12px 14px; border: 1px solid var(--filet); font-size: 15px; }
.recap p { margin: 0; }
/* Code promo */
.code-promo { display: flex; gap: 8px; }
#vue-commande .code-promo input { flex: 1; min-width: 0; text-transform: uppercase; }
.btn-code { flex: none; padding: 0 16px; border: 1.5px solid var(--encre); background: var(--blanc); font-weight: 700; font-size: 15px; }
.btn-code:hover { background: #f5f5f5; }
.code-etat { margin: -6px 0 0; font-size: 14px; color: var(--gris); }
.code-etat.ok { color: #1f7a45; font-weight: 600; }
.mention { margin: -6px 0 0; color: var(--gris); font-size: 12px; }
.erreur { margin: 0; color: #b3261e; font-size: 14px; }
.merci { font: 22px/1.2 var(--titre); color: var(--orange); margin: 8px 0 0; }

/* Loupe */
.loupe { position: fixed; inset: 0; z-index: 40; background: var(--blanc); overflow: auto; }
.loupe img { max-width: none; width: 200%; }
.loupe .fermer { position: fixed; top: 8px; right: 8px; background: var(--blanc); border: 1px solid var(--filet); }

body.bloque { overflow: hidden; }

/* PC : le carrousel à gauche, la fiche à droite ; le reste sur une colonne lisible */
@media (min-width: 900px) {
  :root { --marge: 32px; }
  body { padding-bottom: 0; }
  .entete { height: 72px; padding: 0 max(var(--marge), calc((100vw - 1120px) / 2)); }
  .produit {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start;
    max-width: 1120px; margin: 0 auto; padding: 40px var(--marge);
  }
  .carrousel { margin: 0; position: sticky; top: 96px; }
  .carrousel-piste img { padding: 0; }
  .vignettes { padding: 0; }
  .fiche h1 { margin-top: 0; font-size: 34px; }
  .bloc { max-width: 900px; margin: 40px auto 0; }
  .bloc h2 { font-size: 34px; }
  .capture-solution { max-width: 560px; margin-left: auto; margin-right: auto; }
  .loupe img { width: auto; max-width: 100%; margin: 0 auto; }
  .pied { text-align: center; }
  .barre { display: none; }
}

/* ---------- Animations au lancement (2026-11-20) ----------
   Seulement opacité et déplacement : rien ne bouge dans la mise en page. Ordre : en-tête, photo du
   livre, titre, prix, les 3 offres une par une, boutons. Les blocs du bas apparaissent au défilement
   (classe .a-reveler posée par app.js : sans JavaScript, tout reste visible). */
@keyframes monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes descend { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes apparait { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.08); } 100% { transform: none; } }

:root { --doux: cubic-bezier(.2, .7, .2, 1); }
.entete { animation: descend .5s var(--doux) both; }
.carrousel-piste { animation: apparait .9s var(--doux) .08s both; }
.points, .vignettes { animation: monte .6s var(--doux) .35s both; }
.fiche > * { animation: monte .65s var(--doux) both; }
.fiche h1 { animation-delay: .18s; }
.fiche .sous-titre { animation-delay: .26s; }
.fiche .prix-lancement { animation-delay: .34s; }
.fiche .offres { animation: none; }
.offre { animation: monte .6s var(--doux) both; }
.offre:nth-of-type(1) { animation-delay: .42s; }
.offre:nth-of-type(2) { animation-delay: .5s; }
.offre:nth-of-type(3) { animation-delay: .58s; }
.offre .etiquette { display: inline-block; animation: pop .45s var(--doux) 1s both; }
.fiche .note { animation-delay: .66s; }
.fiche .actions { animation-delay: .74s; }

.a-reveler { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--doux), transform .7s var(--doux); }
.a-reveler.revele { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .entete, .carrousel-piste, .points, .vignettes, .fiche > *, .offre, .offre .etiquette { animation: none; }
  .a-reveler { opacity: 1; transform: none; transition: none; }
}

/* Lien vers l'espace pros (page distributeurs), en pied de page */
.lien-pros { margin-top: 10px !important; }
.lien-pros a { color: var(--encre); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--orange); }

/* Un lien habillé en bouton (ex. « Voir le livre » après une demande pro) : texte centré, sans soulignement ni violet */
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--encre); }
a.btn-plein { color: var(--blanc); }
