:root {
  --bg: #14110f;
  --surface: #1f1b18;
  --surface-2: #2a2521;
  --line: #3a332e;
  --text: #f4eee6;
  --muted: #a99f94;
  --accent: #f2a900;
  --accent-ink: #1a1200;
  --ok: #3fb950;
  --danger: #ff6b61;
  --whats: #25d366;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 96px;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Banner */
.banner { width: 100%; aspect-ratio: 3 / 1; overflow: hidden; background: var(--surface); }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner:not([hidden]) + .topo { margin-top: -28px; padding-top: 0; }
.banner:not([hidden]) + .topo .logo { box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }

/* Topo */
.topo {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; padding-top: max(16px, env(safe-area-inset-top));
}
.logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); background: var(--surface); }
.topo h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.status { margin: 2px 0 0; font-size: .875rem; color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--danger); }
.status.aberto::before { background: var(--ok); }

.faixa {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  padding: 0 16px 12px; font-size: .8125rem; color: var(--muted);
}

.busca-wrap { padding: 0 16px 12px; }
#busca {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
#busca::placeholder { color: var(--muted); }
#busca:focus, .form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* Abas de categoria */
.abas {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.abas::-webkit-scrollbar { display: none; }
.aba {
  flex: none; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .875rem;
}
.aba.ativa { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Lista */
.lista { padding: 0 16px; max-width: 760px; margin: 0 auto; }
.categoria h2 { margin: 24px 0 12px; font-size: 1.125rem; }
.vazio { text-align: center; color: var(--muted); padding: 32px 16px; }

.card {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  padding: 12px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.card.sem-estoque { opacity: .55; }
.card-texto { min-width: 0; }
.card-nome { margin: 0; font-size: 1rem; font-weight: 600; }
.card-desc {
  margin: 4px 0 0; font-size: .8125rem; color: var(--muted); white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foto { grid-column: 2; grid-row: 1 / span 2; width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.card-rodape { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.card:has(.card-foto) .card-rodape { grid-column: 1; }
.preco { font-weight: 700; font-size: 1.0625rem; }
.card.sem-estoque .preco { text-decoration: line-through; color: var(--muted); }
.esgotado { font-size: .75rem; color: var(--danger); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.btn-add {
  padding: 8px 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 10px; }
.stepper button {
  width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.25rem; font-weight: 700; color: var(--accent);
}
.stepper span { min-width: 24px; text-align: center; font-weight: 700; }

/* Rodapé */
.rodape { max-width: 760px; margin: 32px auto 0; padding: 16px; text-align: center; font-size: .8125rem; color: var(--muted); }
.rodape p { margin: 0 0 6px; }
.rodape-powered { margin: 16px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--line); font-size: .75rem; letter-spacing: .04em; }
.rodape-powered a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* Barra do carrinho */
.barra-carrinho {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 40%);
}
.barra-carrinho button {
  width: 100%; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.barra-carrinho button span:nth-child(2) { flex: 1; text-align: left; }
.barra-qtd { background: var(--accent-ink); color: var(--accent); min-width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .875rem; font-weight: 700; }

/* Dialogs */
dialog { color: var(--text); border: 0; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0;
  background: var(--bg); border-radius: 20px 20px 0 0; overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); margin: 0; }
.sheet-topo h2 { margin: 0; font-size: 1.125rem; }
.fechar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); font-size: 1.5rem; line-height: 1; }
.sheet-corpo { overflow-y: auto; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }

.itens-carrinho { list-style: none; margin: 0 0 16px; padding: 0; }
.itens-carrinho li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-info { flex: 1; min-width: 0; }
.item-info b { display: block; font-weight: 600; font-size: .9375rem; }
.item-info small { color: var(--muted); }

.totais { margin-bottom: 20px; }
.totais > div { display: flex; justify-content: space-between; font-size: 1.0625rem; }
.nota { margin: 6px 0 0; font-size: .8125rem; color: var(--muted); }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .875rem; color: var(--muted); }
.form input:not([type=radio]), .form select, .form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 1rem;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.opcoes { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.opcoes legend { font-size: .875rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.opcoes label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1rem; }
.opcoes input { accent-color: var(--accent); width: 20px; height: 20px; }
#campos-entrega { display: grid; gap: 14px; }
.erro { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 107, 97, .12); color: var(--danger); font-size: .875rem; }

.btn-whats {
  padding: 14px 16px; border: 0; border-radius: var(--radius);
  background: var(--whats); color: #04210f; font-weight: 700; font-size: 1rem;
}
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px; }

.idade { width: calc(100% - 32px); max-width: 420px; margin: auto; padding: 24px; border-radius: 20px; background: var(--surface); text-align: center; }
.idade h2 { margin: 0 0 8px; }
.idade p { margin: 0 0 20px; color: var(--muted); }
.idade-acoes { display: grid; gap: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
