/* ==========================================================================
   Livres de maths du CP à la Terminale — boutique Maths PDF
   Meme charte que /Activites-mentales/ (couleurs par niveau, cartes, heros).
   Feuille partagee avec les pages de caisse de mathovore.fr/livres/ :
   servie avec un cache de 10 ans, monter ?v= a chaque retouche.
   CP rose · CE1 rouge · CE2 ambre · CM1 lime · CM2 cyan
   ========================================================================== */

:root {
  --encre: #15192b;
  --encre-douce: #4a5170;
  --encre-pale: #767ea0;
  --fond: #f6f7fb;
  --carte: #ffffff;
  --bord: #e3e6f0;
  --bord-fort: #cdd2e4;

  --rose: #d81b76;   --rose-clair: #fdeaf3;
  --rouge: #d81e42;  --rouge-clair: #ffe9ee;
  --ambre: #b8810b;  --ambre-clair: #fdf4e0;
  --lime: #4f8a0d;   --lime-clair: #f0f8e2;
  --cyan: #0e87c7;   --cyan-clair: #e4f3fc;
  --vert: #0e9f6e;   --vert-clair: #e6f7f1;
  --bleu: #2563eb;   --bleu-clair: #e8efff;
  --orange: #e3721a; --orange-clair: #fff0e3;
  --violet: #8b3fd4; --violet-clair: #f5ecfe;
  --turquoise: #0d9488; --turquoise-clair: #e2f6f4;
  --indigo: #4f46e5; --indigo-clair: #ecebfe;
  --fuchsia: #b026bd; --fuchsia-clair: #fbe9fd;

  --paypal: #ffc439;
  --paypal-fonce: #f2ae0e;

  --accent: var(--bleu);
  --accent-clair: var(--bleu-clair);

  --rayon: 16px;
  --rayon-s: 10px;
  --ombre: 0 1px 2px rgba(21, 25, 43, .05), 0 8px 24px -12px rgba(21, 25, 43, .18);
  --ombre-forte: 0 2px 4px rgba(21, 25, 43, .06), 0 18px 40px -16px rgba(21, 25, 43, .3);
  --degrade: linear-gradient(100deg, #d81b76 0%, #b8810b 18%, #0e9f6e 38%, #2563eb 58%, #4f46e5 78%, #b026bd 100%);
  --police: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.65;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; }
.contenu { width: min(1180px, 100% - 32px); margin-inline: auto; }
.contenu-etroit { width: min(720px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.t-rose  { --accent: var(--rose);  --accent-clair: var(--rose-clair); }
.t-rouge { --accent: var(--rouge); --accent-clair: var(--rouge-clair); }
.t-ambre { --accent: var(--ambre); --accent-clair: var(--ambre-clair); }
.t-lime  { --accent: var(--lime);  --accent-clair: var(--lime-clair); }
.t-cyan  { --accent: var(--cyan);  --accent-clair: var(--cyan-clair); }
.t-bleu  { --accent: var(--bleu);  --accent-clair: var(--bleu-clair); }
.t-vert      { --accent: var(--vert);      --accent-clair: var(--vert-clair); }
.t-orange    { --accent: var(--orange);    --accent-clair: var(--orange-clair); }
.t-violet    { --accent: var(--violet);    --accent-clair: var(--violet-clair); }
.t-turquoise { --accent: var(--turquoise); --accent-clair: var(--turquoise-clair); }
.t-indigo    { --accent: var(--indigo);    --accent-clair: var(--indigo-clair); }
.t-fuchsia   { --accent: var(--fuchsia);   --accent-clair: var(--fuchsia-clair); }

/* --- Bandeau et menu : ils defilent avec la page (jamais sticky) --------- */
.banniere { display: block; width: 100%; line-height: 0; background: var(--carte); }
.banniere:hover { text-decoration: none; }
.banniere img { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 549; }

.entete {
  position: static;
  background: var(--carte);
  border-bottom: 1px solid var(--bord);
}
.entete-inner { display: flex; align-items: center; padding: 8px 0; min-height: 54px; }
.entete .google-auto-placed { display: none !important; }
.nav { display: flex; align-items: center; justify-content: flex-start; gap: 2px; flex-wrap: wrap; }
.nav-lien {
  display: inline-flex; align-items: center;
  margin: 0; padding: 8px 14px; border-radius: 99px;
  font-size: .92rem; font-weight: 650; color: var(--encre-douce);
  white-space: nowrap;
}
.nav-lien:hover { background: var(--fond); color: var(--encre); text-decoration: none; }
.nav-marque { color: #fff; background: var(--degrade); font-weight: 800; letter-spacing: .02em; margin-right: 6px; }
.nav-marque:hover { color: #fff; background: var(--degrade); filter: brightness(1.06); }
@media (max-width: 860px) {
  .entete-inner { padding: 6px 0; min-height: 46px; }
  .nav-lien { padding: 7px 10px; font-size: .84rem; }
}
@media (max-width: 480px) {
  .nav { gap: 2px 0; }
  .nav-lien { padding: 6px 8px; font-size: .8rem; }
  .nav-marque { margin-right: 2px; }
}

/* --- Heros ---------------------------------------------------------------- */
.heros { position: relative; padding: 58px 0 40px; text-align: center; overflow: hidden; }
.heros::before {
  content: ""; position: absolute; z-index: 0; inset: -45% -12% auto; height: 640px; pointer-events: none;
  background:
    radial-gradient(32% 48% at 6% 30%,  rgba(216, 27, 118, .26), transparent 68%),
    radial-gradient(30% 46% at 28% 8%,  rgba(184, 129, 11, .24), transparent 68%),
    radial-gradient(30% 48% at 48% 26%, rgba(14, 159, 110, .28), transparent 68%),
    radial-gradient(30% 46% at 68% 8%,  rgba(37, 99, 235, .30), transparent 68%),
    radial-gradient(30% 48% at 88% 28%, rgba(79, 70, 229, .28), transparent 68%),
    radial-gradient(28% 44% at 99% 10%, rgba(176, 38, 189, .26), transparent 68%);
}
.heros > .contenu { position: relative; z-index: 1; }
.badge-degrade {
  display: inline-block; margin-bottom: 18px; padding: 7px 18px; border-radius: 99px;
  background: var(--degrade); color: #fff; font-size: .82rem; font-weight: 750; letter-spacing: .03em;
  box-shadow: 0 8px 22px -10px rgba(190, 40, 90, .7);
}
.heros h1 {
  margin: 0 0 14px; font-size: clamp(2.2rem, 6.2vw, 3.9rem);
  line-height: 1.08; letter-spacing: -.035em; font-weight: 800;
  background: var(--degrade); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent; padding-bottom: .08em;
}
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .heros h1 { color: var(--encre); -webkit-text-fill-color: currentColor; }
}
.chapeau { margin: 0 auto; max-width: 700px; font-weight: 500; font-size: clamp(1.03rem, 2.2vw, 1.18rem); color: var(--encre-douce); }

.atouts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.atouts li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 99px; background: var(--carte); border: 1px solid var(--bord);
  font-size: .9rem; font-weight: 650; box-shadow: var(--ombre);
}
.atouts li span { font-size: 1.05rem; }

/* Etagere de couvertures sous le titre */
.etagere {
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(6px, 1.4vw, 16px);
  margin: 34px auto 0; max-width: 1100px; padding: 0 0 18px; position: relative;
}
.etagere::after {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: 6px; height: 12px; border-radius: 99px;
  background: linear-gradient(180deg, #d9c2a0, #b89468); box-shadow: 0 10px 18px -8px rgba(90, 60, 20, .5);
}
.etagere a { flex: 0 1 150px; position: relative; z-index: 1; transition: transform .22s; }
.etagere a:nth-child(odd) { transform: rotate(-2.5deg); }
.etagere a:nth-child(even) { transform: rotate(2deg) translateY(-6px); }
.etagere a:hover { transform: translateY(-12px) scale(1.04); }
.etagere img {
  display: block; width: 100%; border-radius: 3px 8px 8px 3px;
  box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, .3), 0 14px 26px -12px rgba(21, 25, 43, .55);
}
@media (max-width: 760px) { .etagere a:nth-child(n+6) { display: none; } }
@media (max-width: 480px) { .etagere a:nth-child(n+4) { display: none; } }
@media (max-width: 560px) { .raccourcis-cycle > span { width: 100%; text-align: center; } }

.raccourcis { margin-top: 26px; }
.raccourcis a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 7px; border-radius: 99px;
  background: var(--carte); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--bord));
  font-size: .9rem; font-weight: 700; color: var(--encre); box-shadow: var(--ombre);
}
.raccourcis a b { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .8rem; }
.raccourcis a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.lien-deja { margin-top: 18px; font-size: .92rem; color: var(--encre-pale); }

