:root {
  /* Identidade Porção Nobre: preto, dourado e vermelho */
  /* Fundo claro; topo preto com a logo, vermelho nas ações, dourado nos detalhes */
  color-scheme: light;
  --brand: #c8102e;
  --brand-dark: #8e0b20;
  --brand-soft: #fcebed;
  --ink: #000000;
  --gold: #c9973f;
  --gold-light: #8a5d0e;      /* dourado escuro para texto sobre branco */
  --gold-bright: #f2d38c;     /* dourado claro para texto sobre preto */
  --gold-soft: #fbf3e2;
  --accent: var(--gold);
  --ok: #1f8a4c;
  --whats: #25d366;
  --bg: #f5f3f0;
  --card: #ffffff;
  --field: #ffffff;
  --text: #1a1715;
  --muted: #6f6760;
  --line: #e6e1dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --max: 760px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding-bottom: 96px;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.view { max-width: var(--max); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; text-align: center; padding: 28px 16px 22px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: #000; /* mesmo preto do fundo da logo */
  border-bottom: 2px solid var(--gold);
}
.hero.has-logo { padding-top: 8px; }
.hero.has-logo .logo {
  width: min(260px, 70vw); height: auto; aspect-ratio: 1; border-radius: 0; border: 0;
  background: transparent; box-shadow: none; margin-bottom: 0;
}
.hero.has-logo h1, .hero.has-logo .tagline {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.hero.has-logo .hero-meta { margin-top: -6px; }
@media (min-width: 761px) { .hero { border-radius: 0 0 var(--radius) var(--radius); } }
.hero-inner { position: relative; }
.logo {
  width: 92px; height: 92px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--field); display: grid; place-items: center; font-size: 44px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25); overflow: hidden; border: 3px solid rgba(255,255,255,.85);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.tagline { margin: 4px 0 12px; opacity: .88; }
.hero-meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: rgba(255,255,255,.16); font-weight: 600; font-size: 13px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9e9e9e; }
.badge.open::before { background: #4ade80; }
.badge.closed::before { background: #fbbf24; }
.btn-whats {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: var(--whats); color: #fff; font-weight: 600; font-size: 13px; text-decoration: none;
}

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 16px; }
.welcome { text-align: center; margin-top: -2px; }
.welcome strong { font-size: 16px; }
.welcome p { margin: 4px 0 0; color: var(--muted); }
.welcome .notice { color: var(--gold-light); font-weight: 500; font-size: 13px; margin-top: 8px; }
h3 { font-size: 15px; margin: 0 0 10px; }
h3 em { font-style: normal; font-weight: 500; color: var(--gold); font-size: 13px; }
.mt { margin-top: 18px; }

/* ---------- Tabs ---------- */
.tabs {
  position: sticky; top: 0; z-index: 20; display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); scrollbar-width: none; border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 7px 14px; border-radius: 99px; background: var(--field); border: 1px solid var(--line);
  text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.search-wrap { padding: 12px 16px 0; }
.search-wrap input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field);
}

