/**
 * Habillage des pages WooCommerce (boutique, fiche produit, panier,
 * commande) : reprend la palette, la typographie et les composants déjà
 * définis dans main.css (boutons, cartes), pour une intégration sobre —
 * pas de surcouche visuelle superflue, juste la cohérence avec le reste
 * du site.
 */

/* Espace sous le header fixe, comme les autres pages internes */
.woocommerce-page main,
.woocommerce-account main {
  padding-top: 220px;
  padding-bottom: 100px;
}

/* Filet de sécurité : si une barre latérale s'affiche malgré tout (widgets
   par défaut de WordPress, jamais voulus dans ce thème), elle disparaît
   quel que soit son enrobage HTML exact — plutôt que de dépendre uniquement
   du retrait de son enregistrement côté PHP. On cible ici les widgets eux-
   mêmes, par leurs classes WordPress standards (identiques d'un site à
   l'autre), en plus des enveloppes habituelles — pour ne rien manquer même
   si l'élément qui les entoure n'est ni #secondary ni .widget-area. */
#secondary,
.widget-area,
body.woocommerce-page aside[role="complementary"],
body.woocommerce-account aside[role="complementary"],
.widget_pages,
.widget_archive,
.widget_categories,
.widget_search,
.widget_meta,
.widget_recent_entries,
.widget_recent_comments {
  display: none !important;
}

/* Titres de section (ex. "Boutique") alignés sur le reste du site */
.woocommerce-page h1.page-title,
.woocommerce-account h1.entry-title {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  color: var(--ink);
  margin-bottom: 48px;
}
.woocommerce-page .woocommerce-products-header__description,
.woocommerce-page .term-description {
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 28px;
}

/* Messages système (ajout au panier, erreurs, etc.) */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--rose-deep);
  border-radius: 4px;
  padding: 16px 20px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  list-style: none;
}
/* Sur la fiche produit précisément, ce message ("Article ajouté à votre
   panier") s'intercale mal entre le fil d'Ariane et la couverture — on le
   masque à cet endroit, sans toucher aux mêmes messages sur les autres
   pages (panier, validation de commande...), où ils restent utiles.
   Seuls les messages de SUCCÈS sont masqués ici : les erreurs et
   informations (par ex. « Vous avez déjà acheté ce livre numérique »)
   doivent rester visibles, sans quoi le client ne comprend pas pourquoi
   rien ne se passe. */
body.single-product .woocommerce-notices-wrapper .woocommerce-message {
  display: none;
}
body.single-product .woocommerce-notices-wrapper:not(:has(.woocommerce-error, .woocommerce-info)) {
  display: none;
}
.woocommerce-error { border-left-color: var(--wine); }

/* Grille de produits (page boutique), même logique que la grille du catalogue */
body.woocommerce-shop{
  background:
    radial-gradient(ellipse 50% 40% at 12% 8%, rgba(255,189,209,0.36), transparent 65%),
    radial-gradient(ellipse 46% 42% at 90% 65%, rgba(196,212,203,0.42), transparent 65%),
    var(--cream);
}

ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 28px 22px;
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
}
/* La largeur minimale de 190px par carte donne un rétrécissement naturel et
   fluide (5 → 4 → 3 → 2 colonnes selon la largeur d'écran) — mais, livrée
   à elle-même, finit par tomber à une seule colonne en dessous d'un
   certain seuil. On verrouille donc à deux colonnes minimum, sans jamais
   descendre plus bas. Ce seuil doit rester dans cette feuille (et non dans
   main.css, qui se charge avant elle) : une règle non conditionnelle comme
   celle ci-dessus l'emporterait toujours sur un seuil écrit ailleurs. */
@media (max-width:608px){
  ul.products{grid-template-columns:repeat(2, 1fr);}
}
.shop-section-divider{margin-top:100px;}
#shop-highlights-wrap{margin-top:36px;}
ul.products li.product a{position:relative;}
ul.products li.product {
  text-align: center;
}
ul.products li.product a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
ul.products li.product img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 14px 28px -16px rgba(85,13,37,0.35);
  transition: transform .3s ease, box-shadow .3s ease;
}
ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin: 12px 0 0;
}
/* Le prix ne s'affiche pas sur la grille : prix fixe du livre, visible
   uniquement sur la fiche produit (voir plus bas), pas de logique de
   promotion/prix barré — non pertinent pour un prix unique du livre. */
ul.products li.product .price { display: none; }

/* Précommande : bandeau bien visible sur la fiche produit (avant le
   titre), version réduite en overlay sur la couverture dans la grille
   boutique, et message de disponibilité personnalisé. */
.precommande-badge{
  display:inline-block; background:var(--precommande); color:#fff; font-weight:700;
  font-size:0.78rem; letter-spacing:0.08em; text-transform:uppercase;
  padding:7px 16px; border-radius:20px; margin-bottom:16px;
}
.stock.precommande-disponibilite{
  color:var(--wine); font-weight:600;
}
.precommande-badge-cart{
  display:inline-block; margin-top:6px; margin-bottom:0;
  font-size:0.62rem; padding:4px 10px;
}

/* Barre de filtre par genre au-dessus de la grille, même style que le catalogue */
#shop-genre-filters { margin-bottom: 8px; }
.filters-mots-cles { margin-bottom: 40px; }
.filter-pill-motcle { font-size: 0.76rem; padding: 7px 14px; }
.filter-pill-motcle.active { background: var(--rose-light); border-color: var(--rose-deep); color: var(--wine); }

/* Boutons (ajouter au panier, commander...) alignés sur .btn-primary */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-block;
  background: var(--rose-deep);
  color: #fff;
  border: none;
  border-radius: 2px;
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}

/* Fiche produit — ordre voulu : Titre → Autrice/auteur → Mots-clés → Prix → reste */
/* Mise en page en deux colonnes de la fiche produit (galerie à gauche,
   informations à droite) — WooCommerce la fournissait nativement dans sa
   propre feuille de style, désormais désactivée (voir functions.php) pour
   éviter les conflits avec les nôtres. Il faut donc la recréer nous-mêmes,
   avec les mêmes proportions que dans la maquette. */
.woocommerce div.product {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 60px;
  align-items: start;
  position: relative;
  min-height: 700px;
}
/* Assignation explicite de chaque bloc à sa position, plutôt que de laisser
   la grille les placer selon leur ordre d'apparition dans la page : le
   bouton "Lire un extrait" (product-extrait-btn) s'insère entre la galerie
   et le résumé, et sans cette précision deviendrait un 3e élément qui
   pousserait le résumé sur une ligne suivante au lieu de rester à côté de
   la couverture. */
.woocommerce div.product > .images { grid-column: 1; grid-row: 1; max-width: 100% !important; }
.woocommerce div.product > .summary { grid-column: 2; grid-row: 1; }
/* Le bouton "Lire un extrait" sort complètement de la grille : sa position
   ne dépend donc plus du tout de la hauteur du résumé à côté (qui, sinon,
   étire la 1re ligne et l'éloigne des miniatures). Sa position verticale
   est calculée à partir de nos propres dimensions fixes : couverture
   340px de large en 2:3 (= 510px de haut) + 14px d'écart + miniatures
   96px de haut + 14px d'écart avant le bouton = 634px. À ajuster si l'une
   de ces dimensions change un jour. */
.woocommerce div.product > .product-extrait-btn {
  position: absolute;
  top: 634px;
  left: 0;
  width: 340px;
}
/* Une seule photo (la couverture) : pas de rangée de vignettes, donc le
   bouton remonte juste sous la couverture : 510px de haut + 14px d'écart. */