.avis {
  margin: 0 auto 10px; max-width: 760px; padding: 12px 18px; border-radius: 12px;
  background: var(--ambre-clair); border: 1px solid color-mix(in srgb, var(--ambre) 35%, transparent);
  color: color-mix(in srgb, var(--ambre) 70%, #000); font-weight: 600; font-size: .95rem; text-align: center;
}
.avis[hidden] { display: none; }

/* --- Cycles (Primaire, College, Lycee) ---------------------------------- */
.cycle { scroll-margin-top: 16px; margin: 0 0 12px; }
.cycle + .cycle { margin-top: 26px; padding-top: 30px; border-top: 1px solid var(--bord); }
.cycle-titre {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: 0 0 6px; font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.03em;
}
.cycle-titre .cycle-compte {
  padding: 4px 12px; border-radius: 99px; background: var(--carte); border: 1px solid var(--bord);
  font-size: .8rem; font-weight: 700; color: var(--encre-pale); letter-spacing: 0;
}
.cycle-chapeau { margin: 0 0 26px; color: var(--encre-douce); font-size: 1.02rem; max-width: 75ch; }
.cycle-tout {
  margin-left: auto; align-self: center; padding: 8px 16px; border-radius: 99px; cursor: pointer;
  border: 0; background: var(--encre); color: #fff; font: inherit; font-size: .84rem; font-weight: 750; letter-spacing: 0;
}
.cycle-tout:hover { filter: brightness(1.25); }
.raccourcis-cycle { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.raccourcis-cycle + .raccourcis-cycle { margin-top: 8px; }
.raccourcis-cycle > span { align-self: center; min-width: 70px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-pale); }
.raccourcis .raccourcis-cycle a { padding: 5px 12px 5px 5px; font-size: .84rem; }

/* --- Boutique : catalogue + panier --------------------------------------- */
.boutique { display: grid; gap: 28px; align-items: start; padding: 10px 0 30px; }
@media (min-width: 1040px) { .boutique { grid-template-columns: minmax(0, 1fr) 340px; } }

.niveau-bloc { scroll-margin-top: 16px; margin-bottom: 34px; }
.niveau-titre { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 6px; }
.niveau-titre .gros-chiffre {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 62px; height: 52px; padding: 0 16px; border-radius: 16px;
  background: var(--accent); color: #fff; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
  box-shadow: 0 10px 22px -10px var(--accent);
}
.niveau-titre h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; letter-spacing: -.025em; }
.niveau-chapeau { margin: 0 0 16px; color: var(--encre-douce); font-size: 1rem; max-width: 75ch; }
.ajout-duo {
  margin-left: auto; padding: 7px 14px; border-radius: 99px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-clair);
  color: var(--accent); font: inherit; font-size: .84rem; font-weight: 750;
}
.ajout-duo:hover { background: color-mix(in srgb, var(--accent) 18%, #fff); }

.livres { display: grid; gap: 18px; }
@media (min-width: 760px) { .livres { grid-template-columns: repeat(2, 1fr); } }

.livre {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px;
  padding: 18px; position: relative; overflow: hidden;
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 11%, #fff) 0%, #fff 55%);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--bord));
  border-radius: var(--rayon);
  box-shadow: 0 1px 2px rgba(21, 25, 43, .05), 0 14px 30px -18px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.livre::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 6px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 42%, #fff));
}
.livre:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 2px 4px rgba(21, 25, 43, .06), 0 24px 44px -20px color-mix(in srgb, var(--accent) 85%, transparent); }
.livre.dans-panier { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 24px 44px -20px color-mix(in srgb, var(--accent) 85%, transparent); }

.couverture {
  display: block; padding: 0; border: 0; background: none; cursor: zoom-in; align-self: start;
  border-radius: 3px 8px 8px 3px; position: relative;
}
.couverture img {
  display: block; width: 100%; border-radius: 3px 8px 8px 3px;
  box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, .3), 0 12px 24px -12px rgba(21, 25, 43, .6);
  transition: transform .2s;
}
.couverture:hover img { transform: rotate(-1.5deg) scale(1.03); }
.couverture .loupe {
  position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--encre);
  font-size: .95rem; box-shadow: var(--ombre);
}

