/* Eatalo - pagina del locale e pagina dell'ordine.
   Quattro stili (data-tema sull'elemento html): classico, moderno, rustico (Trattoria), elegante (scuro).
   Il colore del locale arriva dal gestionale (--brand); --brand-ink e --brand-testo li calcola locale.js per la leggibilità. */
:root {
  --brand: #C2410C;
  --brand-ink: #FFFFFF;
  --link: var(--brand-testo, var(--brand));
  --bg: #FFFDF9;
  --surface: #FFFFFF;
  --ink: #221A16;
  --muted: #6F625A;
  --line: #EADFD5;
  --soft: #F6EFE7;
  --ok: #1E7A4C;
  --bad: #B42318;
  --head-bg: var(--brand);
  --head-ink: var(--brand-ink);
  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --display-weight: 400;
  --r: 12px;
  --r-btn: 999px;
  --h2-line: 2px solid var(--ink);
  --item-line: 1px dashed var(--line);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-tema="elegante"]) {
    --bg: #15110F; --surface: #1E1916; --ink: #F4EDE6; --muted: #B3A69B; --line: #3A302A; --soft: #241D19;
    --ok: #4FC48A; --bad: #FF8A7A; --link: color-mix(in srgb, var(--brand) 65%, white);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15110F; --surface: #1E1916; --ink: #F4EDE6; --muted: #B3A69B; --line: #3A302A; --soft: #241D19;
  --ok: #4FC48A; --bad: #FF8A7A; --link: color-mix(in srgb, var(--brand) 65%, white);
  color-scheme: dark;
}