.woocommerce div.product > .product-extrait-btn.product-extrait-btn--sans-vignettes {
  top: 524px;
}
/* Fiche Goodies : contenu naturellement plus court qu'un livre (pas
   d'auteur, de genre, de bouton "Lire un extrait"...) — la hauteur
   minimale ci-dessus, calibrée pour un livre, laisserait sinon un grand
   vide en bas de page. */
body.noctambule-goodies-produit .woocommerce div.product {
  min-height: 0;
}
@media (max-width: 760px) {
  .woocommerce div.product {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .woocommerce div.product > .images,
  .woocommerce div.product > .summary,
  .woocommerce div.product > .product-extrait-btn {
    grid-column: 1;
    grid-row: auto;
  }
  .woocommerce div.product > .product-extrait-btn {
    position: static;
    width: auto;
    margin-top: 14px;
  }
}

.woocommerce div.product .product_title {
  font-family: 'Lora', serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 2rem;
  margin-bottom: 6px;
}
.woocommerce div.product .product-author {
  font-family: 'Inter', sans-serif;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 16px;
}
.woocommerce div.product .product-author a {
  color: var(--rose-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.woocommerce div.product .product-release-date {
  font-family: 'Inter', sans-serif;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: -10px 0 16px;
}
.woocommerce div.product .product-genre {
  font-family: 'Inter', sans-serif;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin: -10px 0 16px;
}

.woocommerce div.product .product-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}
.woocommerce div.product .product-keywords span {
  font-size: 0.7rem;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  padding: 4px 12px;
  border-radius: 20px;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--rose-deep);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
}
.woocommerce div.product .woocommerce-product-details__short-description {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--ink);
  line-height: 1.65;
}

/* Bouton "Lire un extrait" sous la couverture (quand un extrait est renseigné) */
.product-extrait-btn {
  display: flex;
  justify-content: center;
  margin: 16px 0 0;
}

/* Galerie produit : image principale + vignettes (goodies en premier, couverture ensuite) */
.woocommerce-product-gallery__image img {
  border-radius: 6px;
  box-shadow: 0 14px 28px -16px rgba(85,13,37,0.35);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
}
/* Fiche produit Goodies : format carré (photo conseillée 1000×1000),
   sans recadrage — contrairement aux livres, dont l'image porte déjà
   naturellement le bon format une fois recadrée en 2:3. */
body.noctambule-goodies-produit .woocommerce-product-gallery__image img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--cream-2);
}
/* Section "Vous aimerez aussi" d'une fiche Goodies : les autres Goodies
   n'ont pas forcément de photo déjà carrée (contrairement aux couvertures
   de livres, uniformément 2:3) — même traitement que l'image principale
   ci-dessus, pour éviter qu'un format portrait ne fasse sauter la grille. */
body.noctambule-goodies-produit .product-recommendations ul.products li.product img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--cream-2);
}
.flex-control-thumbs {
  display: flex;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.flex-control-thumbs li {
  width: 64px;
  height: 96px;
  overflow: hidden;
}
.flex-control-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity .2s ease, border-color .2s ease;
}
.flex-control-thumbs img.flex-active {
  opacity: 1;
  border-color: var(--rose-deep);
}
/* Fiche produit Goodies : vignettes carrées elles aussi, sans recadrage —
   cohérent avec l'image principale (voir plus haut). */
body.noctambule-goodies-produit .flex-control-thumbs li {
  height: 64px;
}
body.noctambule-goodies-produit .flex-control-thumbs img {
  object-fit: contain;
  background: var(--cream-2);
}

/* Bouton "Ajouter au panier" de la fiche produit — mis en valeur, plus travaillé
   que le bouton générique des autres actions boutique (panier, commande...) */
