@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --papier: #f4efe6;
  --carte: #fbf8f2;
  --encre: #2b2320;
  --brun: #4a3a32;
  --or: #8a6a2e;
  --trait: #e2d8c8;
  --doux: #6b5d53;
  --alerte: #9b2c1f;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: "Spectral", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--brun); text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

.page {
  max-width: 60rem;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 1.5rem) max(1.1rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 7rem) max(1.1rem, env(safe-area-inset-left, 0px));
}

/* En-tête */
.entete { text-align: center; margin-bottom: 2.2rem; }
.entete .logo { display: inline-block; border-radius: 50%; }
.entete .logo img { width: 84px; height: 84px; }
.entete h1 {
  font-family: "Cinzel", Georgia, serif; font-weight: 500;
  font-size: clamp(1.9rem, 7vw, 2.6rem); letter-spacing: 0.12em;
  margin: 0.7rem 0 0.3rem; color: var(--brun);
}
.entete .promesse { margin: 0; font-style: italic; color: var(--doux); }
.entete .envoi { margin: 0.9rem auto 0; max-width: 32rem; font-size: 0.95rem; color: var(--doux); }
.main-propre { margin: 0.6rem auto 0; max-width: 32rem; font-size: 0.95rem; color: var(--doux); }
.main-propre.petite { margin: 0 0 0.9rem; font-size: 0.9rem; }
.bandeau-test {
  margin: 0 auto 1.6rem; max-width: 40rem; padding: 0.6rem 0.9rem;
  border: 1px dashed var(--or); border-radius: 3px; text-align: center;
  font-size: 0.95rem; color: var(--or); background: var(--carte);
}

