/* ==========================================================================
   M PÂTISSERIE — NOEL.CSS (thème éphémère, 100 % réversible)
   À charger APRÈS style.css. Aucune règle de style.css n'est modifiée :
   - le thème festif (couleurs, guirlande, neige) ne s'applique que sous html.noel,
     classe posée par avent.js uniquement pendant la période de Noël ;
   - les composants propres à Noël (hero, calendrier, bûches) ont leurs classes dédiées.
   Retrait : voir retirer-noel.py
   ========================================================================== */
:root {
  --noel-red: #6f1d1b;
  --noel-red-2: #8a2a27;
  --noel-gold: #c9a961;
  --noel-gold-dk: #8a6d2f;
  --noel-pine: #17352b;
}

/* ==========================================================================
   1. THÈME FESTIF (sous html.noel)
   ========================================================================== */
html.noel .bandeau-nouveaute { background: var(--noel-red); }
html.noel .bandeau-nouveaute a { color: #f6ecd2; }
html.noel .bandeau-nouveaute a:hover { border-color: var(--noel-gold); }

/* Guirlande lumineuse sous le bandeau */
html.noel .bandeau-nouveaute::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 8px;
  z-index: 1;
  background:
    radial-gradient(circle at 7px 3px, var(--noel-gold) 0 2.5px, transparent 3px) 0 0 / 28px 8px repeat-x,
    radial-gradient(circle at 21px 3px, #f6ecd2 0 2.5px, transparent 3px) 0 0 / 28px 8px repeat-x;
  animation: noelTwinkle 3.2s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes noelTwinkle { from { opacity: .45; } to { opacity: 1; } }

html.noel .hp-eyebrow,
html.noel .page-header__eyebrow { color: var(--noel-gold-dk); }
html.noel .page-header .page-header__eyebrow,
html.noel .pro-section .hp-eyebrow,
html.noel .evenement .hp-eyebrow { color: var(--noel-gold); }
html.noel .page-header::after { background: var(--noel-gold); }

html.noel .btn-luxe--dark,
html.noel .button,
html.noel input[type="submit"] { background: var(--noel-red); border-color: var(--noel-red); }
html.noel .btn-luxe--dark:hover,
html.noel .button:hover,
html.noel input[type="submit"]:hover { background: transparent; color: var(--noel-red) !important; }
html.noel .add-to-cart-btn { color: var(--noel-red); border-color: var(--noel-red); }
html.noel .add-to-cart-btn:hover { background: var(--noel-red); color: #fff; }

html.noel .floating-cart-btn { background: var(--noel-red); }
html.noel .floating-cart-btn:hover { background: var(--noel-red-2); }
html.noel .floating-cart-count { background: var(--noel-gold-dk); }
html.noel .carte-card__num,
html.noel .collection-num,
html.noel .story-year { color: var(--noel-gold-dk); }
html.noel #footer-chic { border-top: 3px solid var(--noel-gold); }
html.noel ::selection { background: var(--noel-red); }

/* ---------- Neige : 2 couches de flocons animées par transform (GPU, sans repaint) ---------- */
html.noel body::before,
html.noel body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 9500;
  background-repeat: repeat;
  will-change: transform;
}
html.noel body::before {
  top: -900px;
  height: calc(100% + 900px);
  background-size: 300px 300px;
  background-image:
    radial-gradient(4px 4px at 20px 30px, #fff 0 45%, rgba(166, 148, 141, .55) 60%, transparent 72%),
    radial-gradient(3px 3px at 120px 80px, #fff 0 45%, rgba(166, 148, 141, .55) 60%, transparent 72%),
    radial-gradient(5px 5px at 205px 150px, #fff 0 45%, rgba(166, 148, 141, .55) 60%, transparent 72%),
    radial-gradient(3px 3px at 70px 225px, #fff 0 45%, rgba(166, 148, 141, .55) 60%, transparent 72%),
    radial-gradient(4px 4px at 255px 270px, #fff 0 45%, rgba(166, 148, 141, .55) 60%, transparent 72%);
  animation: noelFallA 24s linear infinite;
}
html.noel body::after {
  top: -1200px;
  height: calc(100% + 1200px);
  background-size: 400px 400px;
  opacity: .75;
  background-image:
    radial-gradient(3px 3px at 60px 50px, #fff 0 45%, rgba(166, 148, 141, .5) 60%, transparent 72%),
    radial-gradient(2px 2px at 240px 120px, #fff 0 45%, rgba(166, 148, 141, .5) 60%, transparent 72%),
    radial-gradient(4px 4px at 330px 230px, #fff 0 45%, rgba(166, 148, 141, .5) 60%, transparent 72%),
    radial-gradient(2px 2px at 140px 330px, #fff 0 45%, rgba(166, 148, 141, .5) 60%, transparent 72%);
  animation: noelFallB 38s linear infinite;
}
@keyframes noelFallA { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(60px, 900px, 0); } }
@keyframes noelFallB { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-80px, 1200px, 0); } }

html.noel.noel-snow-off body::before,
html.noel.noel-snow-off body::after { display: none; }

/* Bouton d'activation / désactivation de la neige */
.noel-toggle {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9001;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--noel-red);
  background: rgba(255, 253, 250, .92);
  border: 1px solid rgba(38, 11, 1, .18);
  border-radius: 50%;
  cursor: pointer;
  transition: background .4s var(--ease), color .4s var(--ease);
}
.noel-toggle:hover, .noel-toggle[aria-pressed="false"] { background: var(--noel-red); color: #fff; }
.noel-toggle[aria-pressed="false"] { opacity: .75; }

/* ==========================================================================
   2. HERO NOËL (accueil)
   ========================================================================== */
.noel-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 82vh;
  overflow: hidden;
  color: #f6ecd2;
  background: radial-gradient(120% 90% at 85% 10%, #8a2a27 0%, var(--noel-red) 38%, #2a0d0a 100%);
}
.noel-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23, 53, 43, .0) 0%, rgba(23, 53, 43, .0) 60%, rgba(23, 53, 43, .35) 100%);
  pointer-events: none;
}
.noel-hero__text {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 640px;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.8rem, 6vw, 6rem);
}
.noel-hero__eyebrow {
  margin: 0 0 1.4rem;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--noel-gold);
}
.noel-hero h2 {
  margin: 0 0 .5em;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 400;
  line-height: 1;
  color: #fff;
}
.noel-hero h2 em { font-style: italic; color: var(--noel-gold); }
.noel-hero__lead { margin: 0 0 1.8rem; font-weight: 300; line-height: 1.85; color: rgba(246, 236, 210, .92); }
.noel-hero__names { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 2.2rem; }
.noel-hero__names a {
  padding: .7em 1.2em;
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #f6ecd2;
  border: 1px solid rgba(201, 169, 97, .55);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.noel-hero__names a:hover { background: var(--noel-gold); color: var(--choco); }
.noel-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.noel-hero .btn-luxe--sand { background: var(--noel-gold); color: var(--choco) !important; }
.noel-hero .btn-luxe--sand:hover { background: #f6ecd2; }
.noel-hero__deadline { margin: 1.6rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--noel-gold); }
.noel-hero__media { position: relative; z-index: 1; min-height: 360px; }
.noel-hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.noel-hero--no-media { grid-template-columns: 1fr; min-height: 0; }
.noel-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--noel-red) 0%, transparent 35%); }

/* ==========================================================================
   3. CALENDRIER DE L'AVENT
   ========================================================================== */
.avent { background: var(--noel-pine); color: #f6ecd2; padding: var(--pad-y) 2rem; }
.avent-wrap { max-width: 1100px; margin: 0 auto; }
.avent .section-intro h2 { color: #fff; }
.avent .section-intro p { color: rgba(246, 236, 210, .88); }
.avent .hp-eyebrow { color: var(--noel-gold); }
.avent-status { margin: 0 0 2.2rem; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--noel-gold); }
.avent-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.avent-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  font-family: var(--serif);
  color: var(--noel-gold);
  background: linear-gradient(145deg, #1f4638, #12291f);
  border: 1px solid rgba(201, 169, 97, .5);
  border-radius: 0;
  cursor: pointer;
  transition: transform .5s var(--ease), background .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease);
}
.avent-day__num { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 500; line-height: 1; }
.avent-day__icon { font-size: .8rem; opacity: .8; }
.avent-day:not(:disabled):hover { transform: translateY(-4px); color: var(--choco); background: var(--noel-gold); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .7); }
.avent-day.is-today { box-shadow: 0 0 0 2px var(--noel-gold), 0 0 24px rgba(201, 169, 97, .55); animation: noelPulse 2.4s ease-in-out infinite; }
.avent-day.is-opened { background: transparent; border-style: dashed; }
.avent-day.is-opened .avent-day__icon::before { content: "\f00c"; }
.avent-day:disabled { cursor: not-allowed; color: rgba(246, 236, 210, .35); background: rgba(0, 0, 0, .25); border-color: rgba(201, 169, 97, .18); }
@keyframes noelPulse { 50% { box-shadow: 0 0 0 2px var(--noel-gold), 0 0 6px rgba(201, 169, 97, .2); } }