.woocommerce div.product form.cart {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
}
.woocommerce div.product form.cart .quantity {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
}
.woocommerce div.product form.cart .single_add_to_cart_button {
  flex: 0 0 auto !important;
  width: auto !important;
  margin: 0 !important;
  background: var(--rose-deep);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 15px 34px 15px 46px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  position: relative;
  box-shadow: 0 16px 30px -14px rgba(85,13,37,0.55);
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.woocommerce div.product form.cart .single_add_to_cart_button::before {
  content: '';
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.woocommerce div.product form.cart .single_add_to_cart_button.loading {
  opacity: 0.6; cursor: wait; transform: none;
}
.woocommerce div.product form.cart .single_add_to_cart_button.added::before {
  display: none; /* l'icône panier laisse place à la coche dans le texte "Ajouté ✓" */
}
.woocommerce div.product form.cart .single_add_to_cart_button.added {
  background: var(--wine) !important;
  animation: noctambuleAddedPulse .4s ease;
}
/* Le survol soulève normalement le bouton de 2px (translateY) : on garde
   volontairement cette même hauteur pendant toute la confirmation
   "Ajouté ✓" (l'animation ci-dessous inclut donc ce même décalage), pour
   qu'il ne redescende pas puis ne remonte pas d'un coup à la fin — il
   ne revient à sa position normale qu'au retour à "Ajouter au panier". */
@keyframes noctambuleAddedPulse {
  0% { transform: translateY(-2px) scale(1); }
  35% { transform: translateY(-2px) scale(1.08); }
  100% { transform: translateY(-2px) scale(1); }
}

/* ---------- Format numérique (EPUB), en plus du format papier ---------- */
.format-label{
  font-family:'Inter',sans-serif; text-transform:uppercase; letter-spacing:0.08em;
  font-size:0.72rem; font-weight:700; color:var(--ink-soft); margin:0 0 8px;
  display:flex; align-items:center; gap:7px;
}
.format-label-icon{width:15px; height:15px; flex:0 0 auto;}
.format-block-digital{
  margin-top:28px; padding-top:24px; border-top:1px solid var(--hairline);
}
.digital-disponible-note{
  font-size:0.84rem; color:var(--precommande); font-weight:700; margin-top:6px; margin-bottom:14px;
}
.digital-add-to-cart-button{
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--wine); color:#fff; border:1.5px solid var(--wine);
  border-radius:30px; padding:15px 34px 15px 46px; font-family:'Inter',sans-serif;
  font-weight:600; font-size:0.94rem; letter-spacing:0.02em; cursor:pointer; position:relative;
  text-decoration:none; transition:background .25s ease, border-color .25s ease, transform .25s ease;
}
.digital-add-to-cart-button::before{
  content:''; position:absolute; left:20px; top:50%; transform:translateY(-50%);
  width:16px; height:16px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
  background-size:contain; background-repeat:no-repeat;
}
.digital-add-to-cart-button:hover{background:var(--rose-deep); border-color:var(--rose-deep); transform:translateY(-1px);}
/* Confirmation visuelle propre à ce bouton, distincte de celle du papier
   (voir .single_add_to_cart_button.added ci-dessus) : WooCommerce ajoute
   nativement la classe "added" une fois l'EPUB ajouté au panier, mais
   sans style associé jusqu'ici, ce bouton ne montrait donc jamais rien. */
.digital-add-to-cart-button.added {
  background: var(--sage);
  border-color: var(--sage);
}
/* Une seule coche de validation, pas deux : le texte du bouton contient
   déjà son propre "✓" (voir "Ajouté ✓" dans le script JS), donc l'icône
   CSS ci-dessous est masquée pendant cet état — exactement comme pour
   le bouton papier, dont l'icône panier disparaît aussi à la confirmation. */
.digital-add-to-cart-button.added::before {
  display: none;
}
/* État "déjà dans le panier" : bouton désactivé, visuellement distinct
   (gris plutôt que la couleur d'action), sans curseur de clic. */
.digital-add-to-cart-button--disabled {
  background: var(--sage-pale) !important;
  border-color: var(--sage-pale) !important;
  color: var(--ink-soft) !important;
  cursor: default !important;
  pointer-events: none;
}
/* Même logique ici : le texte "Déjà dans votre panier ✓" porte déjà
   son propre "✓", l'icône CSS reste donc masquée pour n'en garder qu'une. */
.digital-add-to-cart-button--disabled::before {
  display: none;
}
.digital-note{font-size:0.8rem; color:var(--ink-soft); margin-top:8px;}

.product-specs-table{
  margin-top:30px; padding-top:16px; border-top:1px solid var(--hairline);
  border-collapse:collapse; font-size:0.82rem; color:var(--ink-soft);
}
.product-specs-table th{
  text-align:left; font-weight:600; color:var(--ink); padding:3px 24px 3px 0; white-space:nowrap;
}
.product-specs-table td{ padding:3px 0; }

.product-recommendations{grid-column: 1 / -1; margin-top:60px; padding-top:36px; border-top:1px solid var(--hairline);}
.product-recommendations h3{font-family:'Lora',serif; font-size:1.3rem; margin-bottom:24px;}

.promo-code-box{margin-top:18px;}
.promo-code-toggle{
  background:none; border:none; padding:0; cursor:pointer; text-decoration:underline;
  font-family:inherit; font-size:0.85rem; color:var(--ink-soft);
}
.promo-code-toggle:hover{color:var(--wine);}
.promo-code-fields{display:flex; gap:8px; margin-top:10px; max-width:320px;}
.promo-code-fields[hidden]{display:none;}
.promo-code-fields input{
  flex:1 1 auto; padding:10px 12px; border:1px solid var(--hairline); border-radius:4px; font-family:inherit;
}
.promo-apply-btn{
  flex:0 0 auto; padding:10px 18px; border-radius:4px; border:1.5px solid var(--wine);
  background:var(--surface); color:var(--wine); font-family:inherit; font-weight:600; cursor:pointer;
  transition:background .2s ease, color .2s ease;
}
.promo-apply-btn:hover{background:var(--wine); color:#fff;}
.promo-apply-btn.loading{opacity:0.6; cursor:wait;}
.promo-feedback{font-size:0.8rem; color:var(--olive); font-weight:600; margin-top:10px;}
.promo-feedback.promo-feedback-error{color:var(--precommande);}
.format-tag-cart{
  display:inline-block; margin-top:6px; background:var(--surface); color:var(--wine);
  border:1px solid var(--wine); border-radius:20px; font-size:0.62rem; font-weight:700;
  letter-spacing:0.04em; text-transform:uppercase; padding:3px 9px;
}

/* ---------- Page panier ---------- */
/* Un reset global (main.css) transforme TOUS les <form> du site en
   colonne flex avec un espacement fixe, pensé pour les formulaires de
   contact — mais WooCommerce utilise aussi des <form> (panier, commande,
   compte...) dont la mise en page interne n'a rien à voir. On neutralise
   ce reset ici : la commande garde son propre agencement dédié plus bas
   (spécificité plus élevée), qui n'est donc pas concerné. */
.woocommerce form { display: block; gap: 0; margin: 0; padding: 0; }
/* WooCommerce insère toujours un conteneur pour les messages (erreurs,
   confirmations...) juste avant le formulaire du panier. Vide la plupart
   du temps, il participait quand même à la mise en page flex ci-dessus
   (voir plus haut), et l'espacement entre éléments (gap) s'appliquait
   donc même sans rien à afficher — décalant tout le reste vers la
   droite. On le masque uniquement quand il est vide ; il continue de
   s'afficher normalement dès qu'un vrai message apparaît. */
.woocommerce-notices-wrapper:empty { display: none; }
.woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-error, .woocommerce-info)) {
  display: none;
}
.woocommerce-notices-wrapper:has(.woocommerce-message, .woocommerce-error, .woocommerce-info) {
  margin-bottom: 24px;
}
.woocommerce-message, .woocommerce-error, .woocommerce-info {
  margin-bottom: 24px;
}
.woocommerce table.shop_table {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}
/* Largeurs de colonnes fixes, uniquement pour le tableau des articles du
   panier (pas celui du récapitulatif, à deux colonnes) : nécessaire pour
   que le titre du produit puisse se tronquer proprement sur une ligne. */
.woocommerce-cart-form table.shop_table { table-layout: fixed; }
.woocommerce-cart-form table.shop_table th.product-remove, .woocommerce-cart-form table.shop_table td.product-remove { width: 46px; }
.woocommerce-cart-form table.shop_table th.product-thumbnail, .woocommerce-cart-form table.shop_table td.product-thumbnail { width: 90px; }
.woocommerce-cart-form table.shop_table th.product-price, .woocommerce-cart-form table.shop_table td.product-price { width: 90px; }
.woocommerce-cart-form table.shop_table th.product-quantity, .woocommerce-cart-form table.shop_table td.product-quantity { width: 110px; }
.woocommerce-cart-form table.shop_table th.product-subtotal, .woocommerce-cart-form table.shop_table td.product-subtotal { width: 100px; }
.woocommerce table.shop_table th {
  background: var(--cream-2);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  text-align: left;
}
.woocommerce table.shop_table td {
  padding: 16px; border-top: 1px solid var(--hairline); vertical-align: middle;
}
.woocommerce table.shop_table td.product-thumbnail img {
  width: 72px; height: auto; aspect-ratio: 2 / 3; object-fit: contain;
  background: var(--cream-2);
  border-radius: 4px; box-shadow: 0 8px 18px -10px rgba(85,13,37,0.35);
}
.woocommerce table.shop_table td.product-name a {
  font-family: 'Lora', serif; font-weight: 700; color: var(--ink); text-decoration: none;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.woocommerce table.shop_table .product-price .amount,
.woocommerce table.shop_table .product-subtotal .amount {
  color: var(--rose-deep); font-weight: 600; white-space: nowrap;
}
.woocommerce table.shop_table td.product-remove a.remove {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--hairline);
  color: var(--ink-soft) !important; font-size: 1rem; text-decoration: none; line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

/* Sélecteur de quantité */
.woocommerce .quantity .qty {
  width: 60px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 4px;
  font-family: 'Inter', sans-serif; text-align: center; color: var(--ink);
}
.woocommerce .quantity .qty:focus { border-color: var(--rose-deep); outline: none; }
/* Pendant le recalcul AJAX de la ligne (changement de quantité) */
.woocommerce table.shop_table tbody tr.loading { opacity: 0.55; transition: opacity .15s ease; }

/* Coupon + boutons d'action de la table panier */
.woocommerce-cart-form .coupon .input-text {
  border: 1px solid var(--hairline); border-radius: 2px; padding: 12px 14px;
  font-family: 'Inter', sans-serif; margin-right: 8px;
}
.woocommerce-cart-form table.shop_table + .actions,
.woocommerce-cart-form .actions {
  padding: 18px 16px; background: var(--surface);
}
/* Bouton "Mettre à jour le panier" : les quantités se recalculent déjà
   automatiquement (voir cart-quantity.js), ce bouton n'a donc plus lieu
   d'être. On le masque ici en CSS plutôt que seulement en JS, pour qu'il
   ne puisse jamais réapparaître brièvement (ex. après le rechargement de
   page provoqué par l'application d'un code promo, avant que le script
   n'ait eu le temps de s'exécuter). */
.woocommerce-cart-form button[name="update_cart"],
.woocommerce-cart-form input[name="update_cart"] {
  display: none !important;
}

/* Récapitulatif (sous-total, TVA, total) — panier ET paiement partagent
   ces mêmes règles, pour rester cohérents partout sans devoir dupliquer
   chaque correctif à chaque fois. */
.cart_totals, .woocommerce-checkout-review-order {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 26px 28px;
}
.cart_totals h2 {
  font-family: 'Lora', serif; font-size: 1.3rem; margin-bottom: 18px; color: var(--ink);
}
.cart_totals table.shop_table,
.woocommerce-checkout-review-order table.shop_table {
  border: none; box-shadow: none;
}
.cart_totals table.shop_table tr,
.woocommerce-checkout-review-order table.shop_table tr {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--hairline); padding: 12px 0;
}
.cart_totals table.shop_table tr:first-child,
.woocommerce-checkout-review-order table.shop_table tr:first-child { border-top: none; }
.cart_totals table.shop_table th,
.cart_totals table.shop_table td,
.woocommerce-checkout-review-order table.shop_table th,
.woocommerce-checkout-review-order table.shop_table td {
  background: none; border: none; padding: 0;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
}
.cart_totals .order-total th,
.cart_totals .order-total td,
.woocommerce-checkout-review-order .order-total th,
.woocommerce-checkout-review-order .order-total td {
  font-weight: 700; font-size: 1.1rem; color: var(--ink);
}
.cart_totals .order-total .amount,
.woocommerce-checkout-review-order .order-total .amount { color: var(--rose-deep); }
.cart_totals .woocommerce-Price-currencySymbol,
.woocommerce-checkout-review-order .woocommerce-Price-currencySymbol { font-size: 0.9em; }
/* Livraison : juste le prix, sans puce de liste ni détail d'adresse —
   WooCommerce affiche par défaut la destination complète et un lien
   "Modifier l'adresse", trop lourd pour ce petit récapitulatif. */