.livre-corps { display: flex; flex-direction: column; min-width: 0; }
.type {
  align-self: flex-start; padding: 3px 11px; border-radius: 99px; margin-bottom: 8px;
  background: var(--accent-clair); color: color-mix(in srgb, var(--accent) 85%, #000);
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.livre h3 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.3; font-weight: 750; }
.livre p { margin: 0 0 10px; font-size: .9rem; color: var(--encre-douce); }
.chiffres { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; padding: 0; list-style: none; }
.chiffres li {
  padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 12%, #fff); color: color-mix(in srgb, var(--accent) 82%, #000);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.sommaire { margin: 0 0 12px; font-size: .86rem; }
.sommaire summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
.sommaire summary::-webkit-details-marker { display: none; }
.sommaire summary::before { content: "▸ "; }
.sommaire[open] summary::before { content: "▾ "; }
.sommaire ol { margin: 8px 0 0; padding-left: 22px; color: var(--encre-douce); columns: 1; }
.sommaire li { margin-bottom: 2px; break-inside: avoid; }
.achat { margin-top: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--accent) 32%, transparent); }
.prix { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.prix small { display: block; font-size: .7rem; font-weight: 600; color: var(--encre-pale); letter-spacing: 0; margin-top: -4px; }
.bouton-panier {
  margin-left: auto; padding: 10px 16px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-size: .9rem; font-weight: 750;
  box-shadow: 0 10px 20px -12px var(--accent); transition: transform .15s, filter .15s;
}
.bouton-panier:hover { transform: translateY(-1px); filter: brightness(1.07); }
.bouton-panier[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 440px) {
  .livre { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 16px 14px; }
  .bouton-panier { margin-left: 0; width: 100%; }
}

/* Offre « tout le primaire » */
.offre-complete {
  display: grid; gap: 18px; align-items: center; padding: 24px; margin: 6px 0 10px;
  border-radius: var(--rayon); color: #fff; background: var(--degrade); box-shadow: var(--ombre-forte);
}
@media (min-width: 720px) { .offre-complete { grid-template-columns: 1fr auto; } }
.offre-complete h2 { margin: 0 0 4px; font-size: 1.4rem; letter-spacing: -.02em; }
.offre-complete p { margin: 0; opacity: .95; }
.offre-complete button {
  padding: 12px 20px; border-radius: 12px; border: 0; cursor: pointer; background: #fff; color: var(--encre);
  font: inherit; font-weight: 800; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .5);
}