/* Fenêtre modale (élément <dialog> natif : focus piégé, Échap, fond inerte) */
.avent-modal {
  width: min(520px, calc(100% - 2rem));
  max-width: none;
  padding: 0;
  color: var(--choco);
  background: var(--sand);
  border: 1px solid var(--noel-gold);
  border-radius: 0;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
}
.avent-modal::backdrop { background: rgba(23, 53, 43, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.avent-modal[open] { animation: noelModal .5s var(--ease); }
@keyframes noelModal { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.avent-modal__inner { position: relative; padding: 3rem 2.4rem 2.6rem; text-align: center; }
.avent-modal__inner::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(138, 109, 47, .35); pointer-events: none; }
.avent-modal__day { margin: 0 0 .8rem; font-size: .72rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--noel-gold-dk); }
.avent-modal h3 { margin: 0 0 .6em; font-size: clamp(1.9rem, 4vw, 2.5rem); color: var(--noel-red); }
.avent-modal__text { margin: 0 0 1.8rem; font-weight: 300; line-height: 1.85; color: #4a352c; }
.avent-modal__text strong { font-weight: 500; color: var(--choco); }
.avent-modal__close { position: absolute; top: 1.2rem; right: 1.2rem; width: 36px; height: 36px; font-size: 1.4rem; line-height: 1; color: var(--choco); background: transparent; border: 1px solid rgba(38, 11, 1, .2); cursor: pointer; transition: background .3s, color .3s; }
.avent-modal__close:hover { background: var(--choco); color: var(--sand); }

/* ==========================================================================
   4. PAGE BÛCHES
   ========================================================================== */
.buches-info { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1180px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.buches-info div { padding: 1.6rem 1.4rem; text-align: center; font-size: .9rem; font-weight: 300; border-right: 1px solid var(--line); }
.buches-info div:last-child { border-right: 0; }
.buches-info strong { display: block; margin-bottom: .2rem; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--noel-red); }

.buches-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.6rem, 3.5vw, 3rem); max-width: 1180px; margin: 0 auto; padding: 0 2rem; }
.buche-card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); transition: box-shadow .7s var(--ease), border-color .7s var(--ease); }
.buche-card:hover { border-color: var(--noel-gold); box-shadow: 0 34px 60px -36px rgba(38, 11, 1, .5); }