.cart_totals ul#shipping_method,
.woocommerce-checkout-review-order ul#shipping_method { list-style: none; margin: 0; padding: 0; }
.cart_totals ul#shipping_method li,
.woocommerce-checkout-review-order ul#shipping_method li { margin: 0; }
/* Choix de livraison (plusieurs offres) : le titre « Expédition » passe
   au-dessus, puis chaque offre sur sa propre ligne — bouton radio + texte
   (et logo du transporteur, réduit) — au lieu d'être serrées à droite du
   titre. */
.cart_totals table.shop_table tr.woocommerce-shipping-totals,
.woocommerce-checkout-review-order table.shop_table tr.woocommerce-shipping-totals {
  flex-direction: column; align-items: stretch; gap: 10px;
}
.cart_totals table.shop_table tr.woocommerce-shipping-totals td,
.woocommerce-checkout-review-order table.shop_table tr.woocommerce-shipping-totals td {
  width: 100%; text-align: left;
}
.cart_totals ul#shipping_method li,
.woocommerce-checkout-review-order ul#shipping_method li {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px;
}
/* Phrase « Livraison offerte dès X € » : juste sous les offres, discrète */
.cart_totals table.shop_table tr.livraison-offerte-info,
.woocommerce-checkout-review-order table.shop_table tr.livraison-offerte-info {
  border-top: none; padding-top: 0; margin-top: -4px;
}
.cart_totals table.shop_table tr.livraison-offerte-info td,
.woocommerce-checkout-review-order table.shop_table tr.livraison-offerte-info td {
  width: 100%; font-size: 0.8rem; font-weight: 600; color: var(--rose-deep);
}
.cart_totals ul#shipping_method li:last-child,
.woocommerce-checkout-review-order ul#shipping_method li:last-child { margin-bottom: 0; }
.cart_totals ul#shipping_method li input.shipping_method,
.woocommerce-checkout-review-order ul#shipping_method li input.shipping_method { margin-top: 4px; flex: 0 0 auto; }
.cart_totals ul#shipping_method li label,
.woocommerce-checkout-review-order ul#shipping_method li label {
  flex: 1 1 auto; line-height: 1.4; cursor: pointer;
}
.cart_totals ul#shipping_method li label img,
.woocommerce-checkout-review-order ul#shipping_method li label img {
  height: 20px; width: auto; vertical-align: middle; margin: 0 6px 0 0;
}
.cart_totals .woocommerce-shipping-destination,
.cart_totals .shipping-calculator-button,
.cart_totals .shipping-calculator-form,
.woocommerce-checkout-review-order .woocommerce-shipping-destination,
.woocommerce-checkout-review-order .shipping-calculator-button,
.woocommerce-checkout-review-order .shipping-calculator-form {
  display: none;
}
/* "(dont X € TVA)" à côté du Total : filet de sécurité CSS en plus du
   filtre PHP, au cas où un gabarit (paiement, panier...) l'affiche par
   un autre chemin que celui déjà couvert côté serveur — la TVA a de
   toute façon déjà sa propre ligne juste au-dessus. */
.includes_tax { display: none; }

/* Bouton "Passer la commande" mis en avant, comme le reste du site */
.wc-proceed-to-checkout a.checkout-button,
.woocommerce a.button.checkout-button {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; margin-top: 18px;
  background: var(--rose-deep); color: #fff; border: none; border-radius: 30px;
  padding: 15px 24px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.02em; text-decoration: none; box-shadow: 0 16px 30px -14px rgba(85,13,37,0.5);
  transition: background .25s ease, transform .25s ease;
}

/* Panier vide — pas de notice encadrée, juste le message et le bouton
   centrés, sans les styles de boîte partagés avec les autres messages
   système (add au panier, erreurs...). */
.woocommerce-cart .cart-empty {
  font-family: 'Lora', serif; font-size: 1.2rem; color: var(--ink); margin-bottom: 18px;
  background: none; border: none; padding: 0; text-align: center;
}
.woocommerce-cart .return-to-shop { text-align: center; }
.woocommerce-cart .return-to-shop .button {
  display: inline-flex; background: var(--rose-deep); color: #fff; border-radius: 2px;
  padding: 13px 26px; text-decoration: none; font-family: 'Inter', sans-serif; font-weight: 500;
}

/* Mise en page en deux colonnes (articles + récapitulatif), et titre de page cohérent —
   nécessaire car la page Panier passe par le gabarit générique du thème (pas de
   template dédié), qui empilerait tout verticalement par défaut. */
body.woocommerce-cart article h1,
body.woocommerce-checkout article h1 {
  font-family: 'Lora', serif; font-weight: 700; color: var(--ink);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 30px;
}
/* Panier vide : même espace au-dessus du message ("Panier" → message)
   qu'en dessous (message → bouton "Retour à la boutique"), sans changer
   l'espace du titre pour le panier rempli ou la validation de commande. */
body.woocommerce-cart article:has(.cart-empty) h1 {
  margin-bottom: 18px;
}
/* Le raccourci [woocommerce_cart] enveloppe tout son contenu dans une
   div.woocommerce supplémentaire, non prévue par notre gabarit générique
   (qui ne fait que le_content() dans un simple <div>). Sans cette ligne,
   notre mise en page flex ci-dessous s'appliquait à la mauvaise div (celle
   du dessus, qui n'a qu'un seul enfant) et n'avait donc aucun effet — d'où
   l'empilement et l'absence d'espacement entre tableau et total panier. */
