/* Mesa VIVA — menu do cliente. Leve (sem bibliotecas), legível ao sol, para telemóvel.
   A cor vem do restaurante (--brand); o resto é neutro e quente. */
@font-face { font-family: 'Fraunces'; font-weight: 500; font-display: swap; src: url('../fonts/fraunces-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url('../fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url('../fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #f7f3ea; --card: #fff; --text: #1d2420; --muted: #6b7570; --line: #e8e0cf;
  --ok: #2d7a57; --bad: #b3261e; --warn: #9a5d0c;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Instrument Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--sans); padding-bottom: calc(96px + var(--safe)); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.hero { background: var(--brand); color: var(--on-brand); padding: 26px 18px 34px; position: relative; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 16px; background: var(--bg); border-radius: 16px 16px 0 0; }
.hero-in { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.hero .name { font: 500 clamp(26px, 7vw, 38px)/1.05 var(--display); margin: 0; letter-spacing: -.02em; }
.hero .logo { max-height: 56px; max-width: 60%; object-fit: contain; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 30px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #e3a83b; }
.chip .dot.on { background: #6fdc9f; box-shadow: 0 0 0 3px rgba(111, 220, 159, .25); }

.banners { max-width: 980px; margin: 0 auto; padding: 0 14px; }
.banner { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 11px 14px; border-radius: 10px; font-size: 14.5px; margin: 8px 0; }
.banner.warn { border-left-color: #e3a83b; background: #fff8ea; }
.banner.bad { border-left-color: var(--bad); background: #fdf0ef; }
.banner.ok { border-left-color: var(--ok); }
.banner button { border: 0; background: none; color: var(--brand); font-weight: 600; text-decoration: underline; padding: 0; margin-left: 4px; }

.cats { position: sticky; top: 0; z-index: 5; background: rgba(247, 243, 234, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; color: var(--text); padding: 7px 14px; border-radius: 20px; font-size: 14.5px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.cats a.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.menu { max-width: 980px; margin: 0 auto; padding: 6px 14px 20px; }
.sec { padding-top: 14px; }
.sec h2 { font: 500 23px/1.2 var(--display); margin: 10px 2px 12px; letter-spacing: -.01em; }
.items { display: grid; gap: 10px; }
@media (min-width: 760px) { .cols-2 .items { grid-template-columns: 1fr 1fr; } .cols-3 .items { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1020px) { .cols-3 .items { grid-template-columns: 1fr 1fr 1fr; } }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.item .top { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 8px; }
.item .top:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.item .txt { flex: 1; min-width: 0; }
.item h3 { font-size: 16.5px; font-weight: 600; margin: 0 0 3px; line-height: 1.3; }
.item p { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .ph { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex: none; background: var(--line); }
/* preço à esquerda, botão sempre encostado à direita: com ou sem foto, ficam alinhados em toda a lista */
.item .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; }
.item .price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item.off { opacity: .55; }
.item .na { font-size: 13px; color: var(--bad); font-weight: 600; }
.item.in { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* ficha do prato */
.item-sheet { padding: 0 0 calc(18px + var(--safe)); overflow-x: hidden; overflow-y: auto; position: relative; }
.item-sheet .big { background: var(--line); aspect-ratio: 4 / 3; max-height: 52vh; width: 100%; }
.item-sheet .big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-sheet.noimg .big { display: none; }
.item-sheet.noimg .item-body { padding-top: 54px; }
.item-sheet .x.float { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.item-body { padding: 18px 18px 0; }
.item-body h2 { font: 500 25px/1.15 var(--display); margin: 0 0 8px; }
.item-body .desc { color: var(--muted); margin: 0 0 14px; font-size: 15.5px; white-space: pre-line; }
.item-body .desc:empty { display: none; }
.item-foot { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.item-foot .price { font: 500 24px var(--display); font-variant-numeric: tabular-nums; }
.item-step { display: flex; align-items: center; gap: 14px; }
.item-step .qty button { width: 46px; min-height: 46px; font-size: 22px; }
.item-step output { font-size: 18px; min-width: 34px; }
.item-step .in { color: var(--muted); font-size: 14.5px; }

.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { border: 1px solid var(--brand); background: var(--card); color: var(--brand); border-radius: 22px; min-height: 38px; padding: 0 16px; font-weight: 600; font-size: 14.5px; }
.qty .plus { background: var(--brand); color: var(--on-brand); }
.qty.has .plus { width: 38px; padding: 0; font-size: 20px; }
.qty .minus { width: 38px; padding: 0; font-size: 20px; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.emptymenu { text-align: center; padding: 60px 20px; color: var(--muted); }
.emptymenu h2 { font: 500 24px var(--display); color: var(--text); }
.sig { text-align: center; color: var(--muted); font-size: 12.5px; margin: 34px 0 0; letter-spacing: .02em; }

/* barra de baixo */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe)); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); max-width: 980px; margin: 0 auto; }
@media (min-width: 980px) { .dock { border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; } }
.dock-btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; min-width: 62px; }
.dock-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:active { transform: scale(.97); }
.dock-btn.busy { opacity: .5; }
.cart-btn { flex: 1; border: 0; border-radius: 12px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; gap: 10px; padding: 0 14px; font-weight: 600; min-height: 52px; }
.cart-btn:disabled { background: #e6e0d3; color: #857f72; }
.cart-btn .l, .cart-btn .t { white-space: nowrap; }
.cart-btn .n { background: rgba(255,255,255,.22); border-radius: 20px; min-width: 26px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.cart-btn .l { flex: 1; text-align: left; }
.cart-btn .t { font-variant-numeric: tabular-nums; }

/* folhas (bottom sheets) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(20, 24, 22, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { background: var(--card); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 18px calc(20px + var(--safe)); animation: up .18s ease-out; }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet-in { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }
.sheet-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet h2 { font: 500 22px var(--display); margin: 0; }
.sheet .x { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.lines li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines .nm { flex: 1; min-width: 0; }
.lines .nm b { display: block; font-weight: 600; font-size: 15px; }
.lines .nm span { font-size: 13px; color: var(--muted); }
.lines .qty button { min-height: 34px; width: 34px; padding: 0; }
.fld { display: block; margin: 10px 0; }
.fld span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.fld em { font-style: normal; font-weight: 400; color: var(--muted); }
.fld input, .fld textarea { width: 100%; border: 1px solid #d8cfbb; border-radius: 10px; padding: 11px 12px; font: 16px var(--sans); background: #fff; }
.fld input:focus, .fld textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.sum { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; font-size: 15px; }
.sum b { font: 500 26px var(--display); font-variant-numeric: tabular-nums; }
.primary { width: 100%; border: 0; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 16.5px; min-height: 52px; }
.primary:disabled { opacity: .6; }
.link { width: 100%; border: 0; background: none; color: var(--muted); padding: 14px; text-decoration: underline; }
.fine { font-size: 12.5px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.pin { display: flex; gap: 10px; justify-content: center; margin: 18px 0 8px; }
.pin input { width: 58px; height: 66px; text-align: center; font: 500 30px var(--display); border: 1.5px solid #d3c9b3; border-radius: 12px; background: #fff; }
.pin input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.msg { min-height: 1.4em; text-align: center; font-size: 14px; color: var(--bad); margin: 6px 0 12px; }
.done { text-align: center; padding-top: 26px; }
.done .tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 32px; }
.done p { color: var(--muted); margin: 8px 0 18px; }
.mine { list-style: none; margin: 0; padding: 0; }
.mine li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.mine .top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.st { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: #eee; }
.st.novo { background: #fde7eb; color: #a3293f; } .st.preparando { background: #fbecd2; color: #8a5208; } .st.entregue, .st.finalizado { background: #ddefe5; color: #1f5c40; } .st.cancelado { background: #f9dfdc; color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe)); transform: translateX(-50%); background: #1d2420; color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 60; font-size: 14.5px; max-width: calc(100% - 28px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