/* Image extérieure par défaut ; la coupe se révèle au survol (ou via le bouton « Voir la coupe » au tactile) */
.buche-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sand-2); }
.buche-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .8s var(--ease), transform 1.6s var(--ease); }
.buche-img--in { opacity: 0; transform: scale(1.04); }
.buche-cap { position: absolute; left: 1rem; bottom: 1rem; z-index: 2; padding: .55em 1em; font-size: .62rem; font-weight: 500; letter-spacing: .2em; line-height: 1; text-transform: uppercase; color: var(--sand); background: rgba(38, 11, 1, .78); transition: opacity .5s var(--ease); }
.buche-cap--in { opacity: 0; }
.buche-media .badge-seasonal { position: absolute; top: 1rem; left: 1rem; z-index: 2; }

/* La coupe n'existe que si sa photo existe : avent.js ajoute alors .buche-card--cut et le bouton */
@media (hover: hover) {
  .buche-card--cut .buche-media:hover .buche-img--out { opacity: 0; transform: scale(1.04); }
  .buche-card--cut .buche-media:hover .buche-img--in { opacity: 1; transform: scale(1); }
  .buche-card--cut .buche-media:hover .buche-cap--out { opacity: 0; }
  .buche-card--cut .buche-media:hover .buche-cap--in { opacity: 1; }
}
.coupe-toggle:checked ~ .buche-media .buche-img--out { opacity: 0; }
.coupe-toggle:checked ~ .buche-media .buche-img--in { opacity: 1; transform: scale(1); }
.coupe-toggle:checked ~ .buche-media .buche-cap--out { opacity: 0; }
.coupe-toggle:checked ~ .buche-media .buche-cap--in { opacity: 1; }

