/* Boutique APEL — ambiance Noël, mobile d'abord. */
:root {
  --green-900: #213529;
  --green-700: #2f4a3e;
  --green-100: #e4e9dd;
  --red-600: #2f4a3e;
  --red-700: #213529;
  --gold-500: #c08a3e;
  --gold-100: #f2e4c6;
  --cream: #f3ebdd;
  --ink: #26302a;
  --muted: #666b5e;
  --line: #e0d5c1;
  --card: #fffdf8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 61, 44, .06), 0 8px 24px rgba(15, 61, 44, .08);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream); line-height: 1.55; }
a { color: var(--green-700); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--green-900); margin: 0 0 .5rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--green-900); color: #fff; border-bottom: 3px solid var(--gold-500); }
.site-header__inner { max-width: 70rem; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: #fff; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: .72rem; opacity: .8; letter-spacing: .02em; }
.cart-link { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-weight: 600; white-space: nowrap; }
.cart-link:hover { background: rgba(255,255,255,.12); }
.cart-badge { background: var(--red-600); color: #fff; min-width: 1.5rem; height: 1.5rem; border-radius: 999px; display: inline-grid; place-items: center; font-size: .8rem; padding: 0 .4rem; }

main { max-width: 70rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* Bandeau d'accueil */
.hero { background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: #fff; border-radius: var(--radius); padding: 2rem 1.5rem; margin-bottom: 2rem; position: relative; overflow: hidden; }
.hero::after { content: "❄ ❅ ❆ ❄ ❅"; position: absolute; right: 1rem; top: .6rem; letter-spacing: .6rem; opacity: .22; font-size: 1.4rem; pointer-events: none; }
.hero h1 { color: #fff; margin-bottom: .4rem; }
.hero p { margin: 0; max-width: 40rem; opacity: .92; }
.hero__steps { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.1rem; padding: 0; list-style: none; font-size: .92rem; }
.hero__steps li::before { content: "✓ "; color: var(--gold-500); font-weight: 700; }

/* Sections et grille de produits */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin: 2rem 0 1rem; }
.section-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.product { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.product:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,61,44,.08), 0 14px 32px rgba(15,61,44,.14); }
.product__media { aspect-ratio: 4 / 3; background: radial-gradient(circle at 30% 20%, #fff, var(--gold-100)); display: grid; place-items: center; font-size: 4.5rem; position: relative; }
.product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__tag { position: absolute; top: .7rem; left: .7rem; background: var(--red-600); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; }
.product__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.product__title { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.product__title h3 { margin: 0; font-size: 1.15rem; }
.price { font-weight: 800; color: var(--red-600); white-space: nowrap; font-size: 1.1rem; }
.product__desc { margin: 0; color: var(--muted); font-size: .94rem; }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.badge { font-size: .78rem; background: var(--green-100); color: var(--green-900); padding: .2rem .6rem; border-radius: 999px; }
.badge--gold { background: var(--gold-100); color: #6b4f0b; }

/* Formulaires */
label { display: block; margin-top: .9rem; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=password], select {
  font: inherit; width: 100%; padding: .65rem .8rem; border: 1px solid #cfc7b4; border-radius: 10px; background: #fff; color: var(--ink); margin-top: .3rem; }
input:focus, select:focus { border-color: var(--green-700); }
.buy { margin-top: auto; display: grid; gap: .6rem; }
.buy__row { display: flex; gap: .6rem; justify-content: flex-end; }
.buy__row select { flex: 1; margin: 0; }
.buy__row input[type=number] { width: 4.5rem; margin: 0; text-align: center; }
.btn, button, input[type=submit] { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 999px; padding: .75rem 1.4rem; background: var(--red-600); color: #fff; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: .4rem; transition: background .15s ease, transform .05s ease; }
.btn:hover, button:hover, input[type=submit]:hover { background: var(--red-700); }
.btn:active, button:active { transform: translateY(1px); }
.btn--green { background: var(--green-700); }
.btn--green:hover { background: var(--green-900); }
.btn--block { width: 100%; }
.btn--ghost, button.link { background: transparent; color: var(--muted); font-weight: 600; padding: .3rem .6rem; text-decoration: underline; }
.btn--ghost:hover, button.link:hover { background: transparent; color: var(--red-600); }
.hint { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }

/* Messages */
.flash { padding: .8rem 1rem; border-radius: 10px; background: var(--green-100); border-left: 4px solid var(--green-700); margin: 0 0 1rem; }
.flash.alert { background: #fde9ec; border-color: var(--red-600); }
.errors { background: #fde9ec; border-left: 4px solid var(--red-600); padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.empty { text-align: center; padding: 3rem 1rem; background: var(--card); border-radius: var(--radius); border: 1px dashed #cfc7b4; }
.empty__icon { font-size: 3rem; }

/* Panier et commande : deux colonnes */
.layout-2 { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .layout-2 { grid-template-columns: 1fr 22rem; align-items: start; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.panel--sticky { position: sticky; top: 5rem; }
.line { display: grid; grid-template-columns: 3.5rem 1fr auto; gap: .9rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line__icon { width: 3.5rem; height: 3.5rem; border-radius: 10px; background: var(--gold-100); display: grid; place-items: center; font-size: 1.7rem; overflow: hidden; }
.line__icon img { width: 100%; height: 100%; object-fit: cover; }
.line__name { font-weight: 700; }
.line__meta { color: var(--muted); font-size: .86rem; }
.line__total { text-align: right; font-weight: 700; }
.summary-row { display: flex; justify-content: space-between; padding: .35rem 0; }
.summary-row--total { font-size: 1.25rem; font-weight: 800; border-top: 2px solid var(--green-900); margin-top: .5rem; padding-top: .8rem; }
.secure { font-size: .82rem; color: var(--muted); text-align: center; margin: .8rem 0 0; }

/* Étapes */
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: .85rem; }
.steps li { flex: 1; text-align: center; padding: .45rem .3rem; border-bottom: 3px solid var(--line); color: var(--muted); }
.steps li.is-done, .steps li.is-current { border-color: var(--green-700); color: var(--green-900); font-weight: 700; }

/* Fiche enfant */
.child-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; background: #fffdf8; }
.child-card h3 { font-size: 1.02rem; display: flex; gap: .5rem; align-items: center; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 36rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--green-700); }

/* Confirmation */
.confirm { text-align: center; padding: 2rem 1rem; }
.confirm__icon { font-size: 3.5rem; }

footer.site-footer { background: var(--green-900); color: rgba(255,255,255,.85); text-align: center; padding: 2rem 1rem; font-size: .88rem; }
footer.site-footer a { color: #fff; }
.prose { max-width: 42rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 30rem) {
  .site-header__inner { gap: .6rem; padding: .6rem .8rem; }
  .brand { font-size: 1rem; line-height: 1.15; min-width: 0; }
  .brand small { font-size: .66rem; }
  .cart-link { padding: .4rem .7rem; flex-shrink: 0; }
  .line { grid-template-columns: 3rem 1fr; }
  .line__total { grid-column: 2; text-align: left; }
}

form.inline { display: inline; }
button.link { padding-left: 0; padding-right: 0; border-radius: 0; }

/* Navigation des campagnes */
.site-nav { background: var(--green-700); border-top: 1px solid rgba(255,255,255,.12); }
.site-nav ul { max-width: 70rem; margin: 0 auto; padding: 0 1rem; list-style: none; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a { color: rgba(255,255,255,.88); text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .9rem; white-space: nowrap; font-size: .93rem; font-weight: 600; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.site-nav a.is-current { color: #fff; border-bottom-color: var(--gold-500); }
.tag { font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .12rem .45rem; border-radius: 999px; line-height: 1.4; }
.tag--ok { background: #35c46a; color: #06301a; }
.tag--soon { background: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }
.hero--small { padding: 1.5rem; }

/* Stock limité */
.badge--hot { background: #fde9ec; color: var(--red-700); font-weight: 700; }
.product--out .product__media { filter: grayscale(.85); opacity: .65; }
.product--out .product__title h3, .product--out .price { color: var(--muted); }
.product__tag--stock { top: auto; bottom: .7rem; background: var(--gold-100); color: #6b4f0b; }
.product__tag--hot { background: var(--red-600); color: #fff; }
.product__tag--out { background: #4b5563; }
.soldout { margin: auto 0 0; padding: .8rem; text-align: center; background: #f1efe8; border-radius: 10px; color: var(--muted); font-weight: 600; }

/* Image produit : toujours recadrée en 4:3, quelle que soit sa forme d'origine */
.product__media { overflow: hidden; }
.product__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Quantité dans le panier */
.qty { display: flex; align-items: center; gap: .3rem; margin-top: .5rem; flex-wrap: wrap; }
.qty form.inline { display: inline; }
.qty__btn { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; background: #fff; color: var(--green-900); border: 1px solid var(--green-700); font-size: 1.15rem; line-height: 1; }
.qty__btn:hover:not(:disabled) { background: var(--green-100); }
.qty__btn:disabled { opacity: .35; cursor: not-allowed; }
.qty__value { min-width: 2rem; text-align: center; font-weight: 700; }
.qty .link { margin-left: .6rem; }

/* Prénoms à inscrire dans le panier */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.perso { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem .8rem; margin: .8rem 0 0; background: #fffdf8; }
.perso legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.perso legend small { font-weight: 400; color: var(--muted); }
.perso__row { display: grid; grid-template-columns: 1fr; gap: .1rem; margin-top: .4rem; }
@media (min-width: 36rem) { .perso__row { grid-template-columns: 9rem 1fr; gap: .6rem; align-items: center; } .perso__row label { margin: 0; } .perso__row .perso__error { grid-column: 2; } }
.perso__row label { margin-top: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.perso__row input { margin: 0; }
.perso__row input[aria-invalid="true"] { border-color: var(--red-600); background: #fff6f7; }
.perso__error { color: var(--red-700); font-size: .8rem; }

.line__icon, .line__total { align-self: start; }
.line__total { padding-top: .2rem; }

/* Palette « sapin & crème » : le sapin porte les actions (texte crème), l'ocre et la terre cuite restent des touches. */
.btn, button, input[type=submit], .chip--primary { background: var(--green-700); color: #f3ebdd; }
.btn:hover, button:hover, input[type=submit]:hover, .chip--primary:hover { background: var(--green-900); color: #f3ebdd; }
.chip--primary { border-color: var(--green-700); }
.btn--ghost, button.link { background: transparent; }
.cart-badge { background: #c08a3e; color: #1c2a21; }
.product__tag { background: var(--green-700); color: #f3ebdd; }
.product__tag--hot { background: #a3472b; color: #fff; }
.product__tag--stock { background: #fffdf8; color: var(--green-900); box-shadow: 0 1px 4px rgba(33,53,41,.25); }
.product__tag--out { background: #6b6b60; color: #fff; }
.price { color: #a3472b; }
.site-header { border-bottom-color: #c08a3e; }
.hero { background: linear-gradient(135deg, var(--green-900), var(--green-700)); }
.hero__steps li::before { color: #e0b46a; }
.site-nav { background: var(--green-700); }
.site-nav a.is-current { border-bottom-color: #e0b46a; }
.badge--gold { background: var(--gold-100); color: #6b4a14; }
.badge--hot { background: #f6ddd2; color: #8a3a21; }
.product__media { background: radial-gradient(circle at 30% 20%, #fffdf8, #e9e0cc); }
.flash.alert, .errors { background: #fbe9e3; border-color: #a3472b; }
.perso__error { color: #a3472b; }
input:focus, select:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(47,74,62,.15); outline: 0; }

/* Alignement : la description absorbe l'espace libre, donc badges et bouton d'achat restent calés en bas de la carte. */
.product__desc { flex: 1 1 auto; }
.product__title + .badges { margin-top: auto; }
.product__tag--perso { top: auto; left: auto; right: .7rem; bottom: .7rem; }
.buy__label { align-self: center; font-weight: 600; color: var(--muted); }
.child-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.btn--ghost { background: transparent; color: var(--green-700); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--green-100); color: var(--green-900); }

/* Écran de confirmation de commande */
.confirm-hero { text-align: center; background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: #fff; border-radius: var(--radius); padding: 2rem 1.2rem; margin-bottom: 1.4rem; }
.confirm-hero h1 { color: #fff; margin: .6rem 0; }
.confirm-hero p { margin: .3rem 0; opacity: .92; }
.confirm-hero__check { width: 4rem; height: 4rem; margin: 0 auto; border-radius: 50%; background: #fffdf8; color: var(--green-700); font-size: 2rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 8px rgba(255,255,255,.15); }
.confirm-hero__ref { display: inline-flex; flex-direction: column; margin-top: 1rem; padding: .7rem 1.6rem; border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; }
.confirm-hero__ref span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.confirm-hero__ref strong { font: 700 1.6rem Georgia, serif; letter-spacing: .04em; }
.confirm-hero--wait { background: linear-gradient(135deg, #6a6b5c, #8a8a78); }
.confirm-hero--off { background: linear-gradient(135deg, #5f4a3e, #7d6455); }
.confirm-hero--wait .confirm-hero__check, .confirm-hero--off .confirm-hero__check { color: #5f4a3e; }
.next-steps__list { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; }
.next-steps__list li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: 0 .7rem; }
.next-steps__list li::before { content: counter(step); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; background: var(--green-100); color: var(--green-900); font-weight: 800; display: grid; place-items: center; }
.next-steps__list span { color: var(--muted); font-size: .92rem; }
