/* Tema vem de config.js via CSS variables setadas no app.js */
:root {
  --primaria: #c62828;
  --primaria-escura: #8e1b1b;
  --fundo: #fff8f2;
  --texto: #2b1b12;
  --card: #ffffff;
  --raio: 14px;
  --sombra: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; }

img { max-width: 100%; display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primario { background: var(--primaria); color: #fff; }
.btn-primario:hover { background: var(--primaria-escura); }
.btn-fantasma {
  background: transparent;
  color: var(--texto);
  border: 2px solid currentColor;
}
.btn-cheio { width: 100%; }

/* ---------- topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.topo-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--texto);
}
.marca-logo { font-size: 1.6rem; line-height: 1; }
.marca-logo img { height: 36px; width: auto; }
.marca-nome { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.15rem; }
.topo-zap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25d366;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.topo-zap:hover { filter: brightness(0.95); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, color-mix(in srgb, var(--primaria) 16%, transparent), transparent),
    var(--fundo);
  padding: 72px 20px 64px;
}
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero-tag {
  display: inline-block;
  background: color-mix(in srgb, var(--primaria) 12%, transparent);
  color: var(--primaria);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.12;
  margin-bottom: 16px;
}
.hero-desc {
  font-size: 1.08rem;
  opacity: 0.82;
  max-width: 540px;
  margin: 0 auto 28px;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-info { margin-top: 22px; font-size: 0.88rem; opacity: 0.65; }

/* ---------- cardápio ---------- */
.cardapio { max-width: 1080px; margin: 0 auto; padding: 48px 20px 80px; }
.cardapio h2 { font-size: 1.9rem; margin-bottom: 18px; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--texto);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip.ativo {
  background: var(--texto);
  color: var(--fundo);
  border-color: var(--texto);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.produto {
  background: var(--card);
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
}
.produto-img {
  aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--primaria) 9%, var(--card));
  display: grid;
  place-items: center;
  font-size: 3rem;
}
.produto-img img { width: 100%; height: 100%; object-fit: cover; }
.produto-corpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.produto-nome { font-weight: 600; font-size: 1.02rem; }
.produto-desc { font-size: 0.86rem; opacity: 0.7; flex: 1; }
.produto-pe { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.produto-preco { font-weight: 700; font-size: 1.05rem; }
.produto-add {
  background: var(--primaria);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.produto-add:hover { background: var(--primaria-escura); }
.produto-add:active { transform: scale(0.9); }

/* qty stepper no card quando item já está no carrinho */
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--primaria);
  background: transparent;
  color: var(--primaria);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.stepper .qtd { font-weight: 700; min-width: 18px; text-align: center; }

/* ---------- rodapé ---------- */
.rodape { background: var(--texto); color: var(--fundo); padding: 40px 20px 90px; }
.rodape-inner { max-width: 1080px; margin: 0 auto; display: grid; gap: 6px; font-size: 0.92rem; }
.rodape-nome { font-family: "Fraunces", serif; font-size: 1.25rem; margin-bottom: 6px; }
.rodape a { color: inherit; }

/* ---------- carrinho fab ---------- */
.carrinho-fab {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--texto);
  color: var(--fundo);
  border: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  animation: subir 0.25s ease;
}
@keyframes subir { from { transform: translate(-50%, 80px); } to { transform: translate(-50%, 0); } }
.fab-badge {
  background: var(--primaria);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

/* ---------- painel ---------- */
[hidden] { display: none !important; }

.painel-fundo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 60;
}
.painel {
  position: fixed;
  z-index: 70;
  background: var(--card);
  display: flex;
  flex-direction: column;
  inset: auto 0 0 0;
  max-height: 88dvh;
  border-radius: 20px 20px 0 0;
  animation: painel-sobe 0.28s ease;
}
@keyframes painel-sobe { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 720px) {
  .painel {
    inset: 0 0 0 auto;
    width: 420px;
    max-height: none;
    border-radius: 0;
    animation: painel-lado 0.28s ease;
  }
  @keyframes painel-lado { from { transform: translateX(100%); } to { transform: translateX(0); } }
}
.painel-cabeca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}
.painel-cabeca h3 { font-size: 1.3rem; }
.painel-fechar {
  background: none;
  border: none;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  color: var(--texto);
  opacity: 0.6;
}
.painel-itens { padding: 4px 20px; overflow-y: auto; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}
.item-nome { font-weight: 500; font-size: 0.95rem; }
.item-preco { font-size: 0.85rem; opacity: 0.65; }
.item-vazio { padding: 28px 0; text-align: center; opacity: 0.6; }

.painel-form { padding: 12px 20px 4px; display: grid; gap: 12px; }
.painel-form label { font-size: 0.85rem; font-weight: 600; display: grid; gap: 6px; }
.painel-form input,
.painel-form select {
  font: inherit;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  background: var(--fundo);
  color: var(--texto);
}
.painel-form input:focus,
.painel-form select:focus { outline: 2px solid var(--primaria); border-color: transparent; }

.seg { display: flex; border-radius: 10px; overflow: hidden; border: 1.5px solid rgba(0, 0, 0, 0.15); }
.seg-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  color: var(--texto);
}
.seg-btn.ativo { background: var(--texto); color: var(--fundo); }

.painel-pe { padding: 12px 20px 20px; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.totais { display: grid; gap: 3px; margin-bottom: 12px; font-size: 0.92rem; }
.totais .linha { display: flex; justify-content: space-between; }
.totais .linha.total { font-weight: 700; font-size: 1.1rem; margin-top: 4px; }
.painel-nota { font-size: 0.78rem; opacity: 0.6; text-align: center; margin-top: 10px; }