body.woocommerce-cart article > div,
body.woocommerce-cart article > div > div.woocommerce {
  display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap;
}
/* Les messages (« Votre commande a été annulée », « Article retiré »…) sont
   le premier enfant de cette mise en page flex : sans cette règle, ils se
   plaçaient en colonne à côté du tableau et le décalaient. On les étire sur
   toute la largeur, au-dessus du tableau et du total. */
body.woocommerce-cart .woocommerce-notices-wrapper { flex: 0 0 100%; width: 100%; margin-bottom: 0; }
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info { margin-bottom: 0; }
body.woocommerce-cart .woocommerce-cart-form { flex: 1 1 560px; min-width: 0; }
body.woocommerce-cart .cart-collaterals { flex: 0 0 320px; max-width: 320px; }
@media (max-width: 1085px) {
  body.woocommerce-cart .cart-collaterals { flex: 1 1 100%; max-width: 420px; }
}
/* En dessous de 705px, les colonnes fixes du tableau n'ont plus assez de
   place : chaque article devient une petite carte. Image + titre en
   haut (comme sur desktop), puis prix / quantité empilés avec leur
   étiquette (via data-title, déjà fourni par WooCommerce pour ce tableau
   "shop_table_responsive") — le sous-total par article est masqué ici,
   il ne sert qu'au total global, déjà présent dans le récapitulatif. */
@media (max-width: 705px) {
  body.woocommerce-cart .cart-collaterals { max-width: none; }
  .woocommerce-cart-form table.shop_table { table-layout: auto; }
  .woocommerce-cart-form table.shop_table thead { display: none; }
  .woocommerce-cart-form table.shop_table tr {
    display: flex; flex-wrap: wrap; align-items: center;
    padding: 16px; gap: 4px 10px; position: relative;
    border-top: 1px solid var(--hairline);
  }
  .woocommerce-cart-form table.shop_table tbody tr:first-child { border-top: none; }
  .woocommerce-cart-form table.shop_table td {
    border-top: none; padding: 0; width: auto;
  }
  .woocommerce-cart-form table.shop_table td.product-remove {
    order: 1; position: absolute; top: 14px; right: 14px;
  }
  .woocommerce-cart-form table.shop_table td.product-thumbnail { order: 2; }
  .woocommerce-cart-form table.shop_table td.product-name {
    order: 3; flex: 1 1 auto; min-width: 0; padding-right: 30px;
  }
  .woocommerce-cart-form table.shop_table td.product-name a {
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .woocommerce-cart-form table.shop_table td.product-price,
  .woocommerce-cart-form table.shop_table td.product-quantity {
    flex: 1 1 100%; display: flex; justify-content: space-between; align-items: center;
    padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--hairline);
  }
  .woocommerce-cart-form table.shop_table td.product-price { order: 4; }
  .woocommerce-cart-form table.shop_table td.product-quantity { order: 5; }
  .woocommerce-cart-form table.shop_table td.product-subtotal { display: none; }
  .woocommerce-cart-form table.shop_table td.product-price::before,
  .woocommerce-cart-form table.shop_table td.product-quantity::before {
    content: attr(data-title);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--ink-soft); font-weight: 600;
  }
}

/* ---------- Page de paiement ---------- */

/* Conteneur plus large que le reste du site pour cette page précise : le
   formulaire de facturation profite de cet espace en plus (voir grid
   plus bas), le récapitulatif gardant sa largeur fixe à droite. */
body.woocommerce-checkout main.wrap { max-width: 1400px; }

/* Formulaire à gauche (pleine hauteur), titre du récapitulatif + encart
   récapitulatif empilés à droite. Une grille CSS convient mieux ici
   qu'un flex : trois éléments distincts (.col2-set, #order_review_heading,
   #order_review) doivent former "une colonne + deux éléments empilés",
   une forme qu'un flex à la ligne gère mal (col2-set doit rétrécir pour
   laisser filer le titre à sa suite avant que l'encart ne bascule seul
   à la ligne suivante). */
.woocommerce-checkout .col2-set { display: block; }
.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: min-content 1fr;
  grid-template-areas: "billing heading" "billing review";
  gap: 0 40px;
  align-items: start;
}
.woocommerce-checkout .col2-set { grid-area: billing; min-width: 0; }
.woocommerce-checkout #order_review_heading { grid-area: heading; }
.woocommerce-checkout #order_review { grid-area: review; }
@media (max-width: 900px) {
  .woocommerce-checkout form.checkout {
    grid-template-columns: 1fr;
    grid-template-areas: "billing" "heading" "review";
  }
  .woocommerce-MyAccount-navigation, .woocommerce-MyAccount-content { flex: 1 1 100%; }
}

/* Titres de section du formulaire ("Détails de facturation", "Livraison"...) */
.woocommerce-checkout h3 {
  font-family: 'Lora', serif; font-weight: 700; color: var(--ink);
  font-size: 1.25rem; margin: 0 0 18px;
}
#order_review_heading {
  font-family: 'Lora', serif; font-weight: 700; color: var(--ink); font-size: 1.25rem;
  background: var(--surface); border: 1px solid var(--hairline); border-bottom: none;
  border-radius: 6px 6px 0 0; margin: 0; padding: 22px 28px 0;
}
.woocommerce-checkout .woocommerce-checkout-review-order {
  border-top: none; border-radius: 0 0 6px 6px; margin-top: 0;
}

/* Tableau du récapitulatif de commande (paiement) : structure différente
   de celle du panier (2 colonnes seulement, "product-total" plutôt que
   "product-subtotal"), qui n'avait donc encore aucun style dédié. */
.woocommerce-checkout-review-order-table { table-layout: fixed; }
.woocommerce-checkout-review-order-table th.product-total,
.woocommerce-checkout-review-order-table td.product-total { width: 130px; }
.woocommerce-checkout-review-order-table td.product-name > a,
.woocommerce-checkout-review-order-table td.product-name {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 28px !important;
}
.woocommerce-checkout-review-order-table td.product-name .format-tag-cart,
.woocommerce-checkout-review-order-table td.product-name .product-quantity {
  white-space: nowrap; display: inline-block; overflow: visible; text-overflow: clip;
}
.woocommerce-checkout-review-order-table td.product-name .product-quantity {
  font-weight: 400; color: var(--ink-soft);
}
.woocommerce-checkout-review-order-table td.product-total {
  text-align: right; white-space: nowrap; vertical-align: top;
}
/* En dessous de 360px, tout devient un peu trop juste : on réduit
   légèrement le texte et les pastilles (précommande, format numérique)
   pour que le tableau garde une lecture confortable. */
@media (max-width: 360px) {
  .woocommerce-checkout-review-order-table,
  .woocommerce-checkout-review-order-table .amount,
  .woocommerce-checkout-review-order-table .product-quantity {
    font-size: 0.82rem;
  }
  .woocommerce-checkout-review-order-table th { font-size: 0.68rem; }
  .woocommerce-checkout-review-order-table .format-tag-cart,
  .woocommerce-checkout-review-order-table .precommande-badge-cart {
    font-size: 0.56rem; padding: 2px 7px;
  }
}

/* Champs de saisie, alignés sur le style déjà utilisé pour les autres
   formulaires du site (manuscrits, espace libraire). */
