:root {
    --red: #9e1b14;
    --red-dark: #6f100c;
    --red-soft: #fbe9e5;
    --yellow: #ffc61a;
    --yellow-soft: #fff4cc;
    --cream: #fff9f1;
    --ink: #2a1a14;
    --muted: #7a655c;
    --line: #eedfd3;
    --white: #fff;
    --green: #1f9d55;
    --radius: 16px;
    --shadow: 0 6px 24px rgba(80, 20, 10, .12);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    padding-bottom: 96px;
}

h1, h2, h3, .display { font-family: 'Lilita One', 'Nunito', sans-serif; font-weight: 400; letter-spacing: .3px; }

a { color: var(--red); }

.muted { color: var(--muted); }

/* Topo */
.hero {
    background: radial-gradient(circle at 20% 0%, #c42a1f 0%, var(--red) 45%, var(--red-dark) 100%);
    color: var(--white);
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    padding: 24px max(16px, calc((100% - 760px) / 2)) 26px;
    max-width: 100%;
}

.hero-logo { width: 104px; height: 104px; object-fit: cover; border-radius: 50%; background: #fff; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }

.hero h1 { margin: 0; font-size: 26px; line-height: 1.05; color: var(--yellow); text-shadow: 0 2px 0 rgba(0,0,0,.25); }

.slogan { margin: 4px 0 10px; font-weight: 700; }

.hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
    background: rgba(0,0,0,.25);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
}

.badge-open { background: var(--green); }
.badge-closed { background: #4a4a4a; }

.notice {
    margin: 12px auto 0;
    max-width: 728px;
    width: calc(100% - 32px);
    padding: 12px 14px;
    background: var(--yellow-soft);
    border: 1px solid var(--yellow);
    border-radius: 12px;
    font-weight: 700;
}

.notice-closed { background: #f1e7e4; border-color: #d9c4bd; }

/* Abas de categoria */
.cats {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px max(16px, calc((100% - 760px) / 2));
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.cats::-webkit-scrollbar { display: none; }

.cats a {
    flex-shrink: 0;
    text-decoration: none;
    color: var(--ink);
    font-weight: 800;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
}

.cats a.active { background: var(--red); color: var(--white); border-color: var(--red); }

/* Cardápio */
.menu { max-width: 760px; margin: 0 auto; padding: 8px 16px; }

.cat h2 {
    font-size: 26px;
    color: var(--red);
    margin: 22px 0 2px;
}

.cat > p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

.products { display: grid; gap: 12px; }

@media (min-width: 640px) {
    .products { grid-template-columns: 1fr 1fr; }
}

.product {
    display: flex;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform .12s, box-shadow .12s;
}

.product:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.product[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.product-name { font-weight: 800; font-size: 17px; }

.product-desc {
    color: var(--muted);
    font-size: 13px;
    margin: 2px 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price { margin-top: auto; font-weight: 800; color: var(--red); }

.product-price small { color: var(--muted); font-weight: 600; }

.product-img {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--red-soft);
}

.product-img.placeholder { display: grid; place-items: center; font-size: 40px; }

.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--red-dark);
    margin-bottom: 4px;
    align-self: flex-start;
}

.tag-off { background: #ddd; color: #555; }

/* Rodapé */
.foot { text-align: center; padding: 24px 16px; color: var(--muted); font-size: 14px; }
.foot p { margin: 4px 0; }

/* Barra da sacola */
.cart-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: 728px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--red);
    color: var(--white);
    font: inherit;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(110, 16, 12, .4);
    cursor: pointer;
    z-index: 20;
}

.cart-count {
    background: var(--yellow);
    color: var(--red-dark);
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 14px;
}

/* Painel deslizante (produto, sacola, checkout) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(30, 10, 5, .5); z-index: 30; }

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    max-width: 640px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 22px 22px 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    animation: up .2s ease-out;
}

@media (min-width: 700px) {
    .sheet { bottom: 4vh; border-radius: 22px; max-height: 88vh; }
}

@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }

.sheet-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.sheet-head h3 { margin: 0; font-size: 22px; flex: 1; color: var(--red); }

.icon-btn {
    border: 0;
    background: var(--cream);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.sheet-body { overflow-y: auto; padding: 0 16px 16px; flex: 1; }

.sheet-foot {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: center;
}

.sheet-img { width: calc(100% + 32px); margin: 0 -16px 12px; height: 200px; object-fit: cover; display: block; }

.group { margin-top: 16px; }

.group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream);
    margin: 0 -16px;
    padding: 10px 16px;
}

.group-head strong { display: block; }
.group-head small { color: var(--muted); }

.req { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--white); text-transform: uppercase; }
.req.ok { background: var(--green); }

.opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.opt input { width: 22px; height: 22px; accent-color: var(--red); flex-shrink: 0; }
.opt .opt-name { flex: 1; font-weight: 700; }
.opt .opt-name small { display: block; font-weight: 400; color: var(--muted); }
.opt .opt-price { font-weight: 700; color: var(--muted); white-space: nowrap; }
.opt.disabled { opacity: .5; cursor: not-allowed; }

label.field { display: block; margin-top: 14px; font-weight: 700; font-size: 14px; }

.field input, .field select, .field textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
    background: var(--white);
}

.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); }

.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; }
.qty button { border: 0; background: none; width: 40px; height: 44px; font-size: 22px; color: var(--red); cursor: pointer; font-weight: 800; }
.qty span { min-width: 24px; text-align: center; font-weight: 800; }

.btn {
    flex: 1;
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--red);
    color: var(--white);
    font: inherit;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.btn:disabled { background: #c9b8b2; cursor: not-allowed; }
.btn-center { justify-content: center; }
.btn-green { background: #1fa855; }
.btn-light { background: var(--cream); color: var(--red); }

.cart-item { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 800; }
.cart-item .ci-opts { font-size: 13px; color: var(--muted); }
.cart-item .ci-price { font-weight: 800; white-space: nowrap; }
.cart-item .ci-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.link-btn { border: 0; background: none; color: var(--red); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0; }

.totals { margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 800; font-size: 19px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.choice.three { grid-template-columns: 1fr 1fr 1fr; }

.choice label {
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.choice input { display: none; }
.choice label:has(input:checked) { border-color: var(--red); background: var(--red-soft); color: var(--red); }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); margin: 0; flex-shrink: 0; }

.errors { margin-top: 12px; background: #fde8e6; color: #9b1c12; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.errors:empty { display: none; }

.empty { text-align: center; padding: 40px 0; color: var(--muted); }

/* Página de pedido enviado */
.done { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
.done-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 16px; }
.done h1 { color: var(--red); margin: 8px 0 4px; font-size: 30px; text-align: center; }
.done .center { text-align: center; }
.done-items { margin: 0; padding: 0; list-style: none; }
.done-items li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pix { background: var(--yellow-soft); border: 1px dashed var(--yellow); border-radius: 12px; padding: 12px; margin-top: 12px; word-break: break-all; }

/* Categorias centralizadas quando cabem; com rolagem lateral quando não cabem. */
.cats a:first-child { margin-left: auto; }
.cats a:last-child { margin-right: auto; }

.hero-text { min-width: 0; }

@media (min-width: 700px) {
    .hero { text-align: left; }
    .hero-logo { width: 128px; height: 128px; }
    .hero h1 { font-size: 34px; }
}

/* Celular: logo em cima e textos centralizados. */
@media (max-width: 699px) {
    .hero { flex-direction: column; text-align: center; gap: 10px; }
    .hero-badges { justify-content: center; }
    .slogan { margin-bottom: 12px; }
}

/* Acompanhamento do pedido */
.track-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.live { font-size: 12px; font-weight: 800; color: var(--green); display: inline-flex; align-items: center; gap: 6px; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.5); } 70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; color: var(--muted); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--green); }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); flex-shrink: 0; margin-top: 1px; position: relative; z-index: 1; }
.timeline li.done .tl-dot { background: var(--green); border-color: var(--green); }
.timeline li.done .tl-dot::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 900; position: absolute; inset: 0; display: grid; place-items: center; }
.timeline li.current .tl-dot { border-color: var(--red); background: var(--yellow); box-shadow: 0 0 0 4px rgba(255,198,26,.35); }
.timeline li.done, .timeline li.current { color: var(--ink); }
.tl-label { font-weight: 800; }
.timeline li.current .tl-label { color: var(--red); font-size: 17px; }
.tl-time { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 4px; }
.tl-hint { font-size: 13px; display: none; }
.timeline li.current .tl-hint { display: block; }
.track-canceled { background: #f1e7e4; border-radius: 12px; padding: 12px; font-weight: 700; }

/* Atalho no cardápio para o último pedido */
.track-banner { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: var(--white); border: 1.5px solid var(--yellow); }
.track-banner strong { color: var(--red); }
.track-banner span:last-child { margin-left: auto; font-weight: 800; color: var(--red); }

/* Cartão do Pix na página do pedido */
.pix-card { border: 2px solid var(--yellow); background: var(--yellow-soft); text-align: center; }
.pix-title { font-weight: 800; color: var(--red); text-transform: uppercase; font-size: 13px; letter-spacing: .05em; }
.pix-amount { font-family: 'Lilita One', sans-serif; font-size: 30px; color: var(--ink); margin: 2px 0 8px; }
.pix-key-row { background: var(--white); border: 1px dashed #e0b800; border-radius: 12px; padding: 12px; font-weight: 800; font-size: 18px; word-break: break-all; }
