/* ===== Menù digitale - stile mobile-first (Android & iOS) ===== */
:root{
  --brand:#ec2a33;
  --brand-ink:#fff;
  --bg:#faf7f4;
  --surface:#ffffff;
  --surface-2:#f3eee9;
  --ink:#1c1714;
  --muted:#7a6f68;
  --line:#e9e1da;
  --ok:#10b981;
  --warn:#f59e0b;
  --wa:#25d366;
  --radius:18px;
  --shadow:0 10px 30px -12px rgba(40,20,10,.25);
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#141110;--surface:#1f1a18;--surface-2:#2a2421;--ink:#f5efea;--muted:#a89c94;--line:#352d29;
    --shadow:0 10px 30px -12px rgba(0,0,0,.7);
  }
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;overscroll-behavior-y:none}
body.locked{overflow:hidden}
h1,h2,h3,h4{font-family:Outfit,Inter,system-ui,sans-serif;line-height:1.15;margin:0}
a{color:inherit}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
input,select,textarea{font:inherit;color:var(--ink)}
[hidden]{display:none!important}
.muted{color:var(--muted)}
.center{text-align:center}
.mono{font-family:ui-monospace,Menlo,Consolas,monospace}

/* ---------- HERO ---------- */
.hero{
  background:radial-gradient(120% 80% at 0% 0%,color-mix(in srgb,var(--brand) 85%,#ff8a3d) 0%,var(--brand) 55%,color-mix(in srgb,var(--brand) 70%,#000) 100%);
  color:#fff;padding:calc(18px + var(--safe-t)) 16px 18px;border-radius:0 0 28px 28px;position:relative;overflow:hidden
}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:220px;height:220px;border-radius:50%;background:rgba(255,255,255,.08)}
.hero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;position:relative;z-index:1}
.brand{display:flex;gap:12px;align-items:center;min-width:0}
.brand-logo{width:52px;height:52px;border-radius:16px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-size:28px;flex:none;backdrop-filter:blur(6px)}
.brand h1{font-size:1.45rem;font-weight:800;letter-spacing:-.01em}
.slogan{margin:2px 0 0;opacity:.85;font-size:.9rem}
.hero-actions{display:flex;gap:8px}
.icon-btn{min-width:40px;height:40px;border-radius:12px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-weight:700;font-size:.85rem;padding:0 10px}
.sheet .icon-btn{background:var(--surface-2);color:var(--ink)}
.hero-badges{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0;position:relative;z-index:1}
.badge{display:inline-flex;align-items:center;gap:6px;padding:5px 11px;border-radius:999px;background:rgba(0,0,0,.18);font-size:.8rem;font-weight:600}
.badge .dot{width:8px;height:8px;border-radius:50%;background:#bbb}
.badge-open .dot{background:#4ade80;box-shadow:0 0 0 3px rgba(74,222,128,.3)}
.badge-closed .dot{background:#fca5a5}
.badge-table{background:#fff;color:var(--brand)}
.notice,.alert{margin:12px 0 0;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.16);font-size:.88rem;position:relative;z-index:1}
.alert{background:#fff;color:#b91c1c;font-weight:600}
.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:16px;position:relative;z-index:1}
.quick-btn{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border-radius:14px;background:rgba(255,255,255,.14);color:#fff;text-decoration:none;font-size:.72rem;text-align:center;line-height:1.15;min-height:64px;justify-content:center}
.quick-btn span{font-size:1.35rem}
.quick-btn b{font-weight:600}
.quick-btn.primary{background:#fff;color:var(--brand)}
.quick-btn:active{transform:scale(.96)}

/* ---------- TOOLBAR ---------- */
.toolbar{position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);padding:12px 0 8px;padding-top:calc(12px + var(--safe-t))}
.toolbar.scrolled{border-bottom:1px solid var(--line)}
.search-row{display:flex;gap:8px;padding:0 16px}
.search{flex:1;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:0 12px;height:46px;color:var(--muted)}
.search input{flex:1;border:0;background:none;outline:none;height:100%;font-size:16px;min-width:0}
.filter-btn{width:46px;height:46px;border-radius:14px;background:var(--surface);border:1px solid var(--line);display:grid;place-items:center;position:relative}
.filter-count{position:absolute;top:-6px;right:-6px;background:var(--brand);color:#fff;font-size:.7rem;font-weight:700;min-width:20px;height:20px;border-radius:10px;display:grid;place-items:center;padding:0 5px}
.chips{display:flex;gap:8px;overflow-x:auto;padding:10px 16px 2px;scrollbar-width:none;scroll-snap-type:x proximity}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;padding:8px 14px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:.88rem;font-weight:600;white-space:nowrap;scroll-snap-align:start}
.chip.active{background:var(--ink);color:var(--bg);border-color:var(--ink)}

/* ---------- MENU ---------- */
main{padding:4px 16px calc(120px + var(--safe-b));max-width:860px;margin:0 auto}
.section-title{font-size:1.15rem;margin:18px 0 10px}
.featured-track{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;margin:0 -16px;padding:0 16px 6px;scrollbar-width:none}
.featured-track::-webkit-scrollbar{display:none}
.feat{flex:0 0 78%;max-width:300px;scroll-snap-align:start;border-radius:var(--radius);overflow:hidden;background:var(--surface);box-shadow:var(--shadow);text-align:left;position:relative}
.feat .feat-ph{height:140px}
.feat .feat-body{padding:12px 14px}
.feat h3{font-size:1.05rem}
.feat .price{margin-top:4px}

.cat{margin-top:22px}
.cat-head{display:flex;align-items:baseline;gap:8px;margin-bottom:4px}
.cat-head h2{font-size:1.35rem;font-weight:800}
.cat-desc{margin:0 0 10px;color:var(--muted);font-size:.9rem}
.dish{display:flex;gap:12px;width:100%;text-align:left;padding:12px;margin-bottom:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);position:relative;transition:transform .12s}
.dish:active{transform:scale(.985)}
.dish.off{opacity:.55}
.dish-info{flex:1;min-width:0}
.dish h3{font-size:1.02rem;font-weight:700}
.dish p{margin:3px 0 6px;color:var(--muted);font-size:.86rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.thumb{width:96px;height:96px;flex:none;border-radius:14px;overflow:hidden;position:relative}
.ph{background:linear-gradient(135deg,var(--surface-2),color-mix(in srgb,var(--brand) 14%,var(--surface-2)));display:grid;place-items:center;font-size:2.4rem}
.ph img,.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.add-fab{position:absolute;right:6px;bottom:6px;width:32px;height:32px;border-radius:10px;background:var(--brand);color:#fff;font-size:1.3rem;line-height:1;display:grid;place-items:center;box-shadow:0 4px 12px -4px var(--brand)}
.in-cart{position:absolute;left:6px;top:6px;background:var(--ink);color:var(--bg);font-size:.72rem;font-weight:700;border-radius:8px;padding:2px 7px}
.price{font-weight:700;font-family:Outfit,sans-serif;font-size:1rem;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline}
.price s{color:var(--muted);font-weight:500;font-size:.85rem}
.price .maxi{font-size:.8rem;color:var(--muted);font-weight:600}
.tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.tag{font-size:.7rem;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--ink)}
.tag.consigliata,.tag.offerta{background:color-mix(in srgb,var(--brand) 14%,transparent);color:var(--brand)}
.tag.novita{background:#fef3c7;color:#92400e}
.tag.vegano,.tag.vegetariano{background:#dcfce7;color:#166534}
.tag.piccante{background:#fee2e2;color:#991b1b}
@media (prefers-color-scheme:dark){.tag.novita{background:#422006;color:#fcd34d}.tag.vegano,.tag.vegetariano{background:#052e16;color:#86efac}.tag.piccante{background:#450a0a;color:#fca5a5}}
.al{font-size:.95rem;letter-spacing:1px}
.soldout{display:inline-block;font-size:.72rem;font-weight:700;color:#b91c1c;margin-top:4px}
.empty{text-align:center;padding:40px 0;color:var(--muted)}
mark{background:color-mix(in srgb,var(--brand) 25%,transparent);color:inherit;border-radius:3px}

.foot{margin-top:36px;padding-top:18px;border-top:1px solid var(--line);font-size:.85rem;color:var(--muted);text-align:center}
.foot-links{display:flex;flex-wrap:wrap;gap:14px;justify-content:center}
.link{color:var(--brand);font-weight:600;text-decoration:underline;font-size:.85rem}

/* ---------- CART BAR ---------- */
.cartbar{position:fixed;left:12px;right:12px;bottom:calc(12px + var(--safe-b));z-index:30;max-width:560px;margin:0 auto;display:flex;align-items:center;gap:12px;background:var(--brand);color:#fff;height:58px;border-radius:18px;padding:0 16px;font-weight:700;box-shadow:0 16px 30px -12px var(--brand);animation:pop .3s}
.cartbar-count{background:rgba(255,255,255,.22);min-width:30px;height:30px;border-radius:10px;display:grid;place-items:center}
.cartbar-total{margin-left:auto;font-family:Outfit,sans-serif;font-size:1.1rem}
.cartbar.bump{animation:bump .35s}
.track-pill{position:fixed;right:12px;bottom:calc(82px + var(--safe-b));z-index:29;background:var(--ink);color:var(--bg);padding:10px 14px;border-radius:999px;font-weight:600;font-size:.85rem;box-shadow:var(--shadow)}
body:not(.has-cart) .track-pill{bottom:calc(16px + var(--safe-b))}
@keyframes pop{from{transform:translateY(30px);opacity:0}}
@keyframes bump{50%{transform:scale(1.04)}}

/* ---------- SHEETS ---------- */
.backdrop{position:fixed;inset:0;background:rgba(10,5,2,.45);z-index:40;opacity:0;pointer-events:none;transition:opacity .25s}
.backdrop.show{opacity:1;pointer-events:auto}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:50;max-width:620px;margin:0 auto;background:var(--surface);border-radius:24px 24px 0 0;max-height:88vh;max-height:88dvh;display:flex;flex-direction:column;transform:translateY(105%);transition:transform .32s cubic-bezier(.2,.9,.3,1);box-shadow:0 -10px 40px rgba(0,0,0,.2);visibility:hidden}
.sheet.tall{height:88vh;height:88dvh}
.sheet.open{transform:none;visibility:visible}
.sheet-handle{width:42px;height:5px;border-radius:3px;background:var(--line);margin:8px auto 0;flex:none}
.sheet-head{display:flex;justify-content:space-between;align-items:center;padding:10px 16px 6px;flex:none}
.sheet-head h3{font-size:1.25rem}
.sheet-body{padding:8px 16px 16px;overflow-y:auto;-webkit-overflow-scrolling:touch;flex:1;overscroll-behavior:contain}
.sheet-body h4{margin:18px 0 8px;font-size:.95rem}
.sheet-foot{display:flex;gap:10px;padding:12px 16px calc(12px + var(--safe-b));border-top:1px solid var(--line);flex:none;align-items:center}
.sheet-foot.col{flex-direction:column;align-items:stretch}
.dish-media{height:210px;flex:none;border-radius:24px 24px 0 0;overflow:hidden;margin-top:-13px}
.dish-media.ph{font-size:4.5rem}
#sheetDish h3{font-size:1.4rem;margin-top:6px}
.allergen-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.allergen-list span{font-size:.78rem;padding:4px 9px;border-radius:999px;border:1px solid var(--line)}

.btn{height:52px;border-radius:15px;padding:0 18px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;transition:transform .1s,opacity .2s}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.55}
.btn-primary{background:var(--brand);color:#fff}
.btn-wa{background:var(--wa);color:#063b1d}
.btn-ghost{background:var(--surface-2)}
.btn.full{width:100%;margin-top:12px}
.grow{flex:1}
.qty{display:flex;align-items:center;background:var(--surface-2);border-radius:15px;height:52px}
.qty button{width:44px;height:100%;font-size:1.4rem;font-weight:600}
.qty span{min-width:22px;text-align:center;font-weight:700}

.opt-group{margin-top:16px}
.opt-group > b{display:block;font-size:.9rem;margin-bottom:8px}
.opt{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:14px;margin-bottom:8px}
.opt input{width:20px;height:20px;accent-color:var(--brand)}
.opt span{flex:1}
.opt em{font-style:normal;color:var(--muted);font-size:.9rem}
.opt:has(input:checked){border-color:var(--brand);background:color-mix(in srgb,var(--brand) 6%,transparent)}

.field{display:block;margin-top:12px}
.field > span{display:block;font-size:.82rem;font-weight:600;color:var(--muted);margin-bottom:5px}
.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);background:var(--bg);border-radius:13px;padding:12px;font-size:16px;outline:none;min-height:48px;-webkit-appearance:none;appearance:none}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent)}
.field .invalid,.invalid{border-color:#dc2626!important}
.check{display:flex;gap:10px;align-items:flex-start;margin-top:12px;font-size:.9rem}
.check input{width:20px;height:20px;accent-color:var(--brand);margin-top:2px;flex:none}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.seg{display:flex;background:var(--surface-2);padding:4px;border-radius:14px;gap:4px;margin-top:6px}
.seg label{flex:1}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg span{display:block;text-align:center;padding:10px 6px;border-radius:11px;font-weight:600;font-size:.9rem}
.seg input:checked + span{background:var(--surface);box-shadow:0 2px 8px rgba(0,0,0,.08);color:var(--brand)}
.seg.small span{padding:8px 4px;font-size:.82rem}
.mode-tavolo .only-domicilio,.only-domicilio{display:none}
.is-domicilio .only-domicilio{display:block}

.cart-list{list-style:none;margin:0;padding:0}
.cart-item{display:flex;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);align-items:center}
.cart-item .ci-info{flex:1;min-width:0}
.cart-item b{display:block}
.cart-item small{color:var(--muted);display:block}
.cart-item .qty{height:38px;border-radius:11px}
.cart-item .qty button{width:34px;font-size:1.1rem}
.ci-price{font-weight:700;min-width:64px;text-align:right;font-family:Outfit,sans-serif}
.totals{margin:16px 0 0;padding:12px 14px;background:var(--surface-2);border-radius:14px}
.totals div{display:flex;justify-content:space-between;padding:3px 0}
.totals dt{color:var(--muted)}
.totals dd{margin:0;font-weight:600}
.totals .grand{font-size:1.15rem;padding-top:8px;margin-top:4px;border-top:1px dashed var(--line)}
.totals .grand dt{color:var(--ink);font-weight:700}
.totals .grand dd{font-weight:800;font-family:Outfit,sans-serif}
.form-msg{min-height:1.2em;margin:10px 0 0;font-size:.9rem;font-weight:600;color:#dc2626}
.form-msg.ok{color:var(--ok)}

.call-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.call-grid button{padding:18px 8px;border-radius:16px;background:var(--surface-2);display:flex;flex-direction:column;align-items:center;gap:6px;font-weight:600;font-size:.9rem;text-align:center}
.call-grid button span{font-size:1.8rem}
.call-grid button:active,.call-grid button.sent{background:color-mix(in srgb,var(--brand) 14%,var(--surface-2));color:var(--brand)}

.people{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
.people::-webkit-scrollbar{display:none}
.people button{flex:none;width:48px;height:48px;border-radius:14px;background:var(--surface-2);font-weight:700}
.people button.active{background:var(--brand);color:#fff}

.toggle-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.toggle-grid button{display:flex;align-items:center;gap:8px;padding:11px 12px;border-radius:13px;border:1px solid var(--line);text-align:left;font-size:.88rem;font-weight:500}
.toggle-grid button.on{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 10%,transparent);color:var(--brand);font-weight:700}
.toggle-grid button.on.excl{text-decoration:line-through}

.hours{width:100%;border-collapse:collapse;font-size:.92rem}
.hours th,.hours td{padding:8px 4px;border-bottom:1px solid var(--line);text-align:left}
.hours th{font-weight:500;color:var(--muted)}
.hours tr.today th,.hours tr.today td{color:var(--brand);font-weight:700}
.info-list{list-style:none;padding:0;margin:0}
.info-list li{padding:9px 0;border-bottom:1px solid var(--line)}
.legend{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;font-size:.88rem}
.big{font-size:1.5rem;font-weight:800;margin:2px 0 14px;font-family:Outfit,sans-serif}

.stars{display:flex;justify-content:center;gap:6px;margin:6px 0 4px}
.stars button{font-size:2.4rem;filter:grayscale(1) opacity(.4);transition:transform .15s}
.stars button.on{filter:none;transform:scale(1.08)}

.track-card{border:1px solid var(--line);border-radius:16px;padding:14px;margin-bottom:12px}
.track-card header{display:flex;justify-content:space-between;align-items:center}
.steps{display:flex;gap:6px;margin:14px 0 8px}
.steps i{flex:1;height:6px;border-radius:3px;background:var(--surface-2)}
.steps i.done{background:var(--ok)}
.state{font-weight:700;padding:3px 10px;border-radius:999px;font-size:.8rem;color:#fff}
.success{text-align:center;padding:10px 0}
.success .big-emoji{font-size:3.5rem}

.toast{position:fixed;left:50%;top:calc(14px + var(--safe-t));transform:translate(-50%,-140%);background:var(--ink);color:var(--bg);padding:12px 18px;border-radius:14px;font-weight:600;z-index:90;transition:transform .3s;max-width:90vw;text-align:center;box-shadow:var(--shadow)}
.toast.show{transform:translate(-50%,0)}

@media (min-width:700px){
  .hero{border-radius:0 0 36px 36px;padding-left:max(24px,calc(50% - 414px));padding-right:max(24px,calc(50% - 414px))}
  .search-row,.chips{max-width:860px;margin-left:auto;margin-right:auto}
  .dish-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .dish-grid .dish{margin:0}
  .sheet{bottom:auto;top:50%;border-radius:24px;transform:translateY(-40%) scale(.96);opacity:0;transition:transform .25s,opacity .25s}
  .sheet.open{transform:translateY(-50%);opacity:1}
  .dish-media{margin-top:-13px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
