/* Commande en ligne — page publique */
:root {
  --accent: #1F6F4A;
  --ink: #16181D;
  --ink-2: #565C68;
  --ink-3: #8C919B;
  --line: #E8E9ED;
  --bg: #F4F5F7;
  --paper: #FFFFFF;
  --mustard: #F2B630;
  --danger: #B42318;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 9px;
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
  --accent-ink: color-mix(in srgb, var(--accent) 82%, black);
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px -8px color-mix(in srgb, var(--accent) 22%, rgba(22, 24, 29, .18));
  --toolbar-h: 64px;
  --page: #FFFFFF;
  --price: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--toolbar-h) + 12px); }
body { margin: 0; font: 400 16px/1.5 var(--body); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 50; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- En-tête : couverture + carte du restaurant ---------- */
.hero { position: relative; padding-top: 128px; }
.hero-cover {
  position: absolute; inset: 0 0 auto; height: 204px; overflow: hidden;
  background:
    radial-gradient(120% 140% at 12% 0%, color-mix(in srgb, var(--accent) 55%, white) 0%, transparent 55%),
    radial-gradient(90% 120% at 95% 20%, color-mix(in srgb, var(--accent) 75%, black) 0%, transparent 60%),
    var(--accent);
  background-size: cover; background-position: center;
}
.hero-cover:not(.has-photo)::after {
  /* grain léger : évite l'aplat numérique */
  content: ''; position: absolute; inset: 0; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-cover.has-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 40%, rgba(0,0,0,.35)); }