/* Moderno: bianco pulito, caratteri senza grazie, intestazione chiara */
:root[data-tema="moderno"] {
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #17171C; --muted: #5A5A66; --line: #E6E6EB; --soft: #F4F4F6;
  --head-bg: var(--soft); --head-ink: var(--ink);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --display-weight: 800; --r: 16px; --r-btn: 12px; --h2-line: 0; --item-line: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="moderno"]:not([data-theme="light"]) { --bg: #0F0F12; --surface: #18181D; --ink: #F3F3F6; --muted: #A4A4B0; --line: #2C2C34; --soft: #1D1D23; }
}
/* Trattoria: carta calda, grazie classiche, intestazione scura */
:root[data-tema="rustico"] {
  --bg: #F7F0E1; --surface: #FFFAF0; --ink: #2B2118; --muted: #6E5D4B; --line: #DDCDAF; --soft: #EFE4CC;
  --head-bg: #2B2118; --head-ink: #F7F0E1;
  --font-display: "Alegreya", Georgia, "Times New Roman", serif;
  --font-body: "Alegreya Sans", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --display-weight: 800; --r: 6px; --r-btn: 6px; --h2-line: 1px solid var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root[data-tema="rustico"]:not([data-theme="light"]) { --bg: #1B150F; --surface: #241C14; --ink: #F1E6D2; --muted: #BBA88E; --line: #3E3224; --soft: #2A2118; --head-bg: #0F0B07; }
}
/* Elegante: sempre scuro, grazie sottili, oro del colore del locale */
:root[data-tema="elegante"] {
  --bg: #14110F; --surface: #1C1815; --ink: #F2EBE3; --muted: #ABA095; --line: #3A322B; --soft: #221D19;
  --ok: #6FD39E; --bad: #FF9A8A; --link: color-mix(in srgb, var(--brand) 60%, #F2EBE3);
  --head-bg: #0E0C0A; --head-ink: #F2EBE3;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --display-weight: 600; --r: 4px; --r-btn: 2px; --h2-line: 1px solid var(--line); --item-line: 1px solid var(--line);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--display-weight); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.sel { user-select: all; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.salta { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.salta:focus { top: 12px; }

.demo-banner { background: var(--ink); color: var(--bg); text-align: center; font-size: 0.82rem; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); margin: 0; }

/* ------------------------------------------------ intestazione */
.head { background: var(--head-bg); color: var(--head-ink); position: relative; }
.head a { color: inherit; }
.cover { height: clamp(170px, 34vw, 280px); overflow: hidden; background: var(--soft); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.head-in { padding-block: 28px 22px; display: flex; flex-direction: column; gap: 8px; }
.head.con-cover .head-in { padding-top: 0; }
.head.con-cover .logo { margin-top: -38px; }
.brand-row { display: flex; align-items: flex-end; gap: 14px; }
.logo { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; background: var(--surface); border: 3px solid var(--head-bg); flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.brand-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tipo { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.9; }
.head h1 { font-size: clamp(2rem, 7vw, 2.9rem); line-height: 1.05; overflow-wrap: anywhere; }
.slogan { font-size: 1.05rem; opacity: 0.94; max-width: 46ch; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
.addr { opacity: 0.92; font-size: 0.93rem; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--head-ink) 14%, transparent); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 0.88rem; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #F5A97F; }
.pill.open::before { background: #4ADE80; }
.head-links { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; }
.head-links a { border: 1.5px solid color-mix(in srgb, currentColor 55%, transparent); border-radius: var(--r-btn); padding: 6px 13px; font-weight: 600; font-size: 0.86rem; text-decoration: none; }
.head-links a:hover { background: color-mix(in srgb, var(--head-ink) 10%, transparent); }
.head-links a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.btn-line { border: 1.5px solid currentColor; border-radius: var(--r-btn); padding: 7px 14px; font-weight: 600; font-size: 0.9rem; text-decoration: none; display: inline-block; }

:root[data-tema="moderno"] .head { border-bottom: 1px solid var(--line); }
:root[data-tema="moderno"] .tipo { color: var(--link); opacity: 1; }
:root[data-tema="moderno"] .pill { background: var(--surface); border: 1px solid var(--line); }
:root[data-tema="rustico"] .head-in { text-align: center; align-items: center; }
:root[data-tema="rustico"] .brand-row { flex-direction: column; align-items: center; }
:root[data-tema="rustico"] .head-row, :root[data-tema="rustico"] .head-links { justify-content: center; }
:root[data-tema="rustico"] .tipo { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 1.05rem; font-weight: 500; }
:root[data-tema="rustico"] .tipo::before, :root[data-tema="rustico"] .tipo::after { content: " — "; opacity: 0.6; }
:root[data-tema="elegante"] .head-in { padding-block: 40px 30px; }
:root[data-tema="elegante"] .tipo { letter-spacing: 0.32em; font-weight: 500; color: var(--link); opacity: 1; }
:root[data-tema="elegante"] .head h1 { font-size: clamp(2.5rem, 9vw, 3.8rem); font-weight: 500; letter-spacing: 0; }
:root[data-tema="elegante"] .slogan { font-family: var(--font-display); font-style: italic; font-size: 1.25rem; }
:root[data-tema="elegante"] .pill { background: transparent; border: 1px solid var(--line); }
:root[data-tema="elegante"] .logo { border-radius: 50%; }

/* ------------------------------------------------ striscia avvisi e promozioni */
.strip { background: var(--soft); border-bottom: 1px solid var(--line); }
.strip-in { padding-block: 12px; display: flex; flex-direction: column; gap: 8px; }
.avviso { font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.avviso::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); transform: translateY(-1px); }
.promo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.93rem; color: var(--muted); }
.promo-list b { color: var(--ink); }
.promo-list li.giorno b { color: var(--link); }
.badge { display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; background: var(--brand); color: var(--brand-ink); border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.intro { padding-top: 18px; color: var(--muted); font-size: 1.02rem; max-width: 760px; }
:root[data-tema="elegante"] .intro { font-family: var(--font-display); font-size: 1.2rem; font-style: italic; text-align: center; }

.notice { margin-top: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 0.93rem; }

/* ------------------------------------------------ categorie e ricerca */
.cats { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-top: 14px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 6; background: var(--bg); }
.cats-in { display: flex; align-items: center; gap: 8px; padding-block: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; scroll-behavior: smooth; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-btn); padding: 7px 14px; font-weight: 600; font-size: 0.9rem; transition: background .15s, color .15s; }
.chips a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips a:focus-visible, .cerca-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cerca-btn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.cerca { flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; }
.cerca input { flex: 1; min-width: 0; font: 500 1rem var(--font-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.cerca input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.vuoto { color: var(--muted); padding-block: 20px; }

/* ------------------------------------------------ menu */
.menu { padding-block: 4px 30px; display: flex; flex-direction: column; gap: 8px; }
.menu:focus { outline: none; }
.loading { color: var(--muted); padding: 30px 0; }
.skeleton { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.skeleton i { display: block; height: 64px; border-radius: var(--r); background: linear-gradient(90deg, var(--soft), var(--surface), var(--soft)); background-size: 200% 100%; animation: luce 1.2s linear infinite; }
@keyframes luce { to { background-position: -200% 0; } }
.cat { scroll-margin-top: 70px; padding-top: 24px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: var(--h2-line); }
.cat h2 { font-size: 1.55rem; }
.cat-promo { font-size: 0.78rem; font-weight: 800; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 3px 10px; }
.cat-desc { color: var(--muted); font-size: 0.93rem; padding-top: 8px; }
.cat-orari { color: var(--link); font-size: 0.85rem; font-weight: 600; padding-top: 6px; }
.cat.fuori .item { opacity: 0.6; }
:root[data-tema="moderno"] .cat h2 { font-size: 1.4rem; letter-spacing: -0.02em; }
:root[data-tema="moderno"] .cat-head::after { content: ""; display: block; width: 100%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) 0 48px, var(--line) 48px); margin-top: 8px; }
:root[data-tema="rustico"] .cat-head { justify-content: center; text-align: center; border-bottom: 0; }
:root[data-tema="rustico"] .cat h2 { font-size: 1.8rem; font-style: italic; }
:root[data-tema="rustico"] .cat h2::before, :root[data-tema="rustico"] .cat h2::after { content: " ~ "; color: var(--link); font-style: normal; }
:root[data-tema="rustico"] .cat-desc, :root[data-tema="rustico"] .cat-orari { text-align: center; }
:root[data-tema="elegante"] .cat h2 { font-size: 2rem; font-weight: 500; text-align: center; width: 100%; }
:root[data-tema="elegante"] .cat-head { justify-content: center; border-bottom: 0; }
:root[data-tema="elegante"] .cat-head::after { content: ""; width: 40px; height: 1px; background: var(--brand); margin: 6px auto 0; flex-basis: 100%; max-width: 40px; }

.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 16px 0; border-bottom: var(--item-line); }
.item-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item-name { font-family: var(--font-body); font-weight: 700; font-size: 1.04rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; letter-spacing: 0; }
.item-open { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.item-open:hover { text-decoration-color: currentColor; }
.item-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
:root[data-tema="elegante"] .item-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
:root[data-tema="rustico"] .item-name { font-family: var(--font-display); font-size: 1.18rem; }
.tag { font-family: var(--font-body); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.tag-piccante { color: var(--bad); border-color: currentColor; }
.tag-vegana, .tag-vegetariana { color: var(--ok); border-color: currentColor; }
.tag-top { color: var(--link); border-color: currentColor; }
.item-desc { color: var(--muted); font-size: 0.93rem; }
.item-opz { color: var(--muted); font-size: 0.82rem; font-style: italic; }
.item-all { color: var(--muted); font-size: 0.78rem; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 2px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; gap: 10px; }
.item.con-foto .item-side { justify-content: flex-start; }
.item-foto { all: unset; cursor: pointer; display: block; width: 96px; height: 96px; border-radius: calc(var(--r) - 2px); overflow: hidden; background: var(--soft); }
.item-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.item-foto:hover img { transform: scale(1.04); }
.item-foto:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (min-width: 640px) { .item-foto { width: 120px; height: 120px; } }
.item.off { opacity: 0.55; }
.non-ora { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.add { font: 700 0.9rem var(--font-body); background: var(--surface); color: var(--link); border: 1.5px solid var(--brand); border-radius: var(--r-btn); padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.add:hover { background: var(--soft); }
.add:focus-visible, .step button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.step { display: inline-flex; align-items: center; border: 1.5px solid var(--brand); border-radius: var(--r-btn); overflow: hidden; background: var(--surface); }
.step button { width: 34px; height: 34px; border: 0; background: var(--brand); color: var(--brand-ink); font: 700 1.1rem var(--font-body); cursor: pointer; }
.step button:disabled { opacity: 0.4; cursor: default; }
.step output { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.step.big { border-radius: 14px; flex: none; }
.step.big button { width: 44px; height: 48px; font-size: 1.3rem; }
.step.big output { min-width: 38px; font-size: 1.1rem; }

.allergeni { padding-block: 24px 10px; display: flex; flex-direction: column; gap: 10px; }
.allergeni h2 { font-size: 1.25rem; }
.allergeni p { color: var(--muted); font-size: 0.9rem; }
.all-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; font-size: 0.88rem; }
.all-list b { display: inline-block; min-width: 1.6em; font-variant-numeric: tabular-nums; }

.foot { padding-block: 24px 120px; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 20px; }
.social { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; }

/* ------------------------------------------------ barra del carrello e avvisi brevi */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.cartbar-btn { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 728px; margin: 0 auto; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 14px; padding: 13px 16px; font: 600 1rem var(--font-body); cursor: pointer; box-shadow: 0 10px 26px rgba(0, 0, 0, .22); }
.cartbar-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.cartbar-n { min-width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-ink) 20%, transparent); font-weight: 800; font-variant-numeric: tabular-nums; }
.cartbar-go { flex: 1; text-align: left; }
.cartbar-btn b { font-variant-numeric: tabular-nums; }
.cartbar.bump .cartbar-btn { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.03); } }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; max-width: min(92vw, 520px); background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 16px; font-size: 0.92rem; font-weight: 600; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }
@media (prefers-reduced-motion: reduce) { .cartbar.bump .cartbar-btn, .skeleton i { animation: none; } .item-foto img { transition: none; } }

/* ------------------------------------------------ fogli a comparsa */
.sheet { width: min(640px, 100%); max-width: 100%; max-height: 92vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet[open] { animation: sale .22s ease-out; }
@keyframes sale { from { transform: translateY(24px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet::backdrop { background: rgba(20, 12, 8, .55); }
.sheet form { padding: 20px max(18px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 1.5rem; }
.x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* scheda del piatto */
.piatto form { padding-top: 0; }
.p-foto { margin: 0 calc(-1 * max(18px, env(safe-area-inset-left, 0px))) 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); border-radius: 20px 20px 0 0; }
.p-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.piatto .sheet-head { padding-top: 20px; }
.p-desc { color: var(--muted); }
.p-meta { font-size: 0.85rem; color: var(--muted); }
.p-gruppi { display: flex; flex-direction: column; gap: 14px; }
.gruppo { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gruppo legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 0 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.gruppo legend b { font-size: 1rem; }
.gruppo legend small { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.gruppo input { position: absolute; opacity: 0; pointer-events: none; }
.gruppo label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 40px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; position: relative; }
.gruppo label::before { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border: 2px solid var(--muted); border-radius: 50%; background: var(--surface); }
.gruppo input[type="checkbox"] + label::before { border-radius: 5px; }
.gruppo input:checked + label { border-color: var(--brand); background: var(--soft); }
.gruppo input:checked + label::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.gruppo input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.gruppo input:disabled + label { opacity: 0.45; cursor: not-allowed; }
.op-prezzo { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.p-act { display: flex; gap: 10px; align-items: stretch; position: sticky; bottom: 0; background: var(--surface); padding-top: 6px; }
.p-act .submit { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline: 12px; font-size: 1rem; }

/* ordine */
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.line.vuota { display: block; color: var(--muted); }
.sheet .line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nome tot" "nome step" "nota nota"; align-items: start; }
.sheet .line .line-name { grid-area: nome; }
.sheet .line .step { grid-area: step; justify-self: end; }
.sheet .line .line-tot { grid-area: tot; }
.sheet .line .line-nota { grid-area: nota; }
.line-nota { grid-column: 1 / -1; width: 100%; font: 400 0.88rem var(--font-body); color: var(--ink); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 7px 10px; }
.line-nota:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-style: solid; }
.line-name { font-weight: 600; display: flex; flex-direction: column; }
.line-var { font-weight: 400; color: var(--muted); font-size: 0.84rem; }
.line-tot { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.totals { display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.t-disc { color: var(--ok); }
.t-tot { font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.warn { background: var(--soft); border-left: 3px solid var(--brand); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; }
.fs { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fs legend { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.15rem; margin-bottom: 4px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field select, .field textarea { width: 100%; font: 500 1rem var(--font-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay label { display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.pay label small { color: var(--muted); font-size: 0.82rem; }
.pay input:checked + label { border-color: var(--brand); background: var(--soft); }
.pay input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.pay input:disabled + label { opacity: 0.5; cursor: not-allowed; }
.privacy-note { font-size: 0.8rem; color: var(--muted); }
.err { color: var(--bad); font-weight: 600; font-size: 0.93rem; }
.submit { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 14px; padding: 15px 16px; font: 700 1.05rem var(--font-body); cursor: pointer; }
.submit:disabled { opacity: 0.55; cursor: not-allowed; }
.submit:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
:root[data-tema="elegante"] .submit, :root[data-tema="elegante"] .cartbar-btn { border-radius: var(--r-btn); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.95rem; }

/* ------------------------------------------------ ritiro o consegna */
.modo { padding-block: 16px 4px; display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 5px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: center; }
.seg label small { color: var(--muted); font-size: 0.8rem; }
.seg input:checked + label { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg input:checked + label b { color: var(--link); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg input:disabled + label { opacity: 0.45; cursor: not-allowed; }
.seg.solo { grid-template-columns: 1fr; }
.seg-small label { padding: 9px; }
.capcheck { display: flex; flex-direction: column; gap: 6px; }
.capcheck label { font-weight: 700; font-size: 0.92rem; }
.capcheck-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.capcheck input { width: 8.5em; font: 600 1rem var(--font-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; letter-spacing: 0.08em; }
.capcheck input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.capcheck .hint { flex: 1; min-width: 200px; }

/* riordina */
.riordina { padding-top: 14px; }
.ri-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.ri-t { font-weight: 700; }
.ri-d { color: var(--muted); font-size: 0.9rem; }

/* ordina scrivendo */
.ai { padding-top: 14px; }
.ai-form { display: flex; flex-direction: column; gap: 6px; }
.ai-form label { font-weight: 700; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.ai-form label::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: conic-gradient(from 200deg, var(--brand), #F59E0B, var(--brand)); }
.ai-row { display: flex; gap: 8px; }
.ai-row input { flex: 1; min-width: 0; font: 500 1rem var(--font-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.ai-row input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ai-row button { flex: none; font: 700 0.95rem var(--font-body); background: var(--ink); color: var(--bg); border: 0; border-radius: 12px; padding: 0 16px; cursor: pointer; }
.ai-row button:disabled { opacity: 0.6; cursor: progress; }
.ai-out { margin-top: 10px; background: var(--surface); border: 1.5px solid var(--brand); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ai-lines li { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.ai-lines small { color: var(--muted); }
.ai-act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.link { background: none; border: 0; color: var(--muted); font: 600 0.9rem var(--font-body); text-decoration: underline; cursor: pointer; padding: 6px 2px; }

/* modulo */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 0.85rem; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--bad); }
.item-nota { color: var(--muted); font-size: 0.82rem; }

/* ------------------------------------------------ pagina dell'ordine */
.conf { padding-block: 28px 60px; display: flex; flex-direction: column; gap: 18px; }
.conf-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.conf-num { font-family: var(--font-display); font-size: clamp(2.6rem, 12vw, 4rem); line-height: 1; }
.conf-state { font-weight: 700; font-size: 1.15rem; }
.conf-state.ok { color: var(--ok); }
.conf-state.bad { color: var(--bad); }
.conf-meta { color: var(--muted); }
.conf .btn-line { color: var(--link); align-self: flex-start; }
.conf-grazie { font-family: var(--font-display); font-size: 1.15rem; }
.ritardo { background: var(--soft); border-left: 3px solid var(--brand); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.notifiche { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.notifiche p { font-size: 0.92rem; }
.notifiche .add { background: var(--brand); color: var(--brand-ink); }
.contatti { display: flex; gap: 8px; flex-wrap: wrap; }
.contatti a { color: var(--link); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulsa 1.6s ease-in-out infinite; }
.live.off::before { background: var(--muted); animation: none; }
.head-logo { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; border: 2px solid var(--head-bg); }

/* avanzamento ordine */
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.track li { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.track li::before { content: ""; height: 6px; border-radius: 3px; background: var(--line); }
.track li.fatto::before { background: var(--brand); }
.track li.ora { color: var(--ink); font-weight: 700; }
.track li.ora::before { background: var(--brand); animation: pulsa 1.4s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .track li.ora::before, .live::before { animation: none; } }

/* app installabile */
.app-wrap { padding-top: 14px; }
.app-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 12px; }
.app-banner img { border-radius: 10px; display: block; }
.app-banner p { display: flex; flex-direction: column; font-size: 0.88rem; line-height: 1.3; }
.app-banner p span { color: var(--muted); }
.app-ok { font: 700 0.9rem var(--font-body); background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.app-ok:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.app-banner .x { width: 34px; height: 34px; font-size: 1.2rem; }

/* ingredienti tolti: si vedono subito */
.line-senza { color: var(--bad); font-weight: 700; }
.gruppo.ingr input + label span { transition: color .15s; }
.gruppo.ingr input:not(:checked) + label span { text-decoration: line-through; color: var(--bad); }
.gruppo.ingr input:not(:checked) + label { border-style: dashed; }

/* prenotazioni e liste d'attesa (pagine del cliente) */
.pren-az { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pren-az .submit { flex: 1 1 100%; text-align: center; text-decoration: none; }
.conf .btn-line.danger, .btn-line.danger { color: var(--bad); background: transparent; cursor: pointer; font: 600 0.9rem var(--font-body); }
.conf .pren-az .btn-line { cursor: pointer; background: transparent; }
.pr-persone { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pr-persone output { min-width: 44px; font-size: 1.3rem; }
.pr-giorni { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.pr-giorni button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 0.8rem var(--font-body); cursor: pointer; }
.pr-giorni button b { font-size: 1.25rem; }
.pr-giorni button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.pr-orari { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.pr-orari button { min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1rem var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.pr-orari button:disabled { background: var(--soft); color: var(--muted); text-decoration: line-through; cursor: not-allowed; opacity: 0.75; }
.pr-orari button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.pr-orari button:focus-visible, .pr-giorni button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pr-attesa { display: flex; flex-direction: column; gap: 12px; background: var(--soft); border-radius: 12px; padding: 12px; }
.pr-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.pr-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.att-box { display: flex; flex-direction: column; gap: 10px; background: var(--soft); border-left: 3px solid var(--brand); border-radius: 10px; padding: 12px; }
.att-box p { font-weight: 600; font-size: 0.93rem; }
.conf-num.pren-quando { font-size: clamp(1.7rem, 8vw, 2.6rem); }
.head-links a.pren-btn { background: var(--head-ink); color: var(--head-bg); border-color: var(--head-ink); }
