/* Boutique — pensée d'abord pour le téléphone (arrivée par QR code). */
:root {
  --bg: #faf5ea; --surface: #fffdf8; --ink: #1c2620; --muted: #5e6a62; --line: #e6dcc8;
  --green: #1d4d3a; --green-2: #163b2c; --accent: #e9a820; --danger: #b3261e; --ok: #1f7a4d;
  --radius: 14px; --shadow: 0 1px 2px rgba(28, 38, 32, .06), 0 6px 20px rgba(28, 38, 32, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); }
body.has-cart { padding-bottom: 92px; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* En-tête */
.top { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.2rem/1.2 var(--serif); letter-spacing: .01em; min-width: 0; }
@media (max-width: 420px) { .brand { font-size: 1.05rem; gap: 8px; } }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: #fff; border-radius: 50%; font-size: 20px; }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; }
.hero { padding: 22px 0 6px; }
.tagline { font: 1.45rem/1.25 var(--serif); max-width: 22em; text-wrap: balance; }
.deadline { display: inline-block; margin-top: 12px; padding: 8px 14px; border-radius: 12px; background: #e3efe6; color: var(--green-2); font-weight: 600; font-size: .93rem; }
.deadline.late { background: #fbedc9; color: #6b4a00; }
.deadline.closed { background: #f6dcd9; color: #7d1a14; }
.banner { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #fbedc9; color: #6b4a00; font-size: .93rem; }

/* Catégories */
.cats { position: sticky; top: 56px; z-index: 4; display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 0; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; }
.cats a:hover { border-color: var(--green); }

.cat { padding-top: 26px; }
.cat h2 { font: 600 1.5rem/1.2 var(--serif); margin-bottom: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.card { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.off { opacity: .62; }
.thumb { width: 108px; height: 108px; flex: none; border-radius: 12px; object-fit: cover; display: grid; place-items: center; font-size: 40px; }
.tint0 { background: #f6e3b4; } .tint1 { background: #dcebd5; } .tint2 { background: #f5d9cc; } .tint3 { background: #d6e6ee; } .tint4 { background: #ecdcef; }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card h3 { font-size: 1.02rem; line-height: 1.25; }
.desc { color: var(--muted); font-size: .9rem; }
.allergens { color: var(--muted); font-size: .78rem; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.soldout { font-size: .85rem; font-weight: 600; color: var(--danger); }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; flex: none; min-height: 46px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--green-2); }
.btn:disabled { background: #b9c2bc; cursor: not-allowed; }
.btn.small { min-height: 38px; padding: 6px 16px; font-size: .93rem; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.ghost:hover { background: #e3efe6; }
.btn.ghost.on-dark { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); min-height: 38px; padding: 6px 14px; font-size: .93rem; }
.btn.ghost.on-dark:hover { background: rgba(255, 255, 255, .12); }
.btn.social { width: 100%; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); justify-content: flex-start; }
.btn.social:hover { background: #f4eee0; }
.social-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.social-mark.g { background: #ea4335; } .social-mark.f { background: #1877f2; font-family: Georgia, serif; } .social-mark.d { background: var(--accent); }
.link { background: none; border: 0; padding: 6px 0; color: var(--green); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--danger); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #efe7d6; cursor: pointer; font-size: 16px; }
.stepper { display: inline-flex; align-items: center; background: #e3efe6; border-radius: 999px; flex: none; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--green); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Barre du panier */
.cart-bar { position: fixed; z-index: 6; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--green); color: #fff; font-weight: 700; font-size: 1.02rem; cursor: pointer; box-shadow: 0 10px 30px rgba(22, 59, 44, .4); }
.cart-count { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #2b1d00; }
.cart-total { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Feuille */
.sheet { width: min(100%, 560px); max-width: 100%; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(20, 28, 23, .55); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.sheet-head h2 { font: 600 1.4rem/1.2 var(--serif); }
.sheet-body { padding: 4px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; max-height: 88dvh; } }

.muted { color: var(--muted); font-size: .93rem; }
.error { color: var(--danger); font-weight: 600; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fbedc9; color: #5a3f00; }
.secure { text-align: center; color: var(--muted); font-size: .82rem; }
.sub { font: 600 1.1rem/1.2 var(--serif); margin-top: 8px; }

.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.choice legend { font: 600 1.1rem/1.2 var(--serif); padding: 6px 0; }
.option { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 50px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--green); background: #e9f2ec; }
.option.off { opacity: .55; cursor: not-allowed; }
.option input { width: 20px; height: 20px; accent-color: var(--green); flex: none; }
.option-name { flex: 1; font-weight: 600; }
.option-name small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }

.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-main small { color: var(--muted); font-size: .85rem; }
.totals { display: flex; flex-direction: column; gap: 4px; }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; font-size: 1.12rem; }

.checkout { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 600; font-size: .93rem; }
.field small { color: var(--muted); font-size: .82rem; }
.field input, .field select { min-height: 48px; padding: 10px 12px; border: 1.5px solid #cfc4ad; border-radius: 10px; background: #fff; font-size: 16px; width: 100%; }
.where { font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: block; padding: 10px 16px; min-height: 44px; border-radius: 999px; border: 1.5px solid #cfc4ad; background: #fff; font-weight: 600; }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.chip.off span { opacity: .5; text-decoration: line-through; }
.logins { display: flex; flex-direction: column; gap: 10px; }

.confirm { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 6px 0 4px; }
.confirm-num { width: 132px; height: 132px; border-radius: 50%; background: var(--green); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.confirm-num small { font-size: .82rem; opacity: .85; }
.confirm-num strong { font: 700 3rem/1 var(--serif); }
.past { padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.past .lines { width: 100%; }
.past .lines li { padding: 6px 0; border: 0; }
.past-head { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.history { display: flex; flex-direction: column; gap: 10px; }
.tag { padding: 2px 10px; border-radius: 999px; background: #e3efe6; color: var(--green-2); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.tag.refunded { background: #f6dcd9; color: #7d1a14; }
.row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.legal { white-space: pre-wrap; font-size: .93rem; }

.foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.toast { position: fixed; z-index: 20; left: 50%; top: 70px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #1c2620; color: #fff; font-weight: 600; font-size: .93rem; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
