*{box-sizing:border-box}
[x-cloak]{display:none!important}
:root{--bg:#fff;--soft:#f2f2f2;--text:#1d1d1d;--muted:#6b6b6b;--line:#e8e8e8;--ok:#15803d;--warn:#b45309;--danger:#c62828;--radius:16px}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:var(--bg);color:var(--text);font-size:16px;line-height:1.4;padding-bottom:110px;-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer;color:inherit}
input{font:inherit;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--text)}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Intestazione fissa: nome del locale, azioni e categorie */
.top{position:sticky;top:0;z-index:10;background:rgba(255,255,255,.96);backdrop-filter:saturate(180%) blur(12px);-webkit-backdrop-filter:saturate(180%) blur(12px);padding-top:env(safe-area-inset-top)}
.top-row{display:flex;align-items:center;gap:12px;padding:12px 16px 8px;max-width:760px;margin:0 auto}
.logo{width:44px;height:44px;flex:none;border-radius:50%;object-fit:cover;background:var(--soft);border:1px solid var(--line)}
.title{flex:1;min-width:0}
.title h1{margin:0;font-size:1.2rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sub{display:flex;gap:6px;align-items:center;margin:2px 0 0;color:var(--muted);font-size:.85rem;white-space:nowrap;overflow:hidden}
.sub:empty{display:none}
.sub span+span::before{content:"·";margin-right:6px}
.badge{color:var(--brand);font-weight:700}
.sub .badge+span::before{color:var(--muted)}
.pill-actions{display:flex;flex:none;border:1px solid var(--line);border-radius:99px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.pill-actions button{position:relative;display:flex;align-items:center;justify-content:center;width:46px;height:42px;border:0;background:none;border-radius:99px}
.pill-actions button.on{color:var(--brand)}
.dot{position:absolute;top:5px;right:6px;min-width:17px;height:17px;padding:0 4px;border-radius:99px;background:var(--brand);color:#fff;font-size:.7rem;font-weight:700;line-height:17px;text-align:center}
.search{padding:0 16px 8px;max-width:760px;margin:0 auto}
.search input{width:100%;background:var(--soft);border-color:transparent}
.tabs{display:flex;gap:26px;overflow-x:auto;padding:0 16px;max-width:760px;margin:0 auto;border-bottom:3px solid var(--line);scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs a{position:relative;flex:none;padding:10px 0 12px;color:var(--text);text-decoration:none;font-size:1.02rem;white-space:nowrap}
.tabs a.on{font-weight:700}
.tabs a.on::after{content:"";position:absolute;left:-4px;right:-4px;bottom:-3px;height:4px;border-radius:4px;background:var(--text)}

.notice{max-width:728px;margin:14px auto 0;padding:10px 12px;border-radius:12px;background:#fff7ed;color:#9a3412;font-size:.9rem}
body>.notice{margin:14px 16px 0}
@media (min-width:760px){body>.notice{margin:14px auto 0}}
.sheet .notice{margin:12px 0}

/* Piatti */
main{padding:0 16px;max-width:760px;margin:0 auto}
.category{padding-top:8px}
.category h2{margin:22px 0 4px;font-size:1.65rem;font-weight:800;letter-spacing:-.01em}
.sub-title{margin:22px 0 2px;font-size:1.15rem;font-weight:700}
.cat-desc{margin:2px 0 6px;color:var(--muted);font-size:.9rem}
.product{display:flex;gap:16px;padding:18px 0;border-bottom:1px solid var(--line);cursor:pointer}
.photo{width:120px;height:120px;flex:none;border-radius:var(--radius);object-fit:cover;background:var(--soft)}
.info{flex:1;min-width:0;display:flex;flex-direction:column}
.head{display:flex;align-items:flex-start;gap:10px}
.head h4{flex:1;margin:0;font-size:1.08rem;font-weight:500;line-height:1.3}
.price{flex:none;font-size:1.02rem;font-weight:500}
.tags{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.tag{padding:2px 8px;border-radius:6px;background:var(--soft);color:var(--text);font-size:.78rem;font-weight:600}
.tag-vegano,.tag-vegetariano{background:#e6f4ea;color:#1e7a3a}
.tag-senza_glutine{background:#fff4d6;color:#8a5a00}
.tag-piccante{background:#fde4e4;color:#c62828}
.tag-surgelato{background:#e3f0fb;color:#1d5f9e}
.tag.out{background:var(--danger);color:#fff}
.desc{margin:8px 0 0;color:#3d3d3d;font-size:.95rem;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.allergens{margin:6px 0 0;font-size:.78rem;color:var(--muted)}
.foot{display:flex;align-items:flex-end;gap:10px;margin-top:auto;padding-top:6px}
.foot .allergens{flex:1;margin:0 0 4px}
.plus{display:flex;align-items:center;gap:6px;height:44px;min-width:44px;justify-content:center;padding:0 11px;border:0;border-radius:99px;background:var(--soft);transition:background .15s,transform .1s}
.plus:active{transform:scale(.92)}
.plus.in{background:var(--brand);color:#fff;font-weight:700}
.soldout .photo,.soldout .head,.soldout .desc{opacity:.45}
.empty,.footnote{color:var(--muted);text-align:center;font-size:.85rem;margin:28px 0}
.link{border:0;background:none;color:var(--brand);text-decoration:underline;padding:0;font-size:.9rem}

/* Barra in basso */
.bottom-bar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;align-items:center;gap:12px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:#fff;box-shadow:0 -1px 0 var(--line),0 -6px 20px rgba(0,0,0,.05)}
.total{flex:1;display:flex;flex-direction:column;min-width:0}
.total strong{font-size:1.25rem;font-weight:800}
.total span{color:var(--muted);font-size:.82rem}
.cart-btn{display:flex;align-items:center;gap:10px;padding:14px 18px 14px 26px;border:0;border-radius:99px;background:var(--brand);color:#fff;font-size:1.1rem;font-weight:700}
.orders-btn{display:flex;align-items:center;gap:6px;padding:12px 16px;border:1px solid var(--line);border-radius:99px;background:#fff;font-weight:600;font-size:.92rem}
.orders-btn.alone{flex:1;justify-content:center;padding:15px}
.primary{padding:15px;border:0;border-radius:99px;background:var(--brand);color:#fff;font-weight:700;font-size:1.02rem}
.primary:disabled{opacity:.6}
.ghost{padding:15px 22px;border:1px solid var(--line);border-radius:99px;background:#fff;font-weight:600}
.wide{width:100%;margin-top:16px}

/* Finestre dal basso */
.overlay{position:fixed;inset:0;z-index:30;display:flex;align-items:flex-end;background:rgba(0,0,0,.45)}
.sheet{position:relative;width:100%;max-width:640px;margin:0 auto;max-height:90vh;overflow-y:auto;padding:18px 16px calc(18px + env(safe-area-inset-bottom));background:#fff;border-radius:22px 22px 0 0}
.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.sheet-head h2{margin:0;font-size:1.3rem;font-weight:800}
.close{border:0;background:var(--soft);width:38px;height:38px;border-radius:50%;font-size:1rem}
.filters-title{margin:16px 0 8px;font-size:.9rem;color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{padding:8px 13px;border-radius:99px;border:1px solid var(--line);background:#fff;font-size:.9rem}
.chip.on{background:var(--text);border-color:var(--text);color:#fff}
.sheet-actions{display:flex;gap:10px;margin-top:22px}
.sheet-actions .primary{flex:1}
.line,.order{padding:14px 0;border-bottom:1px solid var(--line)}
.line-top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.line-bottom{display:flex;gap:8px;margin-top:10px;align-items:center}
.line-bottom input{flex:1;min-width:0}
.qty{display:flex;align-items:center;gap:10px;padding:3px;border-radius:99px;background:var(--soft)}
.qty button{width:34px;height:34px;border-radius:50%;border:0;background:#fff;font-size:1.1rem;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.field{width:100%;margin-top:12px}
.field-label{display:block;margin-top:14px;font-size:.9rem;font-weight:600}
.field-label .field{margin-top:6px}
.error{color:var(--danger);font-size:.9rem;margin:12px 0 0}
.hint{text-align:center;color:var(--muted);font-size:.8rem;margin:10px 0 0}
.order ul{margin:6px 0 0;padding-left:18px;font-size:.92rem}
.status{font-size:.75rem;font-weight:700;padding:3px 9px;border-radius:99px;background:var(--soft);white-space:nowrap}
.status.pending{background:#fef3c7;color:var(--warn)}
.status.preparing{background:#dbeafe;color:#1d4ed8}
.status.served{background:#dcfce7;color:var(--ok)}
.status.cancelled{background:#fee2e2;color:var(--danger);text-decoration:line-through}
.totals{padding-top:12px}
.totals div{display:flex;justify-content:space-between;margin:4px 0}
.grand{font-size:1.1rem}

/* Scheda del piatto */
.detail{padding:0 0 calc(18px + env(safe-area-inset-bottom))}
.detail-photo{display:block;width:100%;aspect-ratio:1/1;max-height:56vh;object-fit:cover;background:var(--soft)}
.detail-body{padding:18px 16px 0}
.detail-body h3{margin:0 40px 4px 0;font-size:1.45rem;font-weight:800}
.detail-photo~.detail-body h3{margin-right:0}
.detail-price{font-size:1.1rem}
.detail-desc{margin:12px 0 0;color:#3d3d3d}
.detail-close{position:absolute;top:12px;right:12px;z-index:1;background:rgba(255,255,255,.92);box-shadow:0 1px 4px rgba(0,0,0,.15)}
.soldout-note{margin:16px 0 0;color:var(--danger);font-weight:600}

.toast{position:fixed;left:50%;bottom:100px;transform:translateX(-50%);z-index:40;padding:10px 16px;border-radius:99px;background:#1d1d1d;color:#fff;font-size:.9rem;max-width:90vw;text-align:center}