/* ---------- Produtos ---------- */
.cat { scroll-margin-top: 60px; }
.cat h2 { margin: 22px 16px 8px; font-size: 18px; font-weight: 800; }
.plist { list-style: none; margin: 0 16px; padding: 0; background: var(--field); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pitem { display: flex; gap: 12px; padding: 14px; border-top: 1px solid var(--line); cursor: pointer; align-items: center; }
.pitem:first-child { border-top: 0; }
.pitem:hover { background: #faf8f6; }
.pinfo { flex: 1; min-width: 0; }
.pname { font-weight: 600; margin: 0; }
.pdesc { color: var(--muted); font-size: 13px; margin: 2px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pprice { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pprice .now { font-weight: 700; color: var(--brand); }
.pprice .old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.pprice .unit { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-bottom: 4px; }
.tag.promo { background: var(--gold-soft); color: var(--gold-light); }
.tag.star { background: var(--brand-soft); color: var(--brand); }
.pside { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pthumb {
  width: 76px; height: 76px; border-radius: 12px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 34px; overflow: hidden; flex: none;
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.btn-ask {
  border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px;
  padding: 6px 16px; border-radius: 99px; cursor: pointer;
}
.in-cart { font-size: 11px; font-weight: 700; color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 16px; }

/* ---------- Barra do carrinho ---------- */
.cart-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(calc(100% - 32px), calc(var(--max) - 32px)); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  border: 1px solid var(--gold);
}
.cart-qty { background: var(--brand); border-radius: 8px; padding: 2px 9px; }
#cart-bar-total { color: var(--gold-bright); }

/* ---------- Modal produto ---------- */
dialog.sheet {
  border: 0; padding: 0; width: min(100%, 520px); max-height: 92vh; border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(20,10,8,.55); }
@media (max-width: 560px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; }
}
#product-form { display: flex; flex-direction: column; max-height: 92vh; }
.close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(0,0,0,.7) !important; color: #fff; }
/* Foto do produto: faixa de altura fixa, a imagem nunca vaza para o resto da janela */
.pm-img {
  position: relative; height: clamp(170px, 34vh, 260px); overflow: hidden; flex: none;
  background: var(--brand-soft); display: grid; place-items: center; font-size: 64px;
}
.pm-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-img.has-photo { background: #000; border-bottom: 2px solid var(--gold); }
.pm-img.has-photo::after { /* leve sombra embaixo para a foto "assentar" */
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent); pointer-events: none;
}
.pm-body { padding: 16px; overflow-y: auto; background: var(--card); }
.pm-body h2 { margin: 0; font-size: 20px; }
.pm-desc { color: var(--muted); margin: 4px 0 6px; }
.pm-price { font-weight: 700; color: var(--brand); margin: 0 0 16px; }
.pm-body h3 { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--field); padding: 8px 14px; border-radius: 99px;
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-light); }
.stepper { display: flex; align-items: center; gap: 0; margin: 12px 0 4px; width: max-content; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 46px; height: 44px; border: 0; background: var(--field); font-size: 22px; cursor: pointer; color: var(--brand); }
.stepper button:disabled { color: #ccc; cursor: default; }
.stepper output { min-width: 96px; text-align: center; font-weight: 700; font-size: 16px; }
.pm-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.pm-foot .btn-primary { width: 100%; display: flex; justify-content: space-between; }

/* ---------- Forms ---------- */
.f { display: block; margin-top: 12px; }
.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.f input, .f select, .f textarea, #slot {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field);
}
.f input:focus, .f select:focus, .f textarea:focus, #slot:focus, .search-wrap input:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand);
}
.row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.hint.warn { color: var(--gold-light); font-weight: 600; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: var(--brand); color: #fff; font-weight: 700; padding: 14px 18px;
  border-radius: 12px; cursor: pointer; text-decoration: none; font-size: 15px;
}
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { border: 0; background: none; color: var(--gold-light); font-weight: 600; padding: 12px; cursor: pointer; }
.icon-btn { border: 0; background: var(--field); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 18px; box-shadow: var(--shadow); }

/* ---------- Carrinho ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 2px; }
.topbar h2 { margin: 0; font-size: 20px; }
.link-add { border: 0; background: none; color: var(--gold-light); font-weight: 700; padding: 0 0 8px; cursor: pointer; }
.cart-items { list-style: none; margin: 0; padding: 0; }
.ci { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-weight: 600; }
.ci-meta { color: var(--muted); font-size: 12px; }
.ci-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ci-actions button { border: 1px solid var(--line); background: var(--field); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--brand); font-weight: 700; }
.ci-actions .qty { font-weight: 700; min-width: 64px; text-align: center; font-size: 13px; }
.ci-actions .rm { width: auto; padding: 0 10px; color: var(--muted); font-weight: 500; font-size: 12px; }
.ci-price { font-weight: 700; white-space: nowrap; }
.totals { border-top: 1px solid var(--line); padding-top: 10px; }
.totals > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.totals .grand { color: var(--text); font-weight: 800; font-size: 17px; padding-top: 6px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label, .pay label { position: relative; }
.seg input, .pay input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .pay span {
  display: block; text-align: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  font-weight: 600; cursor: pointer; background: var(--field);
}
.seg input:checked + span, .pay input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-light); }
.seg input:focus-visible + span, .pay input:focus-visible + span { outline: 2px solid var(--brand); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pay span { font-size: 13px; padding: 10px; }

.form-error { margin: 0 16px; padding: 12px 14px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #f3b6bf; border-radius: 12px; font-weight: 600; }
.send-bar { padding: 12px 16px 24px; }
.send-bar .btn-primary { width: 100%; padding: 16px; font-size: 16px; }

/* ---------- Concluído ---------- */
.done { text-align: center; padding: 32px 20px; margin-top: 40px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 32px; display: grid; place-items: center; }
.done h2 { margin: 6px 0 0; }
.done p { color: var(--muted); margin: 0 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 50;
  background: #000; color: var(--gold-bright); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ---------- Ajustes do tema escuro ---------- */
dialog { background: var(--card); color: var(--text); }
.welcome strong { color: var(--gold-light); }
.welcome { border-bottom: 2px solid var(--gold); } /* linha dourada embaixo, igual ao topo */
.cat h2 { color: var(--text); border-left: 3px solid var(--gold); padding-left: 10px; }
.btn-primary { box-shadow: 0 6px 18px rgba(209,26,53,.3); }
.totals .grand span:last-child { color: var(--brand); }

/* ---------- Capa da categoria (foto acima dos produtos) ---------- */
.cat-banner { margin: 22px 16px 10px; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.cat-banner h2 {
  margin: 0; padding: 10px 14px; text-align: center; font-size: 19px; font-weight: 800;
  background: #000; color: var(--gold-bright); border: 0; border-bottom: 2px solid var(--gold);
}
.cat-banner img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Pacotes fixos ---------- */
.chip.pack { display: inline-flex; flex-direction: column; align-items: center; min-width: 92px; border-radius: 12px; padding: 10px 14px; line-height: 1.2; }
.chip.pack small { font-weight: 600; color: var(--brand); margin-top: 2px; font-size: 12px; }

/* ---------- Banner da promoção (topo do cardápio) ---------- */
.promo-banner { margin: 14px 16px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.promo-banner img { display: block; width: 100%; height: auto; }

/* ---------- Botão de compartilhar a loja (topo, à direita) ---------- */
.share-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--gold);
  background: rgba(0,0,0,.55); color: var(--gold-bright); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .12s, background .12s;
}
.share-btn:hover { background: var(--whats); color: #fff; border-color: var(--whats); }
.share-btn:active { transform: scale(.94); }

/* ---------- Topo com foto de capa + logo em bolinha (quando há capa) ---------- */
.hero.with-cover { padding: 0; text-align: left; color: var(--text); background: var(--card); border-bottom: 2px solid var(--gold); }
.hero.with-cover .hero-bg { display: none; }
.hero-cover { height: clamp(150px, 44vw, 250px); background: #000; overflow: hidden; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.with-cover .hero-inner {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: end;
  padding: 0 16px 14px;
}
.hero.with-cover .logo,
.hero.with-cover.has-logo .logo {
  width: 122px; height: 122px; aspect-ratio: auto; margin: -61px 0 0; border-radius: 50%;
  background: #000; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(0,0,0,.25);
  padding: 3px; overflow: hidden;
}
.hero.with-cover .logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
/* nome e frase visíveis ao lado da bolinha */
.hero.with-cover .hero-title { padding-bottom: 6px; min-width: 0; }
.hero.with-cover h1, .hero.with-cover.has-logo h1,
.hero.with-cover .tagline, .hero.with-cover.has-logo .tagline {
  position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
}
.hero.with-cover h1 { font-size: 20px; line-height: 1.15; color: var(--text); }
.hero.with-cover .tagline { margin: 3px 0 0; font-size: 13px; color: var(--gold-light); opacity: 1; }
.hero.with-cover .hero-meta, .hero.with-cover.has-logo .hero-meta { grid-column: 1 / -1; justify-content: flex-start; margin-top: 12px; }
.hero.with-cover .badge { background: #f1ede9; color: var(--text); }

/* topo com capa alinhado com os quadros de baixo (mesma largura) e com respiro */
@media (min-width: 761px) {
  .hero.with-cover { margin: 0 16px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
}
.hero.with-cover + .welcome, .hero.with-cover ~ .welcome { margin-top: 6px; }

/* botão de compartilhar mais visível: pílula branca com texto */
.share-btn {
  width: auto; height: auto; padding: 8px 14px 8px 11px; gap: 7px; display: inline-flex; align-items: center;
  border-radius: 99px; border: 0; background: #fff; color: var(--brand);
  font-weight: 700; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.share-btn span { color: var(--text); }
.share-btn:hover { background: var(--whats); color: #fff; }
.share-btn:hover span { color: #fff; }

/* Compartilhar na fileira de botões do topo (não fica mais sobre a foto) */
.hero .share-btn {
  position: static; box-shadow: none; transform: none;
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: auto;
  padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--gold-bright); border: 1px solid var(--gold);
}
.hero .share-btn span { color: inherit; }
.hero.with-cover .share-btn { color: var(--text); background: #fff; border-color: var(--gold); }
.hero.with-cover .share-btn svg { color: var(--brand); }
.hero .share-btn:hover, .hero.with-cover .share-btn:hover { background: var(--whats); border-color: var(--whats); color: #fff; }
.hero .share-btn:hover svg { color: #fff; }

/* WhatsApp e Compartilhar discretos: só ícone + texto, sem fundo (como no modelo) */
.hero .btn-whats, .hero .share-btn, .hero.with-cover .share-btn {
  background: none; border: 0; box-shadow: none; padding: 4px 2px; border-radius: 6px;
  font-size: 15px; font-weight: 700; gap: 6px; color: var(--text);
}
.hero .btn-whats svg { color: var(--whats); width: 18px; height: 18px; }
.hero .share-btn svg, .hero.with-cover .share-btn svg { color: var(--muted); width: 17px; height: 17px; }
.hero .btn-whats:hover, .hero .share-btn:hover, .hero.with-cover .share-btn:hover { background: none; color: var(--text); text-decoration: underline; }
.hero .share-btn:hover svg { color: var(--muted); }
.hero .hero-meta { gap: 18px; align-items: center; }
/* topo preto (sem capa): texto claro */
.hero:not(.with-cover) .btn-whats, .hero:not(.with-cover) .share-btn { color: #fff; }
.hero:not(.with-cover) .btn-whats:hover, .hero:not(.with-cover) .share-btn:hover { color: #fff; }
