/* ==========================================================================
   Livres Caroline — passe visuelle du 04/12/2026
   Chargée APRÈS style.css (includes/header.php) : elle corrige et complète sans
   toucher à la feuille principale. Pour revenir en arrière : retirer la ligne
   <link … refonte.css> de includes/header.php (ou vider ce fichier).
   ========================================================================== */

/* 1. Base ------------------------------------------------------------------ */
/* « hidden » transformait html et body en zones de défilement : la photo de la fiche,
   prévue pour rester à l'écran pendant qu'on fait défiler, partait avec la page.
   « clip » bloque toujours le débordement horizontal, sans cet effet. */
html, body { overflow-x: clip; }
/* Même cause : l'en-tête, prévu « collant », ne l'a jamais été. On garde le comportement que
   tout le monde connaît (collant, il prendrait un quart de l'écran d'un téléphone). */
.site-header { position: relative; }

/* 2. Fiche livre ----------------------------------------------------------- */
.fiche-infos .fiche-collection {
  display: inline-block; text-transform: none; letter-spacing: 0;
  font-size: .84rem; font-weight: 700; padding: 4px 12px; text-decoration: none;
}
.fiche-infos .fiche-collection:hover { background: var(--bleu-fonce); color: #fff; text-decoration: none; }
.fiche-infos h1 { font-size: clamp(2.05rem, 3.6vw, 3.15rem); line-height: 1.04; margin: 12px 0 0; }
.fiche-infos .meta { margin: 10px 0 16px; font-size: 1rem; }

/* États : un seul bloc, une ligne par état, l'état choisi marqué d'un trait rouge */
.etats-liste { border: 2px solid var(--encre); border-radius: 16px; overflow: hidden; background: #fff; }
.etats-liste .etat-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0; padding: 13px 18px 13px 16px; border: 0; border-radius: 0;
  border-top: 1.5px solid #EFE6D2; background: #fff; box-shadow: none; cursor: pointer;
}
.etats-liste .etat-option:first-child { border-top: 0; }
.etats-liste .etat-option:hover { background: var(--papier); }
.etats-liste .etat-option:has(input:checked) {
  border: 0; border-top: 1.5px solid #EFE6D2; background: #FFF2EF; box-shadow: inset 6px 0 0 var(--rouge);
}
.etats-liste .etat-option:first-child:has(input:checked) { border-top: 0; }
.etats-liste .etat-option:has(input:focus-visible) { outline: 3px solid var(--bleu); outline-offset: -3px; }
.etats-liste .etat-option.etat-rupture { opacity: .5; cursor: not-allowed; background: #fff; }
.etats-liste input[type=radio] { accent-color: var(--rouge); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.etat-gauche { display: flex; align-items: center; gap: 12px; min-width: 0; }
.etat-textes { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.etats-liste .etat-nom { font-size: 1.02rem; }
.etats-liste .etat-stock { font-size: .85rem; color: var(--gris); }
.etats-liste .etat-prix { font-size: 1.08rem; white-space: nowrap; }
.etat-def { margin: 10px 4px 0; font-size: .9rem; line-height: 1.55; color: #5E554A; }
.etat-def strong { color: var(--encre); }

/* Autres éditions du même titre */
.fiche-editions { margin: 20px 0 6px; }
.fiche-editions .fe-titre { font-family: var(--titre); font-size: 1.05rem; font-weight: 600; margin: 0 0 10px; }
.fe-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.fe-liste a {
  display: grid; grid-template-columns: 36px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 6px 16px 6px 6px; border: 2px solid var(--encre); border-radius: 12px; background: #fff;
  color: var(--encre); text-decoration: none; box-shadow: 0 3px 0 rgba(36,31,27,.12);
  transition: transform .12s ease, border-color .12s ease;
}
.fe-liste a:hover { border-color: var(--rouge); transform: translateY(-2px); text-decoration: none; }
.fe-liste img { grid-row: 1 / span 2; width: 36px; height: 48px; object-fit: cover; border-radius: 5px; background: var(--papier-fonce); }
.fe-coll { font-family: var(--titre); font-weight: 600; font-size: .93rem; line-height: 1.1; align-self: end; }
.fe-prix { font-size: .84rem; font-weight: 700; color: var(--rouge); align-self: start; }

/* Caractéristiques */
.fiche-carac { margin: 0 0 10px; border-top: 1.5px solid #EFE6D2; }
.fiche-carac > div { display: grid; grid-template-columns: 190px 1fr; gap: 14px; padding: 10px 2px; border-bottom: 1.5px solid #EFE6D2; }
.fiche-desc { max-width: 68ch; }
.fiche-carac dt { color: var(--gris); font-size: .93rem; }
.fiche-carac dd { margin: 0; font-weight: 600; }
.fiche-desc-titre + .fiche-carac { margin-top: 4px; }

/* 3. Cartes de livres (catalogue, accueil, recherche) ---------------------- */
.grille { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.livre-carte .livre-coll {
  text-transform: none; letter-spacing: 0; font-size: .74rem; font-weight: 700;
  background: #E2F1F5; color: var(--bleu-fonce); align-self: flex-start;
}
.livre-carte .livre-prix { white-space: nowrap; }

/* 4. Catalogue ------------------------------------------------------------- */
.cat-tri .cat-nb { font-weight: 700; color: var(--encre); margin-right: 14px; white-space: nowrap; }
.cat-chips { scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }

/* 5. Panier ---------------------------------------------------------------- */
/* Le titre avait la colonne la plus étroite : « Fanfan et les cigognes… » s'écrivait mot par mot.
   Sur ordinateur, l'état passe sous le titre et libère sa colonne. */
.pt-etat { display: none; }
@media (min-width: 761px) {
  .panier-table thead th:nth-child(2), .panier-table td[data-l="État"] { display: none; }
  .pt-etat { display: block; margin-top: 3px; font-size: .88rem; color: var(--gris); }
  .panier-table .pt-titre { width: 38%; }
  .panier-table .pt-img { width: 64px; min-width: 64px; }
}
/* Écran moyen : le prix unitaire (égal au total pour un exemplaire) cède sa place au titre. */
@media (min-width: 761px) and (max-width: 1100px) {
  .panier-table thead th:nth-child(3), .panier-table td[data-l="Prix"] { display: none; }
}
.panier-recap .ligne > span:last-child { white-space: nowrap; padding-left: 10px; text-align: right; }
.pc-etat strong { color: var(--rouge); font-weight: 700; }
.pc-btn { white-space: nowrap; }

/* 6. Téléphone ------------------------------------------------------------- */
@media (max-width: 640px) {
  .annonce { font-size: .82rem; line-height: 1.35; padding-top: 7px; padding-bottom: 7px; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cat-chips { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
  .fiche-infos h1 { font-size: 2rem; }
  .etats-liste .etat-option { padding: 12px 14px 12px 12px; }
  .fiche-carac > div { grid-template-columns: 1fr 1.3fr; }
  .fe-liste { display: grid; grid-template-columns: 1fr 1fr; }
  .fe-liste a { padding-right: 10px; }
}

/* 7. Bibliographie : un titre par ligne, ses éditions à la suite ------------ */
.biblio-liste { columns: 2; column-gap: 40px; list-style: none; padding: 0; margin: 0 0 10px; }
.biblio-liste li { break-inside: avoid; padding: 7px 0 8px; border-bottom: 1px solid #EFE6D2; line-height: 1.45; }
.biblio-titre { font-weight: 700; }
.biblio-eds { display: block; font-size: .86rem; color: var(--gris); margin-top: 1px; }
.biblio-eds a { color: var(--bleu-fonce); }
@media (max-width: 640px) { .biblio-liste { columns: 1; } }

/* 8. Tunnel ---------------------------------------------------------------- */
/* Le rappel de commande n'était encadré que sur l'étape « offres du moment » : même encadré partout. */
.tunnel-recap { background: #FBF7EF; border: 1.5px solid #ECE4D4; border-radius: 14px; padding: 18px; }

/* 9. Carrousel de l'accueil ----------------------------------------------- */
/* Photo horizontale (carte postale, livre photographié à plat) : au lieu de bandes beiges,
   la même image floutée remplit le cadre derrière la photo entière. */
.cflow-slide img:not(.cflow-fond) { position: relative; z-index: 1; background-color: transparent; }
.cflow-slide .cflow-fond {
  position: absolute; inset: 3px; width: auto; height: auto; aspect-ratio: auto; z-index: 0;
  object-fit: cover; border: 0; border-radius: 9px; box-shadow: none; background: var(--papier-fonce);
  filter: blur(12px) saturate(1.1); clip-path: inset(0 round 9px); pointer-events: none;
}
.recap-bascule { display: none; }
@media (max-width: 820px) {
  .tunnel-recap { padding: 12px 14px; }
  .tunnel-recap .recap-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 !important; font-size: 1.05rem; }
  .recap-bascule {
    display: inline-flex; align-items: baseline; gap: 8px; border: 0; background: none; padding: 4px 0; cursor: pointer;
    font: inherit; font-family: var(--corps); font-size: .92rem; font-weight: 400; color: var(--encre);
  }
  .recap-bascule .rb-nb { font-weight: 700; white-space: nowrap; }
  .recap-bascule .rb-lien { color: var(--bleu-fonce); text-decoration: underline; }
  .recap-bascule .rb-lien::after { content: " ▾"; text-decoration: none; display: inline-block; }
  .tunnel-recap.is-ouvert .recap-bascule .rb-lien::after { content: " ▴"; }
  .tunnel-recap .recap-corps { display: none; margin-top: 12px; }
  .tunnel-recap.is-ouvert .recap-corps { display: block; }
}
