:root {
  --bg: #12122a;
  --bg-alt: #17173a;
  --surface: #1e1e44;
  --border: #33336a;
  --text: #ecebff;
  --muted: #b3b2d9;
  --accent: #8f82ff;
  --accent-ink: #0e0d24;
  --ok: #4ade80;
  --danger: #fb7185;
  --todo: #fbbf24;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
}
body.gate-open { overflow: hidden; }

h1, h2, h3 { line-height: 1.15; font-weight: 800; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .75em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 640px; }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9rem; margin: .5em 0 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Marquage visible des données de remplacement */
.todo { color: var(--todo); outline: 1px dashed var(--todo); outline-offset: 2px; border-radius: 4px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 2px solid transparent;
  font: 700 1rem var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s, background-color .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #a297ff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-block { width: 100%; margin-top: 16px; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 800; letter-spacing: .02em; margin: 0;
}
.badge-age { background: transparent; border: 2px solid var(--danger); color: var(--danger); }
.badge-stock { background: rgba(74, 222, 128, .14); color: var(--ok); }
.badge-epuise { background: rgba(251, 113, 133, .16); color: var(--danger); }

/* Contrôle de l'âge */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 0%, #2a2160, var(--bg) 70%);
}
body:not(.gate-open) .gate { display: none; }
body.gate-open #site { visibility: hidden; }
.gate-box {
  max-width: 460px; width: 100%; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 32px 24px;
}
.gate-title { font-size: 1.6rem; margin-top: 12px; }
.gate-actions { display: grid; gap: 12px; margin-top: 20px; }
.gate-refus { color: var(--danger); font-weight: 700; margin-top: 16px; }
.gate-naissance { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.gate-naissance label { margin: 0; }
.gate-naissance .err, .gate-naissance .hint { margin: 0; }

/* En-tête */
.hero {
  padding: 64px 0 56px; text-align: center;
  background: radial-gradient(ellipse at 50% -10%, #2c2468 0%, var(--bg) 65%);
}
.hero-title { font-size: clamp(2.4rem, 10vw, 4rem); margin: 14px 0 10px; }
.hero-sub { font-size: 1.2rem; font-weight: 600; max-width: 34ch; margin: 0 auto 12px; }
.hero-note { color: var(--muted); max-width: 46ch; margin: 0 auto 24px; }

/* Catalogue : une carte par gamme, avec ses goûts */
.grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 20px; }
.gamme {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.gamme-tete { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.gamme-tete img { width: 112px; height: 112px; flex: none; border-radius: 12px; object-fit: contain; background: #fff; }
@media (min-width: 700px) { .gamme-tete img { width: 160px; height: 160px; } }
.gamme-info { min-width: 0; overflow-wrap: anywhere; }
.gamme-info h3 { margin: 0 0 4px; font-size: 1.25rem; }
.gamme-info p { margin: 0 0 2px; font-size: .95rem; }
.gamme-info .legende { font-size: .8rem; color: var(--muted); font-style: italic; margin-top: 4px; }
.gamme-info .prix { font-weight: 800; font-size: 1.2rem; margin: 6px 0 2px; color: var(--text); }

.gouts { list-style: none; margin: 0; padding: 0; }
@media (min-width: 800px) { .gouts { columns: 2; column-gap: 32px; } }
.gouts li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--border); break-inside: avoid;
}
.gouts li.epuise .g-nom { color: var(--muted); text-decoration: line-through; }
.g-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.g-nom { font-weight: 700; }

/* Formulaire */
form { margin-top: 24px; }
fieldset { margin: 0 0 16px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
legend { font-weight: 800; padding: 0 6px; font-size: 1.05rem; }
.field { margin: 12px 0 0; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea {
  width: 100%; min-height: 48px; padding: 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font: 16px var(--font);
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(143, 130, 255, .35); }
[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: .9rem; font-weight: 600; margin: 6px 0 0; }

.lignes { list-style: none; margin: 0; padding: 0; }
.lignes li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lignes li:last-child { border-bottom: 0; }
.lignes li.vide { color: var(--muted); }
.lignes .l-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lignes .l-nom { font-weight: 700; display: block; }
.lignes .l-detail { color: var(--muted); font-size: .9rem; }
.qte { display: flex; align-items: center; gap: 4px; flex: none; }
.qte button {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  font: 700 1.2rem var(--font); cursor: pointer;
}
.qte button[disabled] { opacity: .35; cursor: not-allowed; }
.qte output { min-width: 3ch; text-align: center; font-weight: 800; }

.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; margin: 0; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(143, 130, 255, .1); }
.choice input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice strong { display: block; }
.choice small { color: var(--muted); font-size: .9rem; }

.total { margin: 16px 0; }
.total > div { display: flex; justify-content: space-between; padding: 4px 0; }
.total .t-total { font-weight: 800; font-size: 1.2rem; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check label { font-weight: 600; margin: 0; }

.secours { margin-top: 20px; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); }
.secours[hidden] { display: none; }
.secours-actions { display: grid; gap: 10px; }
@media (min-width: 480px) { .secours-actions { grid-template-columns: 1fr 1fr; } }

/* Infos */
.infos { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 800px) { .infos { grid-template-columns: repeat(3, 1fr); } }
.infos p { color: var(--muted); }

/* Pied de page */
.footer { border-top: 1px solid var(--border); padding: 40px 0 120px; font-size: .95rem; }
.avertissement { border: 2px solid var(--text); border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.avertissement p:last-child { margin: 0; color: var(--muted); }
.legal { border-bottom: 1px solid var(--border); padding: 12px 0; }
.legal summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.legal p { color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }
.copy { color: var(--muted); margin-top: 24px; }

/* Barre de commande (visible dès qu'un article est choisi) */
.barre {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.barre[hidden] { display: none; }
@media (min-width: 900px) { .barre { left: auto; width: 360px; } }