/* Visuel en attente : seule la description de la bûche est présentée */
.buche-pending {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: 2rem;
  text-align: center;
  color: #f6ecd2;
  background: radial-gradient(120% 100% at 80% 0%, var(--noel-red-2) 0%, var(--noel-red) 55%, #2a0d0a 100%);
}
.buche-pending::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(201, 169, 97, .45); pointer-events: none; }
.buche-pending .icon { font-size: 1.6rem; color: var(--noel-gold); }
.buche-pending strong { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.2rem); font-style: italic; font-weight: 400; }
.buche-pending small { max-width: 26ch; font-size: .8rem; font-weight: 300; line-height: 1.6; color: rgba(246, 236, 210, .8); }
.buche-card.is-pending .buche-pending { display: flex; }
.buche-card.is-pending .buche-media { aspect-ratio: 16 / 10; }
.buche-card.is-pending .buche-img,
.buche-card.is-pending .buche-cap,
.buche-card.is-pending .coupe-btn { display: none; }
.buche-hint { margin: -1rem auto 2.4rem; max-width: 640px; padding: 0 2rem; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--noel-gold-dk); }

.coupe-btn { position: absolute; top: 1rem; right: 1rem; z-index: 3; display: inline-flex; gap: .5rem; align-items: center; margin: 0; padding: .75em 1.1em; font-size: .62rem; font-weight: 500; letter-spacing: .18em; line-height: 1; text-transform: uppercase; color: var(--choco); background: rgba(255, 253, 250, .92); border: 1px solid rgba(38, 11, 1, .15); cursor: pointer; transition: background .4s var(--ease), color .4s var(--ease); }
.coupe-btn:hover { background: var(--noel-red); color: #fff; }
.coupe-btn .lbl-in { display: none; }
.coupe-toggle:checked ~ .coupe-btn .lbl-in { display: inline; }
.coupe-toggle:checked ~ .coupe-btn .lbl-out { display: none; }
.coupe-toggle:focus-visible ~ .coupe-btn { outline: 2px solid var(--noel-gold); outline-offset: 3px; }

.buche-body { display: flex; flex-direction: column; flex: 1; padding: 2rem 2rem 2.2rem; }
.buche-body h3 { margin: 0 0 .5rem; font-size: clamp(2rem, 3.4vw, 2.6rem); }
.buche-desc { margin-bottom: 1.2rem; font-weight: 300; line-height: 1.8; color: #4a352c; }
.buche-layers { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.6rem; }
.buche-layers li { padding: .6em 1em; font-size: .66rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--noel-red); border: 1px solid rgba(111, 29, 27, .35); }
.buche-body .price-variants { margin-top: auto; }

/* ==========================================================================
   5. RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .noel-hero { grid-template-columns: 1fr; min-height: 0; }
  .noel-hero__media { min-height: 320px; order: -1; }
  .noel-hero__media::after { background: linear-gradient(0deg, var(--noel-red) 0%, transparent 45%); }
  .avent-grid { grid-template-columns: repeat(4, 1fr); }
  .buches-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .avent { padding-left: 1.2rem; padding-right: 1.2rem; }
  .avent-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .buches-grid { padding: 0 1.2rem; }
  .buches-info { grid-template-columns: 1fr; }
  .buches-info div { border-right: 0; border-bottom: 1px solid var(--line); }
  .noel-hero__actions .btn-luxe { width: 100%; }
  .avent-modal__inner { padding: 2.6rem 1.4rem 2rem; }
  html.noel body::after { display: none; } /* une seule couche de neige sur mobile */
  .noel-toggle { left: 14px; bottom: 14px; }
}

/* Accessibilité : pas de mouvement si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  html.noel body::before, html.noel body::after { display: none; }
  html.noel .bandeau-nouveaute::after, .avent-day.is-today { animation: none; }
  .noel-toggle { display: none; }
}