/* Panier : colonne verticale, collante seulement sur grand ecran */
.panier {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); padding: 20px; scroll-margin-top: 16px;
}
@media (min-width: 1040px) { .panier { position: sticky; top: 16px; } }
.panier h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.2rem; }
.panier h2 .compteur { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; background: var(--bleu); color: #fff; font-size: .8rem; }
.panier-vide { color: var(--encre-pale); font-size: .92rem; margin: 0 0 14px; }
.panier-liste { list-style: none; margin: 0 0 12px; padding: 0; }
.panier-liste li { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bord); font-size: .88rem; }
.panier-liste img { width: 38px; border-radius: 2px 4px 4px 2px; box-shadow: 0 4px 8px -4px rgba(0, 0, 0, .5); }
.panier-liste b { display: block; font-weight: 700; line-height: 1.3; }
.panier-liste span { color: var(--encre-pale); font-size: .8rem; }
.retirer { border: 0; background: none; cursor: pointer; color: var(--encre-pale); font-size: 1.1rem; padding: 4px 6px; border-radius: 8px; }
.retirer:hover { background: var(--rouge-clair); color: var(--rouge); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 16px; font-weight: 700; }
.total b { font-size: 1.6rem; letter-spacing: -.02em; }
.bouton-paypal {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 14px 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--paypal); color: #111; font: inherit; font-size: 1rem; font-weight: 800;
  box-shadow: 0 10px 22px -12px rgba(160, 110, 0, .8); transition: background .15s, transform .15s;
}
.bouton-paypal:hover { background: var(--paypal-fonce); transform: translateY(-1px); }
.bouton-paypal:disabled { background: var(--bord); color: var(--encre-pale); box-shadow: none; cursor: not-allowed; transform: none; }
.bouton-paypal svg { height: 20px; width: auto; }
.garanties { list-style: none; margin: 16px 0 0; padding: 0; font-size: .82rem; color: var(--encre-douce); }
.garanties li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.garanties li::before { content: "✓"; position: absolute; left: 0; color: var(--vert); font-weight: 800; }
.mention-paiement { margin: 12px 0 0; font-size: .76rem; color: var(--encre-pale); line-height: 1.5; }