.woocommerce-checkout .form-row label {
  display: block; font-size: 0.78rem; letter-spacing: 0.05em; color: var(--ink-soft);
  margin-bottom: 6px;
}
.woocommerce-checkout .form-row .required { color: var(--rose-deep); text-decoration: none; }
.woocommerce-checkout input.input-text,
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.woocommerce-checkout .select2-selection {
  width: 100%; background: var(--surface); border: 1px solid var(--hairline) !important;
  border-radius: 4px; padding: 12px 14px !important; height:auto !important;
  font-family: 'Inter', sans-serif; font-size: 0.92rem; color: var(--ink);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.woocommerce-checkout input.input-text:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus {
  border-color: var(--rose-deep) !important; outline: none;
  box-shadow: 0 0 0 3px rgba(181,53,92,0.12);
}
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout .woocommerce-shipping-fields {
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--hairline);
}
/* Champs prévus par paire (prénom/nom, ville/code postal...) : WooCommerce
   les marque déjà avec ces classes, encore fallait-il les styler pour
   qu'ils s'affichent réellement côte à côte plutôt que empilés. */
.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
  width: 48%; display: inline-block; vertical-align: top;
}
.woocommerce-checkout .form-row-first { margin-right: 4%; }

/* Moyens de paiement présentés comme de petites cartes cliquables plutôt
   que de simples ronds à cocher, plus lisibles au moment de choisir. */
ul.wc_payment_methods { list-style: none; margin: 0 0 20px; padding: 0; }
ul.wc_payment_methods li.wc_payment_method {
  border: 1px solid var(--hairline); border-radius: 6px; padding: 14px 16px;
  margin-bottom: 10px; background: var(--surface); transition: border-color .2s ease;
}
ul.wc_payment_methods li.wc_payment_method label {
  font-family: 'Inter', sans-serif; font-weight: 600; color: var(--ink); cursor: pointer;
}
ul.wc_payment_methods li.wc_payment_method:has(input:checked) {
  border-color: var(--rose-deep); box-shadow: 0 0 0 1px var(--rose-deep);
}
ul.wc_payment_methods .payment_box {
  background: var(--surface-2); border-radius: 4px; margin-top: 12px; padding: 14px 16px;
  font-size: 0.88rem; color: var(--ink-soft);
}

/* Case "J'accepte les conditions générales de vente" */
.woocommerce-terms-and-conditions-wrapper {
  margin: 20px 0; padding: 16px 18px; background: var(--surface-2); border-radius: 6px;
}
.woocommerce-form__label-for-checkbox {
  display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--ink-soft); cursor: pointer;
}
.woocommerce-form__input-checkbox { margin-top: 3px; accent-color: var(--rose-deep); width: 16px; height: 16px; flex-shrink: 0; }
.woocommerce-terms-and-conditions-wrapper a { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 2px; }

/* Case de renonciation au droit de rétractation (livre numérique) : même
   encadré, mêmes marges et même alignement que la case des CGV au-dessus,
   dont elle prolonge visuellement le bloc. */
.woocommerce-terms-and-conditions-wrapper:has(+ .noctambule-renonciation) { margin-bottom: 8px; }
.woocommerce-checkout #payment p.form-row.noctambule-renonciation {
  margin: 0 0 20px; padding: 16px 18px; background: var(--surface-2); border-radius: 6px;
  width: 100%; float: none; box-sizing: border-box;
}
.noctambule-renonciation .woocommerce-form__label-for-checkbox { margin: 0; }

/* Bouton final */
#place_order {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 6px;
  background: var(--wine); color: #fff; border: none; border-radius: 30px;
  padding: 16px 24px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.98rem;
  letter-spacing: 0.02em; box-shadow: 0 16px 30px -14px rgba(85,13,37,0.5);
  transition: background .25s ease, transform .25s ease; cursor: pointer;
}
#place_order:hover { background: var(--rose-deep); transform: translateY(-2px); }

/* Bouton grisé tant que les cases obligatoires ne sont pas cochées
   (voir assets/js/checkout-gate.js) */
#place_order:disabled,
#place_order.noctambule-bouton-inactif {
  opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none;
}
#place_order:disabled:hover,
#place_order.noctambule-bouton-inactif:hover { background: var(--wine); transform: none; }

/* Mention de réassurance, juste avant le bouton */
.checkout-reassurance {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.8rem; color: var(--ink-soft); margin: 4px 0 12px; text-align: center;
}
.checkout-reassurance .eyebrow-icon { width: 14px; height: 14px; }

