/*
  Cardápio público. As cores vêm do restaurante (--p principal, --s fundo do topo, --a destaque)
  e o texto sobre cada uma é calculado no servidor (--pt, --st, --at) para manter contraste.
  Tudo fica visível sem JavaScript; o JS só adiciona o carrinho.
*/
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root { --bg: #fbf8f3; --card: #fff; --text: #1d1a17; --muted: #6a625a; --line: #ece4d8; --serif: "Fraunces", Georgia, serif; --sans: "DM Sans", system-ui, -apple-system, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font: 400 1rem/1.5 var(--sans); color: var(--text); background: color-mix(in srgb, var(--s) 4%, var(--bg)); padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; border-radius: 6px; }

/* Topo */
.top { position: relative; overflow: hidden; background: var(--s); color: var(--st); text-align: center; padding: 2.6rem 1.25rem 2.2rem; }
.top__glow { position: absolute; inset: -40% -20% auto; height: 120%; background:
  radial-gradient(40% 50% at 18% 30%, color-mix(in srgb, var(--s) 55%, #fff), transparent 70%),
  radial-gradient(40% 50% at 85% 65%, color-mix(in srgb, var(--a) 35%, transparent), transparent 70%); opacity: .45; pointer-events: none; }
.top__inner { position: relative; max-width: 640px; margin: 0 auto; }
.top__logo { width: 88px; height: 88px; border-radius: 50%; object-fit: contain; padding: 8px; margin: 0 auto 1rem; background: #fff; border: 3px solid color-mix(in srgb, var(--st) 55%, transparent); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }
.top__logo--initials { display: grid; place-items: center; background: var(--p); color: var(--pt); font: 600 1.6rem var(--serif); }
.top h1 { font: 600 clamp(1.9rem, 1.4rem + 3vw, 2.8rem)/1.05 var(--serif); margin: 0 0 .4rem; letter-spacing: -.01em; }
.top__tag { margin: 0 auto; max-width: 40ch; opacity: .85; }
.status { display: inline-flex; align-items: center; gap: .45rem; margin: 1rem 0 0; padding: .4rem .85rem; border-radius: 99px; font-size: .85rem; font-weight: 700; background: color-mix(in srgb, var(--st) 14%, transparent); }
.status i { width: 8px; height: 8px; border-radius: 50%; }
.status--open i { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, .25); }
.status--closed i { background: #ff6b6b; }

/* Categorias */
.cats { position: sticky; top: 0; z-index: 4; display: flex; align-items: flex-start; gap: .5rem; padding: .6rem .75rem .6rem 1rem; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.cats__track { flex: 1; min-width: 0; display: flex; gap: .4rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 1rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.cats__track::-webkit-scrollbar { display: none; }
.cats a { flex: 0 0 auto; scroll-snap-align: start; display: inline-flex; align-items: center; text-decoration: none; padding: .5rem .95rem; min-height: 40px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.cats__all { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: inherit; cursor: pointer; }
.cats__all[aria-expanded="true"] { background: var(--p); color: var(--pt); border-color: var(--p); }
.cats.is-open .cats__track { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; max-height: 60vh; overflow-y: auto; }
.cats.is-open a { white-space: normal; }
.cats__ic-close, .cats.is-open .cats__ic-open { display: none; }
.cats.is-open .cats__ic-close { display: block; }
@media (min-width: 900px) { .cats { justify-content: center; } .cats__track { flex: 0 1 auto; -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; justify-content: center; } }
@media (max-width: 380px) { .cats a { font-size: .82rem; padding: .45rem .8rem; } }
.cats a:hover, .cats a.is-active { background: var(--p); color: var(--pt); border-color: var(--p); }

.menu { max-width: 680px; margin: 0 auto; padding: 0 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

/* Destaques */
.featured { margin: 1.6rem 0 .4rem; }
.featured h2, .group h2 { font: 400 italic 1.55rem/1.1 var(--serif); color: var(--ink-s); margin: 0 0 .9rem; display: flex; align-items: center; gap: .8rem; }
.featured h2::after, .group h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--a), transparent); }
.featured__row { display: flex; gap: .8rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; scrollbar-width: thin; }
.feat { flex: 0 0 62%; max-width: 240px; scroll-snap-align: start; text-decoration: none; background: var(--card); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.feat img, .feat__ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feat__ph { display: block; background: linear-gradient(135deg, var(--a), var(--p)); }
.feat strong { display: block; padding: .7rem .9rem 0; font: 600 1rem var(--serif); }
.feat span { display: block; padding: 0 .9rem .8rem; font-weight: 700; color: var(--ink); }

/* Itens */
.group { margin-top: 2rem; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.item { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.item__n { font: 400 italic 1.9rem/1 var(--serif); color: transparent; -webkit-text-stroke: 1.2px var(--a); min-width: 2ch; padding-top: .1rem; }
.item__body { min-width: 0; }
.item__name { font: 600 1.12rem/1.2 var(--serif); margin: 0 0 .3rem; }
.type { display: flex; align-items: center; gap: .6rem; margin: 1.3rem 0 .6rem; font: 700 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-s); }
.type::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--a); }
.group h2 + .type { margin-top: .2rem; }
.item p { margin: 0 0 .5rem; color: var(--muted); font-size: .93rem; }
.item__img { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; align-self: start; }
.item--off { opacity: .6; }
.item__foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.price { margin: 0 !important; color: var(--text) !important; font-size: .92rem !important; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .35rem; }
.price strong { display: inline-block; padding: .28rem .7rem; border-radius: 99px; background: var(--a); color: var(--at); font-size: 1rem; white-space: nowrap; }
.price__from, .price__unit { color: var(--muted); font-size: .82rem; }
.price s { color: var(--muted); font-size: .85rem; margin-right: .2rem; }
.no-js button.add { display: none; }
.add { border: 0; cursor: pointer; font-family: var(--sans); }
.add { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 99px; background: var(--p); color: var(--pt); text-decoration: none; font-weight: 700; font-size: .92rem; transition: transform .12s; }
.add:active { transform: scale(.95); }
.add__qty:not(:empty) { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: var(--pt); color: var(--p); font-size: .78rem; }
.soldout { font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.badges { list-style: none; padding: 0; margin: 0 0 .4rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.badge { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; background: color-mix(in srgb, var(--a) 20%, #fff); color: #3a2f1d; }
.badge--picante { background: #ffe1dc; color: #8f1d0c; }
.badge--vegano, .badge--vegetariano { background: #dff3e4; color: #1d5c32; }
.badge--sem-gluten, .badge--sem-lactose { background: #e5eefc; color: #1d3f75; }
@media (max-width: 400px) { .item { grid-template-columns: 1fr auto; } .item__n { display: none; } .item__img { width: 88px; height: 88px; } }

/* Anúncio (plano Gratuito) */
.ad { margin: 1rem 0 0; padding: 1rem 1.1rem; border-radius: 16px; border: 1.5px dashed #cbbfae; background: #fffaf0; font-size: .9rem; }
.ad__tag { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ad p { margin: .3rem 0 .5rem; }
.ad a { font-weight: 700; color: #8a5300; }

.foot { text-align: center; padding: 2.5rem 1rem 1rem; color: var(--muted); font-size: .9rem; }
.foot p { margin: 0 0 .5rem; }
.foot__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.foot__links a { font-weight: 700; color: var(--ink); padding: .5rem 0; }
.foot__brand a { font-size: .8rem; color: var(--muted); }

/* Barra do carrinho */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 90%, transparent) 30%); }
.bar__btn { width: 100%; max-width: 648px; margin: 0 auto; display: flex; align-items: center; gap: .8rem; min-height: 58px; padding: .6rem .7rem .6rem 1.2rem; border: 0; border-radius: 18px; background: var(--s); color: var(--st); font: 500 .95rem var(--sans); cursor: pointer; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45); }
.bar__btn strong { margin-right: auto; }
.bar__go { padding: .6rem 1rem; border-radius: 12px; background: var(--a); color: var(--at); font-weight: 700; }
.bar.bump .bar__btn { animation: bump .35s ease; }
@keyframes bump { 40% { transform: translateY(-4px) scale(1.01); } }

/* Folha do pedido */
.sheet { width: min(640px, 100%); max-width: 100%; max-height: 92vh; inset: auto 0 0 0; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--text); }
.sheet::backdrop { background: rgba(10, 8, 6, .55); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet__inner { padding: 1.2rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet__head h2 { font: 600 1.4rem var(--serif); margin: 0; }
.sheet__close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #f2ece3; font-size: 1.5rem; cursor: pointer; color: var(--text); }
.sheet__warn { background: #fff1ec; color: #8f2a14; padding: .7rem .9rem; border-radius: 12px; font-size: .9rem; }
.lines { list-style: none; margin: .8rem 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.lines .ln-name { font-weight: 700; }
.lines .ln-sub { color: var(--muted); font-size: .88rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 99px; grid-row: span 2; }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.qty span { min-width: 1.6rem; text-align: center; font-weight: 700; }
.sheet__total { display: flex; justify-content: space-between; font-size: 1.1rem; margin: .4rem 0 1rem; }
.f { margin-bottom: .9rem; border: 0; padding: 0; }
.f label, .f legend { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.f input, .f textarea { width: 100%; min-height: 48px; padding: .7rem .9rem; border: 1.5px solid #dcd2c4; border-radius: 12px; font: 400 1rem var(--sans); background: #fffdf9; color: var(--text); }
.f input:focus, .f textarea:focus { border-color: var(--p); outline: 3px solid color-mix(in srgb, var(--p) 25%, transparent); }
.modes { display: flex; gap: .4rem; }
.modes label { flex: 1; position: relative; text-align: center; padding: .7rem .4rem; min-height: 46px; border: 1.5px solid #dcd2c4; border-radius: 12px; cursor: pointer; font-weight: 700; margin: 0; }
.modes input { position: absolute; opacity: 0; }
.modes label:has(input:checked) { background: var(--p); color: var(--pt); border-color: var(--p); }
.modes label:has(input:focus-visible) { outline: 3px solid var(--a); }
.sheet__err { color: #a00f35; font-weight: 700; min-height: 1.2em; margin: 0 0 .4rem; }
.send { width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 56px; border: 0; border-radius: 16px; background: #1f8f4e; color: #fff; font: 700 1.05rem var(--sans); cursor: pointer; }
.send svg { width: 24px; height: 24px; fill: currentColor; }
.sheet__fine { text-align: center; font-size: .8rem; color: var(--muted); margin: .8rem 0 0; }

[hidden] { display: none !important; }
.sheet { overflow-x: hidden; }
fieldset.f { min-width: 0; margin-inline: 0; }
.modes input { width: 1px; height: 1px; min-height: 0; padding: 0; inset: 0; }
/* Preço e botão: com foto, o botão vai para a linha de baixo; sem foto, ficam lado a lado */
.price__from { flex-basis: 100%; }
.item__foot { flex-wrap: nowrap; align-items: flex-end; }
.item--img .item__foot { flex-direction: column; align-items: flex-start; flex-wrap: wrap; }
.item__foot .add { flex: 0 0 auto; }

.mode-one { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .75rem .9rem; border: 1.5px dashed #dcd2c4; border-radius: 12px; }
.mode-one__label { font-size: .85rem; opacity: .75; }