/* Produits */
.produits { display: grid; grid-template-columns: 1fr; gap: 1.1rem; align-items: start; }
@media (min-width: 46rem) { .produits { grid-template-columns: 1fr 1fr; } }
.produit {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: 3px;
  padding: 1rem;
}
@media (min-width: 30rem) { .produit { grid-template-columns: 9rem 1fr; } }
.produit.vise { border-color: var(--or); box-shadow: 0 0 0 2px var(--or); }
.produit { scroll-margin-top: 1rem; }
.visuel-bloc { min-width: 0; }
.miniatures { display: flex; gap: 0.4rem; margin-top: 0.45rem; }
.miniature { width: 2.9rem; height: 2.9rem; padding: 0; border: 1px solid var(--trait); border-radius: 2px; background: #fff; cursor: pointer; overflow: hidden; }
.miniature img { width: 100%; height: 100%; object-fit: cover; }
.miniature[aria-pressed="true"] { border: 2px solid var(--brun); }
.ajouter.bientot, .ajouter.bientot:disabled { background: #d9d2c5; color: #5e534a; cursor: default; }
.produit.a-venir .visuel { filter: grayscale(0.35); }
.produit .visuel { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; background: var(--trait); }
.produit .visuel.objet { object-fit: contain; background: #fff; }
.produit .visuel-vide {
  aspect-ratio: 2 / 3; display: grid; place-items: center; text-align: center; padding: 0.5rem;
  border: 1px dashed var(--trait); border-radius: 2px; font-size: 0.85rem; font-style: italic; color: var(--doux);
}
.produit .serie { margin: 0; font-size: 0.9rem; font-style: italic; color: var(--doux); }
.produit h3 { margin: 0.1rem 0 0.3rem; font-size: 1.25rem; line-height: 1.2; font-weight: 600; color: var(--encre); }
.produit .infos { min-width: 0; }
.stock-bas { margin: -0.4rem 0 0.6rem; font-size: 0.9rem; font-style: italic; color: var(--alerte); }
.stock-bas:empty { display: none; }
.produit .accroche { margin: 0 0 0.5rem; font-style: italic; color: var(--brun); font-size: 0.97rem; }
.produit .prix { margin: 0.2rem 0 0.6rem; font-size: 1.2rem; font-weight: 600; color: var(--brun); }
.variantes { border: 0; margin: 0 0 0.7rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.variantes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.variantes label {
  display: inline-flex; align-items: center; min-height: 2.4rem; padding: 0.3rem 0.75rem;
  border: 1px solid var(--trait); border-radius: 1.3rem; cursor: pointer; font-size: 0.92rem; line-height: 1.3; background: #fff;
}
.variantes input { position: absolute; opacity: 0; pointer-events: none; }
.variantes input:checked + span { font-weight: 600; }
.variantes label:has(input:checked) { border-color: var(--brun); background: var(--brun); color: #fbf8f2; }
.variantes label:has(input:focus-visible) { outline: 2px solid var(--or); outline-offset: 2px; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; }
.ajouter {
  flex: 1 1 11rem; white-space: nowrap; min-height: 2.9rem; padding: 0.55rem 1.1rem;
  background: var(--brun); color: #fbf8f2; border: 0; border-radius: 3px; cursor: pointer; font-weight: 600;
}
.ajouter:hover { background: var(--encre); }
.ajouter.fait { background: var(--or); }
.ajouter:disabled { background: var(--trait); color: var(--doux); cursor: default; }
.ebook {
  flex: 1 0 5.5rem; display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.55rem 1rem; border: 1px solid var(--brun); border-radius: 3px;
  color: var(--brun); text-decoration: none; font-weight: 600; background: transparent;
}
.ebook:hover { background: var(--carte); border-color: var(--encre); color: var(--encre); }
.produit details { grid-column: 1 / -1; margin-top: 0.2rem; border-top: 1px solid var(--trait); padding-top: 0.5rem; }
.produit summary { cursor: pointer; color: var(--brun); font-size: 0.95rem; }
.produit details p { margin: 0.6rem 0 0; font-size: 0.97rem; }
.produit details p.avertissement {
  margin-top: 1rem; padding: 0.6rem 0.8rem; font-size: 0.9rem; color: var(--alerte);
  border-left: 3px solid var(--alerte); background: color-mix(in srgb, var(--alerte) 6%, transparent);
}
.produit details p.citation { margin-top: 1rem; font-style: italic; color: var(--brun); }
.produit .accroche { text-wrap: balance; }
.prix-avenir { font-weight: 400 !important; font-style: italic; color: var(--doux) !important; }
.variantes.inactives label { cursor: default; opacity: 0.55; background: transparent; }

/* Fiche des planches (stickers, magnets) */
.produit.large { grid-column: 1 / -1; }
@media (min-width: 46rem) { .produit.livre-seul { grid-template-columns: 13rem 1fr; gap: 1.6rem; } }
.produit.livre-seul .actions { max-width: 30rem; }
.produit-objet { grid-template-columns: 1fr; }
@media (min-width: 46rem) { .produit-objet { grid-template-columns: 1.3fr 1fr; gap: 1.6rem; } }
.galerie { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; align-self: start; }
.planche-vue { margin: 0; text-align: center; transition: opacity .2s ease; }
.planche-vue img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: transparent; }
.planche-vue figcaption { margin-top: 0.3rem; font-size: 0.9rem; font-style: italic; color: var(--doux); }
.planche-vue.estompee { opacity: 0.35; }
@media (prefers-reduced-motion: reduce) { .planche-vue { transition: none; } }
.variantes.options { margin-bottom: 0.8rem; }
.variantes.options legend { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--doux); font-style: italic; }
.note-objet { margin: 0.7rem 0 0; font-size: 0.9rem; color: var(--doux); }

/* Bouton et liseuse de l'extrait */
.feuilleter {
  flex: 1 0 7rem; display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.55rem 1rem; border: 1px solid var(--or); border-radius: 3px;
  color: var(--or); text-decoration: none; font-weight: 600; background: transparent;
}
.feuilleter:hover { background: var(--carte); }
dialog.liseuse {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: #e8e2d6; color: var(--encre); overflow-y: auto; overscroll-behavior: contain;
}
dialog.liseuse::backdrop { background: rgba(43, 35, 32, 0.6); }
.liseuse-haut {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 0.5rem) max(1rem, env(safe-area-inset-right, 0px)) 0.5rem max(1rem, env(safe-area-inset-left, 0px));
  background: var(--papier); border-bottom: 1px solid var(--trait);
}
.liseuse-haut h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--brun); }
.fermer-lecture {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.9rem; padding: 0.45rem 1.1rem;
  background: var(--brun); color: #fbf8f2; border: 0; border-radius: 3px; cursor: pointer; font-weight: 600; font-size: 1rem;
}
.fermer-lecture span { font-size: 1.4rem; line-height: 1; }
.fermer-lecture:hover { background: var(--encre); }
@media (min-width: 46rem) {
  .liseuse-haut { padding-top: calc(env(safe-area-inset-top, 0px) + 0.8rem); padding-bottom: 0.8rem; }
  .liseuse-haut h2 { font-size: 1.25rem; }
  .fermer-lecture { min-height: 3.2rem; padding: 0.5rem 1.4rem; font-size: 1.1rem; }
}
@media (max-width: 26rem) { .fermer-lecture { padding: 0.45rem 0.8rem; } }
.liseuse-pages { max-width: 46rem; margin: 0 auto; padding: 1rem 0.6rem 0; display: flex; flex-direction: column; gap: 0.9rem; }
.extrait-absent { margin: 3rem 1rem; text-align: center; font-style: italic; color: var(--doux); }
.page-extrait { width: 100%; height: auto; background: #fff; box-shadow: 0 2px 8px rgba(43, 35, 32, 0.25); }
.liseuse-fin { max-width: 46rem; margin: 0 auto; padding: 1.6rem 1rem calc(env(safe-area-inset-bottom, 0px) + 2rem); text-align: center; }
.liseuse-suite { font-family: "Cinzel", Georgia, serif; font-size: 1.3rem; letter-spacing: 0.06em; color: var(--brun); margin: 0 0 1rem; }
.liseuse-boutons { display: flex; flex-direction: column; gap: 0.6rem; max-width: 24rem; margin: 0 auto; }
.liseuse-boutons a {
  display: flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.6rem 1rem;
  border-radius: 3px; text-decoration: none; font-weight: 600;
}
.liseuse-commander { background: var(--brun); color: #fbf8f2; }
.liseuse-newsletter { background: transparent; color: var(--brun); border: 1px solid var(--brun); }
.liseuse-ebook { color: var(--brun); text-decoration: underline !important; font-weight: 400 !important; }
.liseuse-ku { margin: 1rem auto 0; max-width: 24rem; font-size: 0.92rem; font-style: italic; color: var(--doux); }

/* Lien de retour au site */
.haut { margin: 0 0 0.6rem; }
.haut a { display: inline-flex; align-items: center; min-height: 2.6rem; color: var(--brun); font-size: 0.95rem; text-decoration: none; }
.haut a:hover { text-decoration: underline; }

/* Accueil : les piles de livres */
.piles { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 1.2rem; }
.pile { display: block; flex: 0 0 calc(50% - 0.6rem); text-decoration: none; color: inherit; text-align: center; border-radius: 3px; padding: 0.6rem 0.4rem 0.8rem; }
@media (min-width: 46rem) { .pile { flex-basis: calc(33.333% - 0.8rem); } }
.pile:hover .pile-voir { text-decoration: underline; }
.pile-visuels { position: relative; width: 66%; margin: 0 auto 1rem; aspect-ratio: 2 / 3; }
.pile-visuels.multiple { transform: translateX(-8%); }
.pile-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 2px;
  background: var(--trait); box-shadow: 0 2px 6px rgba(43, 35, 32, 0.25);
  transition: transform .25s ease;
}
.pile-img.objet { object-fit: contain; background: #fff; }
.pile-visuels.objets .pile-img.rang-0 { transform: rotate(-3deg); }
.pile-visuels.objets .pile-img.rang-1 { transform: translate(18%, 3%) rotate(6deg); filter: none; }
.pile:hover .pile-visuels.objets .pile-img.rang-1 { transform: translate(24%, 3%) rotate(8deg); }
.pile-img.rang-1 { transform: translate(16%, -4%) rotate(5deg); filter: brightness(0.82); }
.pile-img.rang-2 { transform: translate(30%, -7%) rotate(9deg); filter: brightness(0.68); }
.pile:hover .pile-img.rang-1 { transform: translate(22%, -5%) rotate(7deg); }
.pile:hover .pile-img.rang-2 { transform: translate(40%, -9%) rotate(12deg); }
@media (prefers-reduced-motion: reduce) { .pile-img { transition: none; } }
.vide-img { display: grid; place-items: center; padding: 0.4rem; font-size: 0.85rem; font-style: italic; color: var(--doux); }
.pile-nom { font-family: "Cinzel", Georgia, serif; font-weight: 500; font-size: 1.05rem; letter-spacing: 0.06em; margin: 0 0 0.2rem; color: var(--brun); line-height: 1.3; }
.pile-detail { margin: 0; font-size: 0.9rem; font-style: italic; color: var(--doux); }
.pile-voir { display: inline-block; margin-top: 0.4rem; font-size: 0.95rem; color: var(--brun); font-weight: 600; }

/* Vue d'une série */
.retour-series {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0.5rem 1.1rem; margin-bottom: 1rem;
  border: 1px solid var(--brun); border-radius: 3px; background: var(--carte);
  color: var(--brun); font-weight: 600; text-decoration: none;
}
.retour-series:hover { background: var(--brun); color: #fbf8f2; }
.retour-series.bas { margin: 1.6rem 0 0; }
.serie-titre { font-family: "Cinzel", Georgia, serif; font-weight: 500; letter-spacing: 0.08em; color: var(--brun); font-size: clamp(1.6rem, 6vw, 2.1rem); margin: 0.2rem 0 0.1rem; }
.serie-titre:focus { outline: none; }
.serie-accroche { margin: 0 0 1.2rem; font-style: italic; color: var(--doux); }
.serie-accroche:empty { display: none; }

/* Suggestion dans le panier */
.suggestion {
  display: flex; gap: 0.9rem; align-items: center; margin-top: 1rem; padding: 0.9rem;
  border: 1px dashed var(--or); border-radius: 3px; background: var(--carte);
}
.suggestion-img { width: 4.5rem; height: 4.5rem; object-fit: contain; flex-shrink: 0; background: transparent; }
.suggestion-texte { min-width: 0; }
.suggestion-titre { margin: 0; font-weight: 600; }
.suggestion-nom { margin: 0.1rem 0 0.5rem; font-size: 0.95rem; color: var(--doux); }
.suggestion-boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.suggestion-ajouter { min-height: 2.4rem; padding: 0.35rem 1rem; border: 0; border-radius: 3px; background: var(--brun); color: #fbf8f2; font-weight: 600; cursor: pointer; }
.suggestion-autre { min-height: 2.4rem; border: 0; background: transparent; color: var(--brun); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; font-size: 0.92rem; }

/* Pied de page */
.pied { margin-top: 3rem; text-align: center; font-size: 0.92rem; color: var(--doux); }
.pied p { margin: 0.35rem 0; }

/* Barre du panier */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 0.7rem max(1rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 0.7rem) max(1rem, env(safe-area-inset-left, 0px));
  background: var(--carte); border-top: 1px solid var(--trait);
}
.barre button {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; max-width: 40rem; margin: 0 auto; min-height: 3.1rem; padding: 0.55rem 1.1rem;
  background: var(--brun); color: #fbf8f2; border: 0; border-radius: 3px; cursor: pointer; font-weight: 600;
}

/* Panier */
dialog.panier {
  width: min(40rem, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh;
  margin: 0 0 0 auto; padding: 0; border: 0; background: var(--papier); color: var(--encre);
}
dialog.panier::backdrop { background: rgba(43, 35, 32, 0.45); }
@media (min-width: 46rem) { dialog.panier { border-left: 1px solid var(--trait); } }
.panier-contenu {
  display: flex; flex-direction: column; min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) max(1.1rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 1.2rem) 1.1rem;
}
.panier-haut { display: flex; justify-content: space-between; align-items: center; }
.panier-haut h2 { font-family: "Cinzel", Georgia, serif; font-weight: 500; letter-spacing: 0.1em; margin: 0; color: var(--brun); font-size: 1.5rem; }
.fermer { width: 2.8rem; height: 2.8rem; border: 0; background: transparent; cursor: pointer; font-size: 1.6rem; line-height: 1; border-radius: 50%; }
.fermer:hover { background: var(--trait); }
.lignes { list-style: none; margin: 1rem 0 0; padding: 0; }
.ligne { padding: 0.9rem 0; border-bottom: 1px solid var(--trait); }
.ligne-haut { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.ligne-nom { font-weight: 600; }
.ligne-variante { font-size: 0.92rem; color: var(--doux); }
.ligne-total { white-space: nowrap; font-weight: 600; color: var(--brun); }
.ligne-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; }
.quantite { display: inline-flex; align-items: center; border: 1px solid var(--trait); border-radius: 3px; background: #fff; }
.quantite button { width: 2.4rem; height: 2.4rem; border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; }
.quantite button:disabled { opacity: 0.35; cursor: default; }
.quantite span { min-width: 1.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.retirer { border: 0; background: transparent; color: var(--doux); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; font-size: 0.92rem; min-height: 2.4rem; }
.dedicace { margin-top: 0.6rem; }
.dedicace label { display: block; font-size: 0.92rem; color: var(--doux); margin-bottom: 0.2rem; }
.dedicace input {
  width: 100%; min-height: 2.6rem; padding: 0.45rem 0.7rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--trait); border-radius: 3px; background: #fff; color: var(--encre);
}
.note-dedicace { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--doux); }
.autre-dedicace { margin-top: 0.4rem; border: 0; background: transparent; padding: 0; color: var(--brun); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; font-size: 0.92rem; min-height: 2.2rem; }
.vide { margin: 2rem 0; text-align: center; font-style: italic; color: var(--doux); }
.recap { margin-top: auto; padding-top: 1.2rem; }
.recap dl { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; margin: 0 0 0.9rem; }
.recap dt { color: var(--doux); }
.recap dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.recap .total { font-weight: 600; color: var(--encre); font-size: 1.15rem; }
.cgv { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; margin-bottom: 0.9rem; }
.cgv input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--brun); flex-shrink: 0; }
.payer {
  width: 100%; min-height: 3.2rem; border: 0; border-radius: 3px; cursor: pointer;
  background: var(--brun); color: #fbf8f2; font-weight: 600; font-size: 1.05rem;
}
.payer:disabled { opacity: 0.5; cursor: default; }
.message { margin: 0.7rem 0 0; color: var(--alerte); font-size: 0.95rem; }
.message:empty { display: none; }
.securite { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--doux); text-align: center; }

/* Remerciement */
.merci { max-width: 34rem; margin: 0 auto; text-align: center; }
.merci h1 { font-family: "Cinzel", Georgia, serif; font-weight: 500; letter-spacing: 0.1em; color: var(--brun); font-size: clamp(1.8rem, 7vw, 2.4rem); margin: 0.8rem 0; }
.merci .bonus { margin: 1.6rem 0; padding: 1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 3px; }
.merci .bouton {
  display: inline-block; margin-top: 0.4rem; padding: 0.7rem 1.2rem; min-height: 3rem;
  background: var(--brun); color: #fbf8f2; border-radius: 3px; text-decoration: none; font-weight: 600;
}