.bulle-panier {
  position: fixed; right: 14px; bottom: 76px; z-index: 50;
  display: none; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 99px;
  background: var(--encre); color: #fff; font-weight: 750; font-size: .92rem; box-shadow: var(--ombre-forte);
}
.bulle-panier:hover { text-decoration: none; color: #fff; }
.bulle-panier b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; background: var(--paypal); color: #111; font-size: .8rem; }
@media (max-width: 1039px) { .bulle-panier.visible { display: inline-flex; } }

/* Bouton retour en haut (rouge de /escape-game-maths.html) */
#haut-de-page {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
  box-shadow: 0 6px 20px rgba(220, 38, 38, .35);
  opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .22s, transform .22s, filter .18s;
}
#haut-de-page[hidden] { display: none; }
#haut-de-page.visible { opacity: 1; transform: none; pointer-events: auto; }
#haut-de-page:hover { filter: brightness(.92); }
#haut-de-page:focus-visible { outline: 3px solid #fecaca; outline-offset: 3px; }
#haut-de-page svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { #haut-de-page { right: 14px; bottom: 14px; width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { #haut-de-page { transition: none; } }
@media print { #haut-de-page { display: none !important; } }

/* --- Sections de texte ---------------------------------------------------- */
.section { padding: 44px 0; }
.section-blanche { background: var(--carte); border-block: 1px solid var(--bord); }
.section-titre { margin: 0 0 8px; font-size: clamp(1.45rem, 3.2vw, 1.95rem); font-weight: 800; letter-spacing: -.025em; }
.section-chapeau { margin: 0 0 26px; color: var(--encre-douce); max-width: 72ch; }

.etapes { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
@media (min-width: 700px) { .etapes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .etapes { grid-template-columns: repeat(4, 1fr); } }
.etapes li {
  position: relative; padding: 20px 18px 18px; border-radius: var(--rayon);
  background: var(--fond); border: 1px solid var(--bord); counter-increment: etape;
}
.etapes li::before {
  content: counter(etape); display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px;
  border-radius: 12px; background: var(--degrade); color: #fff; font-weight: 800;
}
.etapes strong { display: block; margin-bottom: 4px; font-size: 1.02rem; }
.etapes span { color: var(--encre-douce); font-size: .92rem; }

.colonnes { display: grid; gap: 22px; }
@media (min-width: 860px) { .colonnes { grid-template-columns: repeat(2, 1fr); } }
.encadre {
  padding: 22px; border-radius: var(--rayon); background: var(--carte); border: 1px solid var(--bord); box-shadow: var(--ombre);
}
.encadre h3 { margin: 0 0 10px; font-size: 1.12rem; }
.encadre p { margin: 0 0 12px; color: var(--encre-douce); font-size: .96rem; }
.encadre p:last-child { margin-bottom: 0; }
.liste-puces { list-style: none; margin: 0; padding: 0; }
.liste-puces li { position: relative; padding-left: 26px; margin-bottom: 9px; color: var(--encre-douce); font-size: .95rem; }
.liste-puces li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; }

.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; overflow: hidden; }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 15px 18px; cursor: pointer; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--rose); font-weight: 800; font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--bord); }
.faq .reponse { padding: 14px 18px 16px; color: var(--encre-douce); font-size: .96rem; }
.faq .reponse p { margin: 0 0 10px; }
.faq .reponse p:last-child { margin-bottom: 0; }

/* Agrandissement d'une couverture */
.visionneuse { border: 0; padding: 0; background: transparent; max-width: min(92vw, 520px); }
.visionneuse::backdrop { background: rgba(10, 12, 24, .72); backdrop-filter: blur(3px); }
.visionneuse img { display: block; width: 100%; max-height: 86vh; object-fit: contain; border-radius: 6px 12px 12px 6px; }
.visionneuse button {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .95); font-size: 1.2rem; font-weight: 700; box-shadow: var(--ombre);
}