/* Bandeau "Déjà un compte ? Se connecter", en haut de la page de paiement */
.checkout-login-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--rose-pale); border: 1px solid var(--rose-light); border-radius: 6px;
  padding: 14px 18px; margin-bottom: 30px; font-size: 0.92rem; color: var(--ink);
}
.checkout-login-banner .eyebrow-icon { width: 16px; height: 16px; color: var(--rose-deep); flex-shrink: 0; }
.checkout-login-trigger {
  color: var(--rose-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 2px;
}

/* Formulaires (panier, commande) */
.woocommerce #payment,
.woocommerce-checkout-review-order {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select {
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  padding: 10px 12px;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus {
  border-color: var(--rose-deep);
  outline: none;
}

/* Liens (mon compte, fil d'ariane...) */
.woocommerce-breadcrumb {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.woocommerce-breadcrumb a { color: var(--rose-deep); text-decoration: none; }
.woocommerce-breadcrumb a:hover {
  text-decoration: underline;
  text-decoration-color: var(--rose-light);
  text-underline-offset: 3px;
}

/* Carrousel de bannières (opérations, goodies, titres mis en avant) */
.shop-carousel{
  position: relative; width: 100%; aspect-ratio: 3 / 1; border-radius: 10px; overflow: hidden;
  margin-bottom: 32px; box-shadow: 0 20px 40px -20px rgba(85,13,37,0.35);
}
.shop-carousel{ touch-action: pan-y; } /* le défilement vertical de la page reste libre, le balayage horizontal est géré par le carrousel */
.shop-carousel-track{ position: relative; width: 100%; height: 100%; }
.shop-carousel-slide{
  position: absolute; inset: 0; background-size: cover; background-position: center;
  background-color: var(--rose-deep); opacity: 0; transition: opacity .6s ease; display: block;
}
/* Les bannières sont empilées au même endroit : seule la visible doit recevoir le clic,
   sinon c'est toujours la bannière du dessus de la pile qui répond, même invisible. */
.shop-carousel-slide{ pointer-events: none; }
.shop-carousel-slide.active{ opacity: 1; pointer-events: auto; z-index: 1; }
.shop-carousel-dots{
  position: absolute; bottom: 16px; right: 24px; z-index: 3; display: flex; gap: 8px;
}
.shop-carousel-dot{
  width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); border: none; cursor: pointer;
  padding: 0; transition: background .25s ease, transform .25s ease;
}
.shop-carousel-dot.active{ background: #fff; transform: scale(1.2); }
@media (max-width: 640px){
  .shop-carousel{ aspect-ratio: 16 / 9; }
}

/* ---------- Mon compte (connexion, inscription, tableau de bord) ---------- */

.woocommerce-account .eyebrow{margin-bottom:10px;}

/* Connexion / inscription, côte à côte comme le formulaire/récapitulatif
   du paiement. */
.woocommerce-account .u-columns{
  display:flex; gap:40px; align-items:flex-start; flex-wrap:wrap; list-style:none; padding:0; margin:0;
}
.woocommerce-account .u-column1, .woocommerce-account .u-column2{flex:1 1 320px; margin:0;}
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register{
  background:var(--surface); border:1px solid var(--hairline); border-radius:6px; padding:26px 28px;
}
.woocommerce-account form h2, .woocommerce-account form h3{
  font-family:'Lora', serif; font-weight:700; color:var(--ink); font-size:1.2rem; margin:0 0 18px;
}
.woocommerce-account .form-row label{
  display:block; font-size:0.78rem; letter-spacing:0.05em; color:var(--ink-soft); margin-bottom:6px;
}
.woocommerce-account .form-row .required{color:var(--rose-deep); text-decoration:none;}
.woocommerce-account input.input-text,
.woocommerce-account input[type="password"],
.woocommerce-account input[type="email"],
.woocommerce-account input[type="text"]{
  width:100%; background:var(--surface); border:1px solid var(--hairline) !important; border-radius:4px;
  padding:12px 14px !important; height:auto !important; font-family:'Inter', sans-serif; font-size:0.92rem; color:var(--ink);
}
.woocommerce-account input.input-text:focus,
.woocommerce-account input:focus{
  border-color:var(--rose-deep) !important; outline:none; box-shadow:0 0 0 3px rgba(181,53,92,0.12);
}
/* Indicateur de force du mot de passe (WordPress) : invisible tant qu'il
   n'a rien à afficher, plutôt que de laisser paraître une petite pastille
   vide sous le champ dès que la page se charge. */
.woocommerce-password-strength:empty {
  display: none;
}
.woocommerce-password-strength {
  margin-top: 8px; padding: 6px 12px; border-radius: 4px;
  font-size: 0.8rem; font-weight: 600; background: var(--surface-2); color: var(--ink-soft);
}
.woocommerce-password-strength.strong { color: var(--olive); }
.woocommerce-password-strength.short, .woocommerce-password-strength.bad { color: var(--wine); }
.woocommerce-password-strength.good { color: var(--rose-deep); }
/* Bouton natif d'affichage/masquage du mot de passe : par défaut vide
   (WordPress compte sur une image de fond définie dans son CSS
   d'administration, non chargée sur le site public), il apparaissait
   comme un petit bouton nu et sans icône. On lui dessine une icône "œil"
   directement en CSS et on le superpose proprement dans le champ. */
:has(> .show-password-input) { position: relative; }
:has(> .show-password-input) input.input-text,
:has(> .show-password-input) input[type="password"],
:has(> .show-password-input) input[type="text"] {
  padding-right: 44px !important;
}
.show-password-input {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; border: none; background-color: transparent;
  cursor: pointer; opacity: 0.6; transition: opacity .2s ease;
  background-repeat: no-repeat; background-position: center; background-size: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a4a5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.show-password-input:hover { opacity: 1; }
.show-password-input[aria-pressed="true"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5355c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a18.6 18.6 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}
.woocommerce-account .woocommerce-form-login__rememberme{
  display:flex; align-items:center; gap:8px; font-size:0.85rem; color:var(--ink-soft); margin:14px 0;
}
.woocommerce-account .woocommerce-LostPassword{font-size:0.85rem; margin-top:10px;}
.woocommerce-account .woocommerce-LostPassword a{color:var(--rose-deep);}

/* Tableau de bord, une fois connecté : navigation à gauche, contenu à droite.
   :has() cible le vrai parent commun de la navigation et du contenu, quel
   que soit son nom exact — WooCommerce ne les enveloppe pas systématiquement
   dans une balise dédiée qu'on pourrait cibler directement. */
body.woocommerce-account :has(> .woocommerce-MyAccount-navigation){
  display:flex; gap:40px; align-items:flex-start; flex-wrap:wrap;
}
.woocommerce-MyAccount-navigation{flex:0 0 220px;}
.woocommerce-MyAccount-content{flex:1 1 560px; min-width:0;}
.woocommerce-MyAccount-navigation ul{list-style:none; margin:0; padding:0;}
.woocommerce-MyAccount-navigation ul li{margin-bottom:4px;}
.woocommerce-MyAccount-navigation ul li a{
  display:block; padding:11px 16px; border-radius:6px; text-decoration:none;
  font-family:'Inter', sans-serif; font-size:0.9rem; color:var(--ink-soft); transition:background .2s ease, color .2s ease;
}
.woocommerce-MyAccount-navigation ul li.is-active a{
  background:var(--rose-pale); color:var(--wine); font-weight:600;
}
.woocommerce-MyAccount-content > p:first-child{color:var(--ink-soft); margin-bottom:24px;}
.woocommerce-MyAccount-content mark{background:none; color:var(--rose-deep); font-weight:600;}
/* Tout ce qui se glisse comme enfant direct du même conteneur flexible que
   la navigation et le contenu (message WooCommerce sur le mot de passe
   temporaire, ou toute autre chose imprévue) prend sa propre ligne pleine
   largeur, plutôt que de se coincer à côté d'eux. On cible "tout sauf
   navigation et contenu" plutôt qu'un nom de classe précis, pour rester
   robuste même si l'élément en cause n'est pas celui qu'on imagine. */
body.woocommerce-account :has(> .woocommerce-MyAccount-navigation) > *:not(.woocommerce-MyAccount-navigation):not(.woocommerce-MyAccount-content){
  flex:1 1 100%;
}

/* Historique des commandes */
.woocommerce-orders-table{border:1px solid var(--hairline); border-radius:6px; border-collapse:collapse; width:100%;}
.woocommerce-orders-table th{
  background:var(--surface-2); font-family:'Inter', sans-serif; font-size:0.78rem; letter-spacing:0.05em;
  text-transform:uppercase; color:var(--ink-soft); text-align:left; padding:12px 16px; font-weight:600;
}
.woocommerce-orders-table td{padding:14px 16px; border-top:1px solid var(--hairline); font-size:0.9rem;}
.woocommerce-orders-table__cell-order-status{text-transform:capitalize;}
.woocommerce-orders-table a.button, .woocommerce-MyAccount-downloads-file{
  display:inline-flex; align-items:center; background:var(--surface); border:1px solid var(--hairline);
  border-radius:20px; padding:6px 14px; font-size:0.82rem; color:var(--ink); text-decoration:none;
}
/* En dessous de 700px, ces tableaux (commandes ET téléchargements,
   toutes deux "shop_table_responsive" côté WooCommerce) passent en
   petites cartes empilées, avec l'étiquette de chaque colonne à gauche
   (via data-title, déjà fourni nativement par WooCommerce) — même
   principe que pour le panier. */
@media (max-width: 700px) {
  .woocommerce-orders-table thead { display: none; }
  .woocommerce-orders-table, .woocommerce-orders-table tbody, .woocommerce-orders-table tr {
    display: block; width: 100%;
  }
  .woocommerce-orders-table tr {
    margin-bottom: 16px; border: 1px solid var(--hairline); border-radius: 6px; padding: 6px 16px;
  }
  .woocommerce-orders-table tr:last-child { margin-bottom: 0; }
  .woocommerce-orders-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-top: 1px dashed var(--hairline); padding: 10px 0; text-align: right;
  }
  .woocommerce-orders-table td:first-child { border-top: none; }
  .woocommerce-orders-table td::before {
    content: attr(data-title); font-weight: 600; color: var(--ink-soft); text-align: left;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  }
}

/* Page d'une commande (Mon compte → Commandes → Voir) et onglet
   Téléchargements : mêmes principes que ci-dessus. Sous 700px, les tableaux
   « Téléchargements » et « Détails de la commande » ne gardent plus leurs
   colonnes (qui débordaient de l'écran) : chaque ligne devient une petite
   carte, avec le total d'une ligne à droite de son titre. */
@media (max-width: 700px) {
  .woocommerce-MyAccount-content table.shop_table { max-width: 100%; table-layout: auto; }
  .woocommerce table.woocommerce-table--order-details td.product-name a { white-space: normal; overflow: visible; text-overflow: clip; }

  /* Téléchargements */
  .woocommerce table.woocommerce-table--order-downloads thead { display: none; }
  .woocommerce table.woocommerce-table--order-downloads,
  .woocommerce table.woocommerce-table--order-downloads tbody,
  .woocommerce table.woocommerce-table--order-downloads tr { display: block; width: 100%; }
  .woocommerce table.woocommerce-table--order-downloads tr {
    margin-bottom: 12px; border: 1px solid var(--hairline); border-radius: 6px; padding: 6px 16px;
  }
  .woocommerce table.woocommerce-table--order-downloads tr:last-child { margin-bottom: 0; }
  .woocommerce table.woocommerce-table--order-downloads td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-top: 1px dashed var(--hairline); padding: 10px 0; text-align: right;
  }
  .woocommerce table.woocommerce-table--order-downloads td:first-child { border-top: none; }
  .woocommerce table.woocommerce-table--order-downloads td::before {
    content: attr(data-title); font-weight: 600; color: var(--ink-soft); text-align: left;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; flex: 0 0 auto;
  }

  /* Détails de la commande */
  .woocommerce table.woocommerce-table--order-details thead { display: none; }
  .woocommerce table.woocommerce-table--order-details,
  .woocommerce table.woocommerce-table--order-details tbody,
  .woocommerce table.woocommerce-table--order-details tfoot,
  .woocommerce table.woocommerce-table--order-details tr { display: block; width: 100%; }
  .woocommerce table.woocommerce-table--order-details tbody tr.order_item,
  .woocommerce table.woocommerce-table--order-details tfoot tr {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    border-top: 1px solid var(--hairline); padding: 12px 16px;
  }
  .woocommerce table.woocommerce-table--order-details tbody tr.order_item:first-child { border-top: none; }
  .woocommerce table.woocommerce-table--order-details td,
  .woocommerce table.woocommerce-table--order-details th { border: none; padding: 0; background: none; }
  .woocommerce table.woocommerce-table--order-details td.product-name { flex: 1 1 auto; min-width: 0; text-align: left; }
  .woocommerce table.woocommerce-table--order-details td.product-total { flex: 0 0 auto; text-align: right; white-space: nowrap; }
  .woocommerce table.woocommerce-table--order-details td.product-total::before { content: none; }
  .woocommerce table.woocommerce-table--order-details tfoot tr { background: var(--cream-2); align-items: baseline; }
  .woocommerce table.woocommerce-table--order-details tfoot th { flex: 0 0 auto; text-align: left; font-size: 0.72rem; }
  .woocommerce table.woocommerce-table--order-details tfoot td { flex: 1 1 auto; min-width: 0; text-align: right; }
}

/* Adresses */
.woocommerce-Addresses{display:flex; gap:24px; flex-wrap:wrap;}
.woocommerce-Address{
  flex:1 1 260px; background:var(--surface); border:1px solid var(--hairline); border-radius:6px; padding:22px 24px;
}
.woocommerce-Address-title{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px;}
.woocommerce-Address-title h2{
  font-family:'Lora', serif; font-weight:700; color:var(--ink); font-size:1.05rem; margin:0;
}
.woocommerce-Address-title a{
  font-size:0.82rem; color:var(--rose-deep); text-decoration:none; border:1px solid var(--rose-deep);
  border-radius:20px; padding:4px 12px;
}
.woocommerce-Address address{font-style:normal; color:var(--ink-soft); line-height:1.7; font-size:0.92rem;}

/* Boutons ("Se connecter", "S'inscrire", "Enregistrer les modifications"...) */
.woocommerce-account button.button, .woocommerce-account input.button{
  background:var(--wine); color:#fff; border:none; border-radius:30px; padding:13px 26px;
  font-family:'Inter', sans-serif; font-weight:600; font-size:0.92rem; cursor:pointer;
  transition:background .25s ease, transform .25s ease;
}

/* Tous les effets de survol du site : regroupés ici et n'activés que
   sur les appareils ayant un vrai pointeur (souris/trackpad). Sur
   tactile, ces règles ne s'appliquent jamais — ce qui évite tout
   risque de "double-tap" sur les liens concernés (obligation de
   toucher une première fois pour déclencher le survol, une seconde
   pour suivre le lien), un bug classique sur certains navigateurs
   mobiles quand un effet de survol est posé sur un lien. */
@media (hover:hover) and (pointer:fine){
  ul.products li.product:hover img{transform: translateY(-5px);
  box-shadow: 0 22px 36px -14px rgba(85,13,37,0.4);}
  .woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover{background: var(--wine);
  color: #fff;
  transform: translateY(-2px);}
  .woocommerce div.product .product-author a:hover{color: var(--wine);}
  .flex-control-thumbs img:hover{opacity: 1;}
  .woocommerce div.product form.cart .single_add_to_cart_button:hover{background: var(--wine);
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -14px rgba(85,13,37,0.6);}
  .woocommerce table.shop_table td.product-name a:hover{color: var(--rose-deep);}
  .woocommerce table.shop_table td.product-remove a.remove:hover{background: var(--wine); border-color: var(--wine); color: #fff !important;}
  .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce a.button.checkout-button:hover{background: var(--wine); color: #fff; transform: translateY(-2px);}
}

/* Résumé replié sur mobile (voir assets/js/resume-replie.js) : environ dix
   lignes restent visibles, le reste se déplie avec "Lire la suite". */
@media (max-width: 760px) {
  .woocommerce div.product .woocommerce-product-details__short-description.est-replie:not(.est-deplie) {
    max-height: 19em;
    overflow: hidden;
    position: relative;
  }
  .woocommerce div.product .woocommerce-product-details__short-description.est-replie:not(.est-deplie)::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4.5em;
    background: linear-gradient(to bottom, rgba(255, 251, 252, 0), var(--cream));
    pointer-events: none;
  }
  .noctambule-resume-bouton {
    display: block;
    background: none;
    border: none;
    padding: 6px 0 10px;
    margin: 0 0 6px;
    color: var(--rose-deep);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  .noctambule-resume-bouton:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 3px; }
}

/* Pagination de la boutique et du catalogue (« ← 1 2 → ») : sans ces règles,
   WooCommerce l'affiche comme une liste à puces ordinaire. */
.woocommerce-pagination { margin: 36px 0 12px; }
.woocommerce-pagination ul.page-numbers {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; list-style: none; margin: 0; padding: 0;
}
.woocommerce-pagination ul.page-numbers li { margin: 0; padding: 0; list-style: none; }
.woocommerce-pagination .page-numbers a.page-numbers,
.woocommerce-pagination .page-numbers span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid var(--rose-light); border-radius: 999px;
  background: var(--surface); color: var(--wine);
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.woocommerce-pagination .page-numbers a.page-numbers:hover { background: var(--rose-pale); border-color: var(--rose); }
.woocommerce-pagination .page-numbers span.page-numbers.current {
  background: var(--wine); border-color: var(--wine); color: #fff;
}
.woocommerce-pagination .page-numbers span.page-numbers.dots { border: none; background: none; min-width: 0; }

/* Promotion sur l'édition numérique : prix normal barré, prix remisé, mention. */
.digital-promo-note{
  display:inline-block; margin:0 0 10px; padding:4px 12px; border-radius:999px;
  background:var(--precommande, #e0218a); color:#fff; font-size:0.82rem; font-weight:700; letter-spacing:0.02em;
}
.digital-add-to-cart-button del{opacity:0.65; text-decoration:line-through; margin-right:6px; font-weight:400;}
.digital-add-to-cart-button ins{text-decoration:none; background:none; font-weight:700;}

/* Livre numérique déjà acheté : petit message sous le bouton grisé. */
.digital-deja-achete-note a { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 2px; }
