/* Styles repris de la maquette Damraz. Les couleurs --gold-deco et --band sont remplacées par celles de chaque boutique. */
:root {
  --paper: #F5EDDC; --card: #FFFCF6; --ink: #17140F; --muted: #6A604F; --line: #E3D6BC;
  --gold: #8F6A22; --gold-deco: #BD9241; --gold-soft: #F1E2C2; --night: #0B0C0C; --on-night: #F6EBD6;
  --photo: #FFFFFF; --ok: #2E7A4C; --ok-soft: #DDEFE2; --warn: #A3501C; --warn-soft: #F7E3D3;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 18px rgba(40, 30, 10, .06);
  --band: #F8E8CC; --on-band: #17140F; --band-gold: #8F6A22;
  --f-display: 'Oswald', 'Arial Narrow', sans-serif;
  --f-body: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13110E; --card: #1D1A15; --ink: #F2E9D8; --muted: #A89B84; --line: #342D23;
    --gold: #D6AC5E; --gold-soft: #2E2617; --night: #070808; --on-night: #F6EBD6;
    --photo: #F4EFE6; --ok: #6CC28E; --ok-soft: #1B2E22; --warn: #E59563; --warn-soft: #33221A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
body.has-cartbar { padding-bottom: 130px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-deco); outline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bandeau aperçu / test */
.notice { background: var(--gold-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.notice .wrap { padding-block: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }

/* En-tête marque */
.brand { background: var(--band); color: var(--on-band); border-bottom: 2px solid var(--gold-deco); }
.brand .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.brand img { height: 76px; width: auto; flex: none; }
.brand a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 20px; }
.brand-text { border-left: 1px solid var(--gold-deco); padding-left: 20px; }
.brand-name { font-family: var(--f-display); font-weight: 300; font-size: 28px; letter-spacing: .1em; text-transform: uppercase; line-height: 1.1; }
.brand-sub { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--band-gold); font-weight: 500; }
.brand-who { margin-left: auto; font-size: 13px; opacity: .8; text-align: right; }

main { padding-block: 28px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.h-display { font-family: var(--f-display); font-weight: 300; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(28px, 5vw, 40px); line-height: 1.1; }
.h-section { font-family: var(--f-display); font-weight: 300; text-transform: uppercase; letter-spacing: .06em; font-size: 24px; display: flex; align-items: center; gap: 14px; }
.h-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h2.h-box { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: 19px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); padding: 10px 18px; border-radius: 8px; cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); min-height: 44px; }
.btn:hover { border-color: var(--gold-deco); }
.btn.primary { background: var(--gold-deco); border-color: var(--gold-deco); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small-btn { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn.danger { color: var(--warn); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.linkbtn { border: 0; background: none; color: var(--gold); cursor: pointer; padding: 0; font-weight: 500; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

/* Accès par code */
.gate { max-width: 460px; margin: 24px auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.gate p { color: var(--muted); }
.gate form { display: grid; gap: 10px; }
.gate .amb-access { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.gate .amb-access p { margin: 0; }
.field { display: grid; gap: 4px; align-content: start; }
.field label, .legend { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=number], .field input[type=datetime-local], .field input[type=url], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-height: 44px;
}
.field textarea { min-height: 90px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-deco); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-size: 18px !important; text-align: center; }
.error { color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.success { color: var(--ok); background: var(--ok-soft); padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.devlink { word-break: break-all; font-size: 13px; background: var(--gold-soft); padding: 10px 12px; border-radius: 6px; }

/* Intro vente */
.intro { display: grid; gap: 14px; margin-bottom: 32px; }
.intro > p { max-width: 62ch; color: var(--muted); }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.point { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.point span { color: var(--muted); font-size: 14px; }
.rule { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-left: 3px solid var(--gold-deco); background: var(--gold-soft); border-radius: 0 8px 8px 0; font-size: 14px; }
.amb-msg { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px dashed var(--gold-deco); border-radius: 10px; background: var(--card); }

/* Catalogue */
.family { display: grid; gap: 16px; margin-bottom: 36px; }
.beers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.beer { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.beer.noimg { grid-template-columns: minmax(0, 1fr); }
.bottle { background: var(--photo); border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 8px 6px; align-self: start; }
.bottle img { width: 100%; height: auto; max-height: 230px; object-fit: contain; display: block; }
.beer-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.beer-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.beer-head h3 { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: 22px; color: var(--gold); }
.deg { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--gold-deco); color: #fff; font-size: 13px; font-weight: 500; }
.desc { color: var(--muted); font-size: 14px; }
.taste { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: 12px; }
.taste div { display: flex; align-items: center; gap: 6px; }
.taste dt { color: var(--muted); }
.taste dd { margin: 0; display: inline-flex; gap: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--gold-deco); display: inline-block; }
.dot.f { background: var(--gold-deco); }
.dot.h { background: linear-gradient(90deg, var(--gold-deco) 50%, transparent 50%); }
.fmts { display: grid; margin-top: 4px; }
.fmt { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.fmt-size { font-weight: 500; }
.fmt-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.fmt-price s { color: var(--muted); font-size: 13px; }
.fmt-price strong { font-size: 17px; }
.off { font-size: 11px; color: var(--ok); background: var(--ok-soft); padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; color: var(--gold); }
.stepper button:hover { background: var(--gold-soft); }
.stepper input { width: 40px; border: 0; background: none; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; padding: 0; min-height: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fmt.has .stepper { border-color: var(--gold-deco); background: var(--gold-soft); }

/* Barre panier */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--night); color: var(--on-night); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 20; box-shadow: 0 -4px 20px rgba(0, 0, 0, .18); }
.cartbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.cart-sum { display: grid; gap: 2px; min-width: 0; }
.cart-sum strong { font-size: 17px; font-weight: 500; }
.cart-sum span { font-size: 13px; opacity: .85; }
.cart-sum span.ok { color: #8FD3A8; opacity: 1; }

/* Panneaux, formulaires */
.panel { max-width: 720px; margin: 0 auto; display: grid; gap: 20px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 14px; }
.grid2 { display: grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.grid3 { display: grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.radio { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--gold-deco); background: var(--gold-soft); }
.radio input, .check input { accent-color: var(--gold-deco); margin-top: 4px; width: 18px; height: 18px; }
.radio span { display: grid; font-size: 14px; color: var(--muted); }
.radio strong { color: var(--ink); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: start; font-size: 14px; cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.legal { font-size: 12px; color: var(--muted); }

/* Tableaux */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 500; background: var(--gold-soft); }
tr.cancelled td { opacity: .5; text-decoration: line-through; }
.recap td { padding: 6px 0; border: 0; }
.recap tfoot td { background: none; border-top: 1px solid var(--line); padding-top: 10px; }
.price-in { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); text-align: right; font-variant-numeric: tabular-nums; min-height: 36px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 500; white-space: nowrap; border: 0; }
.pill.wait { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.neutral { background: var(--gold-soft); color: var(--gold); }
button.pill { cursor: pointer; min-height: 30px; }
.items { font-size: 13px; color: var(--muted); }

/* Espace de gestion */
.adminnav { background: var(--card); border-bottom: 1px solid var(--line); }
.adminnav .wrap { display: flex; gap: 2px; overflow-x: auto; }
.adminnav a { padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.adminnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold-deco); }
.adminnav form { margin-left: auto; display: flex; align-items: center; }
.head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 2px; }
.stat b { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold-deco); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.toolbar select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-height: 40px; }
.stack { display: grid; gap: 20px; }
.cards { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head h3 { font-size: 18px; font-weight: 500; }
.share { display: grid; gap: 8px; padding: 14px 16px; border: 1px dashed var(--gold-deco); border-radius: 10px; background: var(--card); }
.share code, code.c { font-size: 14px; background: var(--gold-soft); padding: 2px 8px; border-radius: 4px; word-break: break-all; }
.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 28px; }
details.box > summary { cursor: pointer; font-weight: 500; }
.row-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.prep h3 { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
footer.site { padding-block: 24px 40px; font-size: 12px; color: var(--muted); }
footer.site a { color: var(--muted); }

@media (max-width: 560px) {
  .brand-who { display: none; }
  .brand .wrap, .brand a { gap: 14px; }
  .brand img { height: 60px; }
  .brand-text { padding-left: 14px; }
  .brand-name { font-size: 22px; }
  .brand-sub { font-size: 10px; letter-spacing: .12em; }
  .beer { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 14px; padding: 14px; }
  /* Sur téléphone : formats et prix sur toute la largeur, sous la photo */
  .beer-body { display: contents; }
  .beer .bottle { grid-row: 1 / span 3; }
  .beer-body > * { grid-column: 2; }
  .beer.noimg .beer-body > * { grid-column: 1; }
  .beer-body > .fmts { grid-column: 1 / -1; }
  .fmt { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .cartbar .btn { width: 100%; }
  .box { padding: 16px; }
}
@media print {
  .adminnav, .cartbar, .noprint, .brand, .notice { display: none !important; }
  body { background: #fff; color: #000; }
  .tablewrap, .box { border: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .fmt, .stepper { transition: background-color .15s, border-color .15s; }
}
/* Minimum de commande : une phrase par choix, la case du nombre seulement sur la ligne cochée */
.minchoice .radio strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.minchoice input.mini { width: 72px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font: inherit; text-align: center; }
.minchoice .radio:not(:has(input[type=radio]:checked)) input.mini { opacity: .45; }
.min-custom summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.minchoice:has(input[value=aucun]:checked) .min-custom { display: none; }

/* Prix : boutique barré au-dessus, vente privée en gros, avantage en clair */
.fmt-price { display: grid; gap: 2px; justify-items: start; }
.pp-shop { font-size: 12px; color: var(--muted); line-height: 1.3; }
.pp-shop s { font-size: 12px; }
.pp-vp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pp-label { font-size: 12px; color: var(--muted); }
.save-rule strong { color: var(--ok); }
.cart-sum .cart-save { color: #8FD3A8; opacity: 1; font-weight: 500; }
.cart-save:empty { display: none; }
.recap .save-row td { color: var(--ok); font-weight: 500; }