/* --- Pied ---------------------------------------------------------------- */
.pied {
  margin-top: 40px; padding: 34px 0 30px; background: var(--carte);
  border-top: 3px solid transparent; border-image: var(--degrade) 1;
  font-size: .91rem; color: var(--encre-douce);
}
.pied-grille { display: grid; gap: 26px; }
@media (min-width: 760px) { .pied-grille { grid-template-columns: 1.4fr 1fr 1fr; } }
.pied h5 { margin: 0 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bleu); }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: 6px; }
.pied a { color: var(--encre-douce); }
.pied-bas {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
  font-size: .85rem; color: var(--encre-pale);
}
.pied-grille + .pied-bas { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--bord); }

/* ==========================================================================
   Pages de caisse (mathovore.fr/livres/)
   ========================================================================== */
.page-caisse { min-height: 50vh; }
.caisse { padding: 40px 0 20px; }
.carte-caisse {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); padding: clamp(22px, 4vw, 34px); position: relative; overflow: hidden;
}
.carte-caisse::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--degrade); }
.carte-caisse h1, .caisse-entete h1 { margin: 6px 0 12px; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -.03em; }
.carte-caisse p { color: var(--encre-douce); }
.etiquette {
  display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--bleu-clair); color: var(--bleu);
  font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.etiquette-ok { background: var(--vert-clair); color: var(--vert); }
.etiquette-alerte { background: var(--rouge-clair); color: var(--rouge); }
.caisse-entete { text-align: center; margin-bottom: 28px; }
.caisse-entete h1 {
  background: var(--degrade); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.chapeau-caisse { margin: 0 auto; max-width: 640px; color: var(--encre-douce); }

.bouton-principal, .bouton-secondaire, .bouton-lien {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px; border: 0; cursor: pointer; font: inherit; font-weight: 750; font-size: .95rem;
}
.bouton-principal { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -12px var(--accent); }
.bouton-principal:hover { color: #fff; text-decoration: none; filter: brightness(1.08); }
.bouton-secondaire { background: var(--fond); color: var(--encre); border: 1px solid var(--bord); margin-top: 8px; }
.bouton-secondaire:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.bouton-lien { background: none; color: var(--accent); padding: 8px 0; }
.bouton-lien:hover { text-decoration: underline; }

.bibliotheque { display: grid; gap: 18px; }
@media (min-width: 720px) { .bibliotheque { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .bibliotheque { grid-template-columns: repeat(3, 1fr); } }
.livre-achete {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start; padding: 18px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--accent) 11%, #fff) 0%, #fff 55%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--bord)); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.livre-achete img { width: 100%; border-radius: 3px 7px 7px 3px; box-shadow: inset 6px 0 8px -4px rgba(0, 0, 0, .3), 0 12px 22px -12px rgba(21, 25, 43, .6); }
.livre-achete h2 { margin: 6px 0 2px; font-size: 1.05rem; line-height: 1.3; }
.livre-achete p { margin: 0 0 12px; font-size: .88rem; color: var(--encre-douce); }
.livre-achete .bouton-principal { width: 100%; padding: 11px 14px; }
.livre-achete .petit { margin: 8px 0 0; }
.pastille-niveau { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .74rem; font-weight: 800; }
.petit { font-size: .82rem; color: var(--encre-pale); }

.cartouche-caisse { margin-top: 30px; padding: 22px; border-radius: var(--rayon); background: var(--carte); border: 1px solid var(--bord); }
.cartouche-caisse h2 { margin: 0 0 10px; font-size: 1.1rem; }
.cartouche-caisse ul { margin: 0 0 14px; padding-left: 20px; color: var(--encre-douce); font-size: .94rem; }
.cartouche-caisse li { margin-bottom: 6px; }

.message { padding: 12px 16px; border-radius: 12px; margin: 14px 0; font-weight: 600; font-size: .95rem; }
.message-ok { background: var(--vert-clair); color: #0b6e4d; }
.message-alerte { background: var(--rouge-clair); color: #a3122f; }
.formulaire-code { display: grid; gap: 10px; margin: 18px 0 8px; max-width: 380px; }
.formulaire-code label { font-weight: 700; font-size: .92rem; }
.formulaire-code input {
  font: inherit; font-size: 1.2rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--bord-fort); background: #fff;
}
.formulaire-code input[name="code"] { letter-spacing: .35em; font-weight: 800; text-align: center; }
.formulaire-code input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-clair); }