.hero-card {
  position: relative; background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 26px 28px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; align-items: start;
}
.hero-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.r-logo { width: 84px; height: 84px; border-radius: 20px; object-fit: contain; background: var(--paper); border: 4px solid var(--paper); box-shadow: var(--shadow); margin-top: -58px; align-self: flex-start; flex: none; }
.hero-id { min-width: 0; }
.hero-id h1 { font: 800 clamp(1.9rem, 4.2vw, 2.9rem)/1 var(--display); letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
.tagline { margin: 8px 0 0; color: var(--ink-2); font-size: 1.02rem; max-width: 52ch; text-wrap: pretty; }
.facts { grid-column: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fact { display: inline-flex; align-items: center; gap: 7px; font-size: .92rem; font-weight: 600; color: var(--ink-2); }
.fact svg { width: 17px; height: 17px; color: var(--ink-3); }
.fact a { color: inherit; text-decoration: none; }
.fact a:hover { color: var(--ink); text-decoration: underline; }
.fact .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.fact-open { color: #14774A; }
.fact-open .dot { background: #1E9E5A; box-shadow: 0 0 0 4px rgba(30, 158, 90, .14); }
.fact-closed { color: var(--danger); }
.fact-closed .dot { background: var(--danger); }
.hero-order { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; align-self: center; }
@media (max-width: 860px) {
  .hero { padding-top: 110px; }
  .hero-cover { height: 170px; }
  .hero-card { grid-template-columns: 1fr; padding: 20px; }
  .hero-order { grid-column: 1; grid-row: auto; align-items: stretch; }
  .r-logo { width: 68px; height: 68px; margin-top: -48px; border-radius: 16px; }
}

/* Mode de commande : interrupteur segmenté */
.mode-bar { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 999px; }
.mode { border: 0; background: transparent; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .95rem; color: var(--ink-2); white-space: nowrap; transition: background .18s, color .18s; }
.mode:hover { color: var(--ink); }
.mode.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(22,24,29,.08), 0 2px 8px rgba(22,24,29,.06); }
@media (max-width: 520px) { .mode { padding: 9px 10px; font-size: .9rem; } }
.delivery-chip { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 0; font-size: .88rem; color: var(--ink-2); max-width: 380px; justify-content: flex-end; text-align: right; }
@media (max-width: 860px) { .delivery-chip { justify-content: flex-start; text-align: left; max-width: none; } }

/* ---------- Barre collante : catégories + recherche ---------- */
.toolbar { position: sticky; top: 0; z-index: 6; margin-top: 22px; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; gap: 16px; min-height: var(--toolbar-h); }
.cat-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 4px 0; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a { flex: none; padding: 8px 15px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; transition: background .15s, color .15s; }
.cat-nav a:hover { color: var(--ink); background: var(--bg); }
.cat-nav a.is-active { background: var(--ink); color: #fff; }
.search { position: relative; flex: 0 1 260px; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid transparent; background: var(--bg); border-radius: 999px; font-size: .95rem; transition: border-color .15s, background .15s; }
.search input:focus { outline: none; background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
@media (max-width: 640px) {
  .toolbar-inner { flex-direction: column-reverse; align-items: stretch; gap: 0; padding-top: 10px; }
  .search { flex: none; }
}

/* ---------- Grille ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 44px; align-items: start; padding-top: 8px; padding-bottom: 120px; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; gap: 12px; } }
.menu { outline: none; min-width: 0; }

.cat { padding-top: 28px; }
.cat-title { font: 700 1.55rem/1.1 var(--display); letter-spacing: -0.025em; margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; }
.cat-count { font: 600 .85rem var(--body); color: var(--ink-3); letter-spacing: 0; }

/* Plats : lignes de menu (pas de boîtes), deux colonnes sur grand écran */
.dishes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 720px) { .dishes { grid-template-columns: 1fr; } }
.dish { border-bottom: 1px solid var(--line); }
.dish-btn {
  width: 100%; height: 100%; display: flex; gap: 16px; align-items: center; text-align: left; border: 0; background: transparent;
  padding: 18px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: var(--radius); transition: background .18s;
}
.dish-btn:hover { background: var(--bg); }
.dish-btn:active { transform: scale(.995); }
.dish-text { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dish-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.dish-desc { color: var(--ink-2); font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--price); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
/* Ligne avec photo ronde (accompagnements, boissons…) */
.dish-thumb { flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--bg); box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); }
.dish-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.dish-btn:hover .dish-thumb img { transform: scale(1.06) rotate(-3deg); }

/* Grandes cartes photo (quand tous les plats de la catégorie ont une photo) */
.dishes.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; padding-top: 10px; }
.dishes.cards .dish { border: 0; }
.dishes.cards .dish-btn { flex-direction: column; align-items: stretch; gap: 12px; margin: 0; width: 100%; height: 100%; padding: 14px 14px 16px; background: var(--bg); border-radius: 20px; position: relative; transition: transform .2s, box-shadow .2s, background .2s; }
.dishes.cards .dish-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(0,0,0,.35); }
.dish-photo { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.dishes.cards .dish-btn:hover .dish-photo img { transform: scale(1.05); }
.dishes.cards .dish-name { font: 700 1.2rem/1.2 var(--display); letter-spacing: -0.01em; }
.dishes.cards .dish-text { padding-right: 46px; }
.dishes.cards .dish-add { position: absolute; right: 14px; bottom: 14px; width: 42px; height: 42px; background: var(--accent); color: #fff; box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
@media (max-width: 520px) {
  .dishes.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dishes.cards .dish-btn { padding: 10px 10px 12px; border-radius: 16px; }
  .dishes.cards .dish-desc { display: none; }
  .dishes.cards .dish-text { padding-right: 0; padding-bottom: 40px; }
  .dishes.cards .dish-add { right: 10px; bottom: 10px; width: 36px; height: 36px; }
}
.dish-add {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--paper); color: var(--accent-ink); font-size: 1.25rem; font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(22,24,29,.08); transition: transform .18s, background .18s, color .18s;
}
.dish-btn:hover .dish-add { transform: scale(1.08); background: var(--accent); color: #fff; box-shadow: none; }
.in-cart .dish-add { background: var(--accent); color: #fff; font-size: .95rem; font-weight: 800; box-shadow: none; }

/* Les plus commandés */
.popular { padding-top: 26px; }
.pop-list { list-style: none; margin: 8px -24px 0; padding: 4px 24px 10px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.pop-list::-webkit-scrollbar { display: none; }
.pop-list li { scroll-snap-align: start; flex: none; }
.pop { width: 168px; border: 0; background: transparent; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.pop img, .pop-ph { width: 168px; height: 124px; border-radius: var(--radius); object-fit: cover; display: block; transition: transform .25s; }
.pop-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 22%, white)); color: var(--accent-ink); font: 800 2.6rem var(--display); }
.pop:hover img, .pop:hover .pop-ph { transform: translateY(-2px); }
.pop-name { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pop-price { color: var(--ink-2); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }

.no-result, .empty-menu { text-align: center; padding: 56px 16px; color: var(--ink-2); }
.no-result p, .empty-menu p { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.empty-menu svg { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- Panier ---------- */
.cart {
  position: sticky; top: calc(var(--toolbar-h) + 20px); margin-top: 28px; background: var(--bg); border-radius: var(--radius-lg); padding: 22px;
  /* Toujours visible en entier : seule la liste des plats défile si elle est longue */
  max-height: calc(100dvh - var(--toolbar-h) - 40px); display: flex; flex-direction: column;
}
.cart > * { flex: none; }
.cart > .cart-lines { flex: 0 1 auto; min-height: 90px; overflow-y: auto; overscroll-behavior: contain; margin-right: -10px; padding-right: 10px; }
.cart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cart-head h2 { font: 700 1.3rem/1.2 var(--display); margin: 0; letter-spacing: -0.02em; }
.cart-count { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 8px 18px; color: var(--ink-2); }
.cart-empty svg { width: 36px; height: 36px; color: var(--ink-3); margin-bottom: 6px; }
.cart-empty p { margin: 0; font-weight: 700; color: var(--ink); }
.cart-empty span { font-size: .92rem; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, var(--ink-3)); align-items: start; }
.cl-main { display: flex; flex-direction: column; min-width: 0; }
.cl-name { font-weight: 700; }
.cl-opts { color: var(--ink-3); font-size: .85rem; }
.cl-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-line .stepper { grid-column: 1; justify-self: start; }
.cart .stepper { background: var(--paper); border-color: var(--paper); }
.cart .stepper svg { width: 15px; height: 15px; }
.free-bar { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.free-bar p { margin: 0; font-size: .88rem; font-weight: 600; color: var(--accent-ink); }
.free-track { height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 14%, white); overflow: hidden; }
.free-track i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .4s ease; }
.sums { margin: 16px 0; display: grid; gap: 7px; }
.sums div { display: flex; justify-content: space-between; }
.sums dt { color: var(--ink-2); }
.sums dd { margin: 0; font-variant-numeric: tabular-nums; }
.sums-hint { color: var(--accent-ink); font-size: .85rem; }
.sums-total { padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, var(--ink-3)); font-weight: 800; font-size: 1.12rem; }
.sums-total dt { color: var(--ink); }
.cart-notice { background: var(--accent-soft); color: var(--accent-ink); padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; margin: 8px 0 4px; font-weight: 600; }
.chip-card span::before { content: ''; display: inline-block; width: 16px; height: 11px; margin-right: 7px; border-radius: 2px; border: 1.5px solid currentColor; vertical-align: -1px; background: linear-gradient(currentColor, currentColor) 0 3px / 100% 1.5px no-repeat; }
.paid { color: var(--accent-ink); font-weight: 700; }
.form-error a { color: inherit; }
.cart-warn { background: #FFF6DB; color: #7A5300; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; margin: 0 0 12px; }
@media (max-width: 960px) { .cart { position: static; margin-top: 12px; max-height: none; } .cart > .cart-lines { overflow: visible; } }

.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 10;
  display: none; align-items: center; gap: 12px; padding: 15px 18px; border: 0; border-radius: 18px;
  background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 12px 30px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}
.cart-bar .cb-count { background: rgba(255,255,255,.22); color: #fff; border-radius: 8px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: .88rem; }
.cart-bar .cb-total { margin-left: auto; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .cart-bar:not([hidden]) { display: flex; } }
.cart-bar.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.03); } }

/* Boutons */
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 12px 18px; font-weight: 700; transition: background .18s, border-color .18s, transform .12s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-lg { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 1.02rem; }
.btn-lg:disabled { justify-content: center; }
.btn-lg:disabled .btn-total { display: none; }
.btn-total { background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-grow { flex: 1; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.2rem; border-radius: 50%; }
.stepper button:hover { background: var(--bg); }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper-sm button { width: 30px; height: 30px; font-size: 1rem; }

/* Fenêtres */
.sheet { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); background: var(--paper); color: var(--ink); }
.sheet-wide { width: min(600px, calc(100% - 24px)); }
.sheet::backdrop { background: rgba(20, 22, 28, .5); }
.sheet[open] { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (max-width: 600px) {
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
}
.sheet-inner { padding: 24px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg); font-size: 1.4rem; line-height: 1; z-index: 1; }
.sheet-img { width: calc(100% + 48px); margin: -24px -24px 0; aspect-ratio: 16 / 9; object-fit: cover; }
.sheet-title { font: 700 1.6rem/1.1 var(--display); letter-spacing: -0.02em; margin: 0; padding-right: 40px; }
.sheet-desc { margin: 0; color: var(--ink-2); }
.sheet-actions { display: flex; gap: 12px; align-items: center; position: sticky; bottom: -24px; background: var(--paper); padding: 12px 0 0; }

.opt-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 10px; margin: 0; }
.opt-group legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.opt-group.is-missing { border-color: var(--danger); }
.opt-group.is-missing .opt-rule { color: var(--danger); }
.opt-rule { font-weight: 500; color: var(--ink-3); font-size: .85rem; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.opt-name { flex: 1; }
.opt-price { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-weight: 600; font-size: .92rem; padding: 0; }
.field em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form-error { background: #FDECEA; color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; font-weight: 600; }
.fineprint { color: var(--ink-3); font-size: .85rem; margin: 0; text-align: center; }
.fineprint a { color: inherit; }

/* Suivi */
.tracking { max-width: 560px; margin: 0 auto; padding: 32px 20px 60px; }
.track-card { background: var(--paper); border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.track-num { font: 800 4.5rem/0.9 var(--display); letter-spacing: -0.04em; margin: 0; color: var(--accent); }
.track-title { font: 700 1.5rem/1.15 var(--display); margin: 0; }
.track-sub { margin: 0; color: var(--ink-2); }
.steps { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--ink-3); font-weight: 600; position: relative; }
.steps li::before { content: ''; height: 4px; border-radius: 4px; background: var(--line); }
.steps li.done::before, .steps li.current::before { background: var(--accent); }
.steps li.current { color: var(--ink); }
.steps li.current::before { animation: pulse 1.6s ease-in-out infinite; }
.steps li.done { color: var(--ink-2); }
.steps .dot { display: none; }
@keyframes pulse { 50% { opacity: .45; } }
.track-items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track-items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.track-items small { display: block; color: var(--ink-3); }
.track-total { font-weight: 700; border-bottom: 0 !important; }

.loading, .empty { padding: 48px 0; color: var(--ink-2); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Fenêtre d'accueil + adresse vérifiée */
.delivery-chip { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 10px 0 0; font-size: .92rem; color: var(--ink-2); max-width: 620px; }
.link { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.welcome .sheet-title { font-size: 2rem; }
.w-modes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.w-mode { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.w-mode strong { font-size: 1.05rem; }
.w-mode span { font-size: .85rem; color: var(--ink-2); }
.w-mode.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.w-delivery { display: flex; flex-direction: column; gap: 12px; }
.w-ask { margin: 0; font-weight: 600; }
.w-ok { margin: 0; color: var(--accent-ink); font-weight: 600; }
.w-result { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-weight: 600; }
.w-result.ok { background: var(--accent-soft); color: var(--accent-ink); }
.w-result.err { background: #FDECEA; color: var(--danger); }
.js-locate { align-self: flex-start; }

/* Plusieurs restaurants */
.branch-line { margin: 6px 0 0; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.branch-line strong { color: var(--ink); }
.w-branches { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.w-branches legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.w-branch { display: block; cursor: pointer; }
.w-branch input { position: absolute; opacity: 0; pointer-events: none; }
.w-branch span { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.w-branch small { color: var(--ink-2); font-size: .85rem; }
.w-branch small.is-open { color: var(--accent-ink); font-weight: 600; }
.w-branch small.is-closed { color: var(--ink-3); }
.w-branch input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.w-branch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, white); outline-offset: 2px; }
.w-branch.is-off { opacity: .5; cursor: not-allowed; }



/* ---------- Thème sombre (Réglages → Apparence de la page client) ---------- */
[data-theme="dark"] {
  --page: #0F1115;
  --paper: #171A21;
  --bg: #1D2129;
  --ink: #F2F3F5;
  --ink-2: #A9AEB8;
  --ink-3: #737A86;
  --line: #262A33;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, #171A21);
  --accent-ink: color-mix(in srgb, var(--accent) 55%, white);
  --price: color-mix(in srgb, var(--accent) 70%, white);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
[data-theme="dark"] .hero-cover.has-photo::after { background: linear-gradient(180deg, rgba(15,17,21,.1) 30%, rgba(15,17,21,.85)); }
[data-theme="dark"] .cat-nav a.is-active { background: var(--ink); color: var(--page); }
[data-theme="dark"] .mode.is-active { background: var(--ink); color: var(--page); }
[data-theme="dark"] .dish-add { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
[data-theme="dark"] .dishes.cards .dish-add, [data-theme="dark"] .dish-btn:hover .dish-add, [data-theme="dark"] .in-cart .dish-add { background: var(--accent); color: #fff; box-shadow: none; }
[data-theme="dark"] .dish-btn:hover { background: var(--paper); }
[data-theme="dark"] .dishes.cards .dish-btn { background: var(--paper); }
[data-theme="dark"] .cart { background: var(--paper); }
[data-theme="dark"] .cart .stepper { background: var(--bg); border-color: var(--bg); }
[data-theme="dark"] .search input { background: var(--paper); }
[data-theme="dark"] .search input:focus { background: var(--bg); }
[data-theme="dark"] .tag { color: var(--accent-ink); }
[data-theme="dark"] .cart-warn { background: #3A2E12; color: #F5D58A; }
[data-theme="dark"] .form-error { background: #3A1A17; color: #F7B4AA; }
[data-theme="dark"] .w-result.err { background: #3A1A17; color: #F7B4AA; }
[data-theme="dark"] .chip input:checked + span { background: var(--ink); color: var(--page); border-color: var(--ink); }
[data-theme="dark"] .fact-open { color: #5FD39A; }
[data-theme="dark"] .fact-closed { color: #F28B7E; }
[data-theme="dark"] .fact-closed .dot { background: #F28B7E; }
[data-theme="dark"] .sheet::backdrop { background: rgba(0,0,0,.7); }

/* ---------- Police élégante ---------- */
[data-font="elegant"] { --display: 'Fraunces', Georgia, 'Times New Roman', serif; }
[data-font="elegant"] .hero-id h1,
[data-font="elegant"] .cat-title,
[data-font="elegant"] .sheet-title,
[data-font="elegant"] .track-title,
[data-font="elegant"] .cart-head h2,
[data-font="elegant"] .dishes.cards .dish-name { font-weight: 500; letter-spacing: -0.015em; }
[data-font="elegant"] .hero-id h1 { font-weight: 600; }

/* =========================================================
   Pizza à composer
   ========================================================= */
/* Carte dans le menu */
.dish-builder { grid-column: 1 / -1; border-bottom: 0; padding: 10px 0 6px; }
.builder-card {
  width: 100%; display: flex; align-items: center; gap: 22px; text-align: left; border: 0; padding: 18px 22px 18px 18px; border-radius: 22px;
  background: radial-gradient(120% 140% at 0% 50%, #2a2f3a 0%, #15181e 60%); color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.6); transition: transform .2s;
}
.builder-card:hover { transform: translateY(-2px); }
.bc-pizza { width: 132px; height: 132px; flex: none; border-radius: 50%; filter: drop-shadow(0 12px 18px rgba(0,0,0,.5)); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.builder-card:hover .bc-pizza { transform: rotate(25deg) scale(1.04); }
.bc-pizza svg { width: 100%; height: 100%; display: block; }
.bc-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bc-kicker { font-size: .8rem; font-weight: 700; color: color-mix(in srgb, var(--accent) 60%, white); }
.bc-title { font: 700 1.6rem/1.1 var(--display); letter-spacing: -0.02em; }
.builder-card .dish-desc { color: #B4B9C3; }
.builder-card .price { color: color-mix(in srgb, var(--accent) 55%, white); }
.bc-go { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; transition: transform .2s; }
.bc-go svg { color: #fff; }
.builder-card:hover .bc-go { transform: translateX(3px); }
@media (max-width: 520px) { .builder-card { gap: 14px; padding: 14px; } .bc-pizza { width: 92px; height: 92px; } .bc-title { font-size: 1.3rem; } .bc-go { display: none; } }

/* Écran de composition */
.builder { --b-bg: #12151b; --b-surface: #1c2028; --b-line: #2a2f38; --b-ink: #f2f3f5; --b-ink-2: #a3a9b4;
  width: min(520px, 100%); max-height: min(920px, calc(100% - 16px)); background: var(--b-bg); color: var(--b-ink); }
.bd { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 18px; }
.bd-head { display: flex; justify-content: space-between; }
.bd-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--b-surface); color: var(--b-ink); display: grid; place-items: center; }
.bd-icon:hover { background: var(--b-line); }
.bd-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bd-title { font: 600 1.9rem/1.05 var(--display); letter-spacing: -0.02em; margin: 0; }
.bd-desc { margin: -4px 0 0; color: var(--b-ink-2); font-size: .92rem; }
.bd-sizes { display: inline-flex; gap: 2px; padding: 3px; background: var(--b-surface); border-radius: 999px; flex: none; }
.bd-sizes button { border: 0; background: none; color: var(--b-ink-2); min-width: 36px; height: 32px; padding: 0 10px; border-radius: 999px; font-weight: 700; transition: background .2s, color .2s; }
.bd-sizes button.is-on { background: var(--b-ink); color: var(--b-bg); }

/* La pizza */
.bd-stage { display: grid; place-items: center; padding: 8px 0 2px; }
.pz { --pz-scale: 1; position: relative; width: min(300px, 74vw); aspect-ratio: 1; border-radius: 50%; transform: scale(var(--pz-scale)); transition: transform .45s cubic-bezier(.2,.8,.2,1.15); }
.pz::before { content: ''; position: absolute; inset: -9%; border-radius: 50%; background: radial-gradient(circle, #1f242d 58%, transparent 70%); z-index: -1; }
.pz-base, .pz-layers, .pz-fire { position: absolute; inset: 0; }
.pz-base svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.pz-layer { position: absolute; inset: 0; transition: opacity .25s; }
.pz-layer.gone { opacity: 0; }
.pz-piece {
  position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(var(--rot)); pointer-events: none;
  transition: transform .6s cubic-bezier(.18,.89,.32,1.2), opacity .25s ease; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.pz-piece svg, .pz-piece img { width: 100%; height: 100%; display: block; object-fit: contain; }
/* Cuisson au feu de bois au moment d'ajouter */
.pz-fire { border-radius: 50%; pointer-events: none; opacity: 0; }
.pz.baking .pz-fire { animation: bake 1.25s ease forwards; background: radial-gradient(circle, transparent 52%, rgba(255,140,40,.55) 66%, rgba(255,90,20,0) 76%); }
.pz.baking { animation: bake-pulse 1.25s ease; }
.pz.baking::after {
  content: ''; position: absolute; inset: -6%; border-radius: 50%; pointer-events: none;
  background-image: radial-gradient(circle, #ffb347 1.5px, transparent 2px), radial-gradient(circle, #ff7a1a 1px, transparent 1.6px);
  background-size: 44px 44px, 31px 31px; background-position: 0 0, 12px 18px; animation: sparks 1.25s ease-out forwards; opacity: 0;
}
@keyframes bake { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bake-pulse { 40% { filter: saturate(1.25) brightness(1.08); } }
@keyframes sparks { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px); } }

.bd-hint { text-align: center; color: var(--b-ink-2); font-size: .88rem; margin: 2px 0 0; min-height: 1.3em; }
.bd-sides { display: flex; justify-content: center; gap: 6px; }
.bd-sides button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--b-line); background: var(--b-surface); color: var(--b-ink-2); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .82rem; }
.bd-sides button.is-on { border-color: var(--accent); color: var(--b-ink); background: color-mix(in srgb, var(--accent) 22%, var(--b-surface)); }
.hs { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; display: inline-block; }
.hs-all { background: currentColor; }
.hs-left { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.hs-right { background: linear-gradient(90deg, transparent 50%, currentColor 50%); }

/* Garnitures */
.bd-tops { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
.top { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.top-btn { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 0; background: var(--b-surface); display: grid; place-items: center; transition: transform .18s, box-shadow .2s; }
.top-btn:active { transform: scale(.92); }
.top-ico { width: 52px; height: 52px; display: grid; place-items: center; }
.top-ico svg, .top-ico img { width: 100%; height: 100%; object-fit: contain; }
.top.is-on .top-btn { box-shadow: 0 0 0 2px var(--accent), 0 8px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.top.is-active .top-btn { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.top-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; transform: scale(0); transition: transform .25s cubic-bezier(.2,.8,.2,1.4); }
.top.is-on .top-badge { transform: scale(1); }
.top-minus { position: absolute; top: -4px; left: calc(50% - 39px); width: 24px; height: 24px; border-radius: 50%; border: 0; background: #3a3f49; color: #fff; font-weight: 800; line-height: 1; display: grid; place-items: center; }
.top-name { font-size: .8rem; font-weight: 600; color: var(--b-ink-2); line-height: 1.2; }
.top.is-on .top-name { color: var(--b-ink); }
.top-price { font-size: .72rem; color: var(--b-ink-2); opacity: .8; font-variant-numeric: tabular-nums; }

/* Bouton d'ajout */
.bd-foot { position: sticky; bottom: -18px; padding: 10px 0 0; background: linear-gradient(transparent, var(--b-bg) 30%); }
.bd-add { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 16px 22px; font-weight: 700; font-size: 1.02rem; background: var(--b-surface); color: var(--b-ink-2); transition: background .25s, color .25s, box-shadow .25s; }
.bd-add.is-ready { background: var(--accent); color: #fff; box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.bd-add.is-done { background: #1E9E5A; color: #fff; }
.bd-add-label { flex: 1; text-align: left; }
.bd-total { font-variant-numeric: tabular-nums; font-weight: 800; }
.bd-delta { font-size: .82rem; opacity: 0; font-variant-numeric: tabular-nums; }
.bd-delta.flash { animation: delta 1.4s ease; }
@keyframes delta { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: .85; transform: none; } 80% { opacity: .85; } 100% { opacity: 0; } }
@media (max-width: 600px) { .builder { max-height: 96vh; } .top-btn { width: 56px; height: 56px; } .top-ico { width: 46px; height: 46px; } .top-minus { left: calc(50% - 36px); } }
@media (prefers-reduced-motion: reduce) { .pz-piece { transition: opacity .2s; } }

.btn-cancel { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn-cancel:hover { border-color: var(--danger); }
/* Rendu réaliste (images SVG) */
.pz-base img, .bc-pizza img { width: 100%; height: 100%; display: block; }
.pz-base img { filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.pz-piece img { pointer-events: none; user-select: none; }

/* Photos réelles : pâte, mozzarella et garnitures, crues puis cuites au four */
.pz-base { filter: drop-shadow(0 18px 26px rgba(0,0,0,.55)); }
.pz-base img { filter: none; }
.pz-base .pz-raw, .pz-base .pz-baked { position: absolute; inset: 0; }
.pz-base .pz-baked, .pz .ck { opacity: 0; transition: opacity .9s ease .15s; }
.pz .rw { transition: opacity .9s ease .15s; }
.pz.baking .pz-baked, .pz.baking .ck { opacity: 1; }
.pz.baking .rw { opacity: 0; }
.pz-piece { filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.pz-piece > img.rw, .pz-piece > img.ck { position: absolute; inset: 0; }
.pz-layer.is-cheese { z-index: 0; }
.pz-layer:not(.is-cheese) { z-index: 1; }
.pz-cheese { position: absolute; inset: 0; transition: opacity .35s ease; }
.pz-cheese.is-new { opacity: 0; }
.pz-cheese img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pz-cheese.side-left { clip-path: inset(0 50% 0 0); }
.pz-cheese.side-right { clip-path: inset(0 0 0 50%); }
.bc-pizza .pz-card { border-radius: 50%; }
.ph-ico { position: relative; display: block; width: 100%; height: 100%; }
.ph-ico .ca { position: absolute; width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.ph-ico .ca0 { left: 2%; top: 30%; transform: rotate(-14deg); }
.ph-ico .ca1 { right: 2%; top: 26%; transform: rotate(18deg); }
.ph-ico .ca2 { left: 19%; top: 6%; }

/* Burger à composer : couches en photo empilées (pizza-art.js → BurgerArt) */
.pz.bg { aspect-ratio: 1 / 1.02; border-radius: 0; }
.pz.bg::before { inset: 4% -6% -4%; }
.bg-stack { position: absolute; inset: 0; container-type: inline-size; transform: scale(var(--fit, 1)); transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.bg-l { position: absolute; left: 50%; transform: translateX(-50%); transition: bottom .5s cubic-bezier(.3,1.3,.5,1), width .3s, opacity .3s, transform .55s cubic-bezier(.3,1.35,.5,1); filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); }
.bg-l img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.bg-l.is-new { transform: translateX(-50%) translateY(-110cqw); opacity: 0; transition: none; }
.bg-l.gone { opacity: 0; transform: translateX(-50%) translateY(-12px); }
.bg-slate { filter: drop-shadow(0 16px 20px rgba(0,0,0,.55)); }
.bg-l > .rw, .bg-l > .ck { width: 100%; }
.bg-l > .ck { position: absolute; left: 0; bottom: 0; }
.pz.bg .ck { opacity: 0; transition: opacity .9s ease .1s; }
.pz.bg .rw { transition: opacity .9s ease .1s; }
.pz.bg.baking .ck { opacity: 1; }
.pz.bg.baking .rw { opacity: 0; }
.pz.bg.baking { animation: bg-squish 1.1s ease .35s; }
@keyframes bg-squish { 30% { transform: scale(var(--pz-scale)) scaleY(.95); } 60% { transform: scale(var(--pz-scale)) scaleY(1.02); } }
/* Cheddar : 16 images de fonte dans une seule photo */
.bg-melt { display: block; width: 100%; aspect-ratio: 720 / 400; background-size: 100% 1600%; background-position: 0 0; background-repeat: no-repeat; animation: bg-melt 1.3s steps(15) .35s forwards; }
.bg-melt.is-melted { animation: none; background-position: 0 100%; }
@keyframes bg-melt { to { background-position: 0 100%; } }
.bg-ico { display: grid; place-items: center; width: 100%; height: 100%; }
.bg-ico img { width: 112%; max-width: none; height: auto; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.builder-card.is-burger .bc-pizza { border-radius: 0; position: relative; }
.bc-pizza .bg-stack { position: absolute; inset: 0; transform: none; }
@media (prefers-reduced-motion: reduce) { .bg-l { transition: opacity .2s; } .bg-melt { animation: none; background-position: 0 100%; } }
.builder-card.is-burger:hover .bc-pizza { transform: translateY(-3px) scale(1.04); }

/* Fromage peint en spirale (comme sur le site de référence) : 1 calque par portion, toile <canvas> */
.pz-cheese-p { position: absolute; inset: 0; transition: opacity .3s ease; }
.pz-cheese-p.gone { opacity: 0; }
.pz-cheese-p canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pz-crumb { position: absolute; width: 9%; height: auto; pointer-events: none; z-index: 3; margin: -4.5% 0 0 -4.5%; }

/* Ticket de cuisine dans l'écran de composition (comme un ticket imprimé) */
.bd-ticket { display: block; }
.tk {
  --zz: 7px; --paper: #f5efe4; --ink-t: #2a241d;
  position: relative; background: var(--paper); color: var(--ink-t); padding: 22px 18px 16px;
  font: 500 .8rem/1.45 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.45));
  /* bords dentelés en haut et en bas */
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--zz)) 51% repeat-x,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--zz)) 51% repeat-x;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--zz)) 51% repeat-x,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--zz)) 51% repeat-x;
}
.tk-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 10px; border-bottom: 1px dashed #b9ad9a; margin-bottom: 8px; }
.tk-name { font: 600 1.6rem/1.05 'Fraunces', Georgia, serif; letter-spacing: -.02em; }
.tk-sub { text-transform: uppercase; letter-spacing: .18em; font-size: .62rem; margin-top: 4px; color: #6b6153; }
.tk-meta { font-size: .66rem; color: #8a7f70; margin-top: 2px; }
.tk-lines { list-style: none; margin: 0; padding: 0; }
.tk-line { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; overflow: hidden; max-height: 3em; transition: max-height .25s ease, opacity .25s ease; }
.tk-n { flex: 1; min-width: 0; }
.tk-p { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-x { border: 0; background: none; color: #8a7f70; font: inherit; font-weight: 700; padding: 0 4px; cursor: pointer; line-height: 1; }
.tk-x:hover { color: #b0331f; }
.tk-new { animation: tk-print .42s cubic-bezier(.2,.8,.2,1); }
.tk-out { max-height: 0; opacity: 0; padding: 0; }
@keyframes tk-print { from { max-height: 0; opacity: 0; transform: translateY(-6px); } 60% { opacity: 1; } to { max-height: 3em; transform: none; } }
.tk-feed { animation: tk-feed .3s ease; }
@keyframes tk-feed { 0% { transform: translateY(-4px); } 100% { transform: none; } }
.tk-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #b9ad9a; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.tk-sum { font-variant-numeric: tabular-nums; }
.tk-add { width: 100%; margin-top: 12px; border: 0; border-radius: 4px; padding: 12px 14px; background: #4a3b30; color: #fff;
  font: 700 .92rem var(--sans, 'Figtree', system-ui, sans-serif); cursor: pointer; transition: background .25s; }
.tk-add.is-ready { background: var(--accent); } /* couleur choisie par le restaurant */
.tk-add.is-ready:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
.tk-add.is-done { background: #1E9E5A; }
.tk-bar { height: 30px; margin: 14px 6px 0; background: repeating-linear-gradient(90deg, var(--ink-t) 0 2px, transparent 2px 4px, var(--ink-t) 4px 5px, transparent 5px 7px, var(--ink-t) 7px 10px, transparent 10px 12px); opacity: .85; }
.tk.tk-sent { animation: tk-send .7s cubic-bezier(.3,1.3,.5,1) forwards; }
@keyframes tk-send { 40% { transform: translateY(-10px) rotate(-1.5deg); } 100% { transform: translateY(-4px) rotate(-1deg); } }
/* Téléphone : ticket sous les garnitures, on garde le bouton du bas */
.tk-add { display: none; }
@media (min-width: 900px) {
  .builder { width: min(940px, 100%); }
  .bd { display: grid; grid-template-columns: minmax(0, 1fr) 270px; column-gap: 30px; row-gap: 10px; align-items: start; }
  .bd > * { grid-column: 1; }
  .bd > .bd-ticket { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 12px; padding-top: 60px; }
  .bd-foot { display: none; }
  .tk-add { display: block; }
}
@media (prefers-reduced-motion: reduce) { .tk-new, .tk-feed, .tk.tk-sent { animation: none; } }

/* Panier en ticket de cuisine (même papier que le ticket de l'écran de composition) */
.cart.is-ticket {
  --zz: 8px; --paper-t: #f5efe4; --ink-t: #2a241d; --rule-t: #b9ad9a;
  background: var(--paper-t); color: var(--ink-t); border-radius: 0; padding: 30px 22px 26px;
  font: 500 .86rem/1.45 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  filter: drop-shadow(0 14px 24px rgba(20, 14, 8, .22));
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--zz)) 51% repeat-x,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--zz)) 51% repeat-x;
          mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--zz)) 51% repeat-x,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--zz)) 51% repeat-x;
}
.cart.is-ticket .cart-head { flex-direction: column; align-items: center; text-align: center; gap: 0; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--rule-t); }
.cart.is-ticket .cart-head h2.tk-name { font: 600 1.7rem/1.05 'Fraunces', Georgia, serif; letter-spacing: -.02em; }
.cart.is-ticket .tk-sub { text-transform: uppercase; letter-spacing: .18em; font-size: .64rem; margin-top: 5px; color: #6b6153; }
.cart.is-ticket .tk-meta { font-size: .68rem; color: #8a7f70; margin-top: 2px; }
.cart.is-ticket .cart-count { color: inherit; font-weight: 500; font-size: inherit; }
.cart.is-ticket .cart-empty, .cart.is-ticket .cart-empty p { color: var(--ink-t); }
.cart.is-ticket .cart-empty svg { color: #8a7f70; }
.cart.is-ticket .cart-line { border-bottom: 1px dashed color-mix(in srgb, var(--rule-t) 70%, transparent); padding: 11px 0; }
.cart.is-ticket .cl-name { font-weight: 700; }
.cart.is-ticket .cl-opts { color: #6b6153; font-size: .76rem; }
.cart.is-ticket .stepper { background: rgba(42, 36, 29, .06); border-color: transparent; color: var(--ink-t); }
.cart.is-ticket .free-bar p, .cart.is-ticket .sums-hint { color: var(--accent-ink); }
.cart.is-ticket .free-track { background: rgba(42, 36, 29, .1); }
.cart.is-ticket .sums dt { color: #6b6153; }
.cart.is-ticket .sums-total { border-top: 1px dashed var(--rule-t); text-transform: uppercase; letter-spacing: .05em; font-size: 1rem; }
.cart.is-ticket .sums-total dt { color: var(--ink-t); }
.cart.is-ticket .js-checkout { border-radius: 4px; font-family: var(--sans, 'Figtree', system-ui, sans-serif); }
.cart.is-ticket .tk-bar { flex: none; height: 30px; margin: 16px 8px 0; background: repeating-linear-gradient(90deg, var(--ink-t) 0 2px, transparent 2px 4px, var(--ink-t) 4px 5px, transparent 5px 7px, var(--ink-t) 7px 10px, transparent 10px 12px); opacity: .85; }
.cart.is-ticket .cart-line.tk-new { animation: tk-print-line .5s cubic-bezier(.2,.8,.2,1); }
@keyframes tk-print-line { from { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .cart.is-ticket .cart-line.tk-new, .cart.tk-feed { animation: none; } }

/* ---------- Mode simple (iframe) : catégories + menu, rien d'autre ---------- */
[data-layout="simple"] .hero,
[data-layout="simple"] .toolbar .search { display: none; }
[data-layout="simple"] .toolbar { margin-top: 0; border-bottom: 0; }
[data-layout="simple"] .cat-nav { gap: 10px; padding: 14px 0; mask-image: none; }
[data-layout="simple"] .cat-nav a { padding: 11px 22px; border: 1px solid var(--line); color: var(--ink); background: var(--paper); text-transform: uppercase; letter-spacing: .02em; font-weight: 700; }
[data-layout="simple"] .cat-nav a:hover { border-color: var(--ink-3); background: var(--paper); }
[data-layout="simple"] .cat-nav a.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cart-mode { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: .78rem; text-align: center; }
.ck-modes { display: grid; width: 100%; margin: 0 0 18px; }
