/* ============================================================
   BRAZA — design system
   Tema: forno a lenha. Escuro quente, brasa laranja, creme.
   ============================================================ */

:root {
  /* cor */
  --bg: #171210;
  --bg-raised: #201914;
  --bg-card: #241C16;
  --bg-chip: #2C231B;
  --line: rgba(246, 233, 216, 0.09);
  --text: #F6E9D8;
  --text-dim: #B7A48D;
  --text-faint: #82715C;
  --ember: #FF7A2F;
  --ember-deep: #E85D1A;
  --ember-soft: rgba(255, 122, 47, 0.14);
  --gold: #E9B44C;
  --green: #4FB86A;
  --on-ember: #1D0F05;

  /* forma */
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --r-pill: 999px;

  /* movimento */
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --pop: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Karla", "Segoe UI", sans-serif;

  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* textura de grão sutil sobre tudo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* brasa difusa no topo da página */
.glow {
  position: fixed;
  top: -180px;
  left: 50%;
  width: 560px;
  height: 380px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(255, 110, 40, 0.16), rgba(233, 180, 76, 0.05) 55%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

#app { position: relative; z-index: 1; }

/* ============ topo ============ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 6px;
  max-width: 680px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-flame {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--ember), var(--ember-deep));
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(255, 110, 40, 0.35);
}
.brand-flame svg { width: 24px; height: 24px; }

.brand h1 {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand p {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* ============ hero ============ */

.hero {
  max-width: 680px;
  margin: 0 auto;
  padding: 22px 20px 6px;
}
.hero h2 {
  font-family: var(--font-display);
  font-weight: 470;
  font-size: clamp(30px, 8.4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.hero h2 em {
  font-style: italic;
  color: var(--ember);
}

.hero-badges:not(:empty) {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge-frete, .badge-entrega {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.01em;
  animation: card-in 0.5s var(--spring) both;
}
.badge-frete {
  background: rgba(79, 184, 106, 0.14);
  border: 1px solid rgba(79, 184, 106, 0.3);
  color: var(--green);
}
.badge-entrega {
  background: var(--ember-soft);
  border: 1px solid rgba(255, 122, 47, 0.3);
  color: var(--gold);
}

/* ============ grade de pizzas ============ */

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 26px 20px 130px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform 0.18s var(--pop), border-color 0.2s;
  animation: card-in 0.5s var(--spring) both;
}
.card:active { transform: scale(0.965); }
.card:active .card-art svg { transform: rotate(14deg) scale(1.06); }

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.card-art {
  align-self: center;
  width: 78%;
  aspect-ratio: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.4));
}
.card-art svg {
  width: 100%; height: 100%;
  transition: transform 0.45s var(--spring);
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 17.5px;
  line-height: 1.15;
}
.card .desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 17px;
  color: var(--gold);
}
.card-add {
  width: 32px; height: 32px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--ember-soft);
  color: var(--ember);
  font-size: 20px;
  font-weight: 700;
  line-height: 0;
}

/* ============ seção ============ */

.section-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 22px;
  margin: 30px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title span { font-size: 13px; font-family: var(--font-ui); color: var(--text-faint); font-weight: 700; }

/* ============ bebidas ============ */

.drinks { display: flex; flex-direction: column; gap: 10px; }

.drink {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.drink-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--bg-chip);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.drink-icon svg { width: 32px; height: 32px; }
.drink-name { font-weight: 700; font-size: 15px; flex: 1; }
.drink-name .price { display: block; font-size: 14.5px; margin-top: 1px; }

/* ============ stepper ============ */

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-chip);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
}
.stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--ember);
  transition: transform 0.12s var(--pop), background 0.15s;
}
.stepper button:active { transform: scale(0.85); background: var(--ember-soft); }
.stepper .qty {
  min-width: 26px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stepper.zero .minus { opacity: 0.25; pointer-events: none; }

/* ============ barra do carrinho ============ */

.cartbar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(14px + var(--safe-b));
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  transform: translateY(120px);
  transition: transform 0.45s var(--spring);
}
.cartbar.show { transform: none; }

.cartbar-btn {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--ember), var(--ember-deep));
  color: var(--on-ember);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 10px 34px rgba(232, 93, 26, 0.5);
  transition: transform 0.15s var(--pop);
}
.cartbar-btn:active { transform: scale(0.97); }

.cart-count {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(29, 15, 5, 0.22);
  display: grid; place-items: center;
  font-size: 13.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.cart-count.bump { animation: bump 0.4s var(--pop); }
@keyframes bump { 40% { transform: scale(1.35); } }

.cartbar-total { margin-left: auto; font-family: var(--font-display); font-size: 17.5px; font-weight: 640; }

/* ============ sheets ============ */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 6, 4, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sheet-wrap.open .scrim { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 51;
  max-width: 680px;
  margin: 0 auto;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(104%);
  transition: transform 0.45s var(--spring);
}
.sheet-wrap.open .sheet { transform: none; }

.sheet-grab {
  flex: 0 0 auto;
  padding: 10px 0 4px;
  display: grid;
  place-items: center;
}
.sheet-grab::before {
  content: "";
  width: 40px; height: 4.5px;
  border-radius: 3px;
  background: var(--line);
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px 20px;
}

.sheet-foot {
  flex: 0 0 auto;
  padding: 12px 20px calc(16px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  display: flex;
  gap: 12px;
  align-items: center;
}

/* cabeçalho da personalização */
.custom-head {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 4px 0 14px;
}
.custom-head .art { width: 92px; height: 92px; flex: 0 0 auto; filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); }
.custom-head .art svg { width: 100%; height: 100%; }
.custom-head h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 24px;
  line-height: 1.1;
}
.custom-head p { color: var(--text-dim); font-size: 13px; margin-top: 4px; line-height: 1.35; }

.base-desc {
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.4;
  padding: 10px 12px;
  background: var(--bg-chip);
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}

/* rótulo de grupo */
.group { margin: 20px 0 0; }
.group-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.group-label .hint { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--ember); font-size: 12px; }

/* segmentado (tamanho / inteira-meia) */
.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--bg-chip);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px;
}
.seg-ind {
  position: absolute;
  top: 4px; bottom: 4px;
  border-radius: 12px;
  background: var(--ember);
  box-shadow: 0 4px 14px rgba(255, 110, 40, 0.35);
  transition: left 0.3s var(--spring), width 0.3s var(--spring);
}
.seg button {
  position: relative;
  z-index: 1;
  padding: 10px 4px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-dim);
  transition: color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.seg button small { font-size: 10.5px; font-weight: 700; opacity: 0.75; }
.seg button.on { color: var(--on-ember); }

/* chips de opção */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 15px;
  border-radius: var(--r-pill);
  background: var(--bg-chip);
  border: 1.5px solid var(--line);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dim);
  transition: transform 0.13s var(--pop), border-color 0.2s, color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip:active { transform: scale(0.93); }
.chip .p { font-size: 12px; color: var(--gold); font-weight: 800; }
.chip.on {
  border-color: var(--ember);
  color: var(--text);
  background: var(--ember-soft);
}
.chip.on::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ember);
  animation: chip-dot 0.3s var(--pop);
}
@keyframes chip-dot { from { transform: scale(0); } }

/* chip de remoção — visual distinto (tom vermelho) do chip de adicionar */
.chip.chip-remove.on {
  border-color: #E8503A;
  color: var(--text);
  background: rgba(232, 80, 58, 0.14);
}
.chip.chip-remove.on::before { background: #E8503A; }

/* nota opcional */
.note-toggle {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 0;
}
.note-input {
  width: 100%;
  background: var(--bg-chip);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  resize: none;
}
.note-input:focus { border-color: var(--ember); }
.note-input::placeholder { color: var(--text-faint); }

/* CTA da sheet */
.cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--ember), var(--ember-deep));
  color: var(--on-ember);
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 8px 26px rgba(232, 93, 26, 0.45);
  transition: transform 0.15s var(--pop);
}
.cta:active { transform: scale(0.97); }
.cta .cta-price {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}
.cta .cta-price.tick { animation: tick 0.3s var(--pop); }
@keyframes tick { 30% { transform: translateY(-4px); opacity: 0.5; } }

/* ============ carrinho ============ */

.cart-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 24px;
  padding: 4px 0 4px;
}

.cart-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 34px 20px 40px;
}
.cart-empty .big { font-size: 44px; margin-bottom: 10px; }

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  animation: card-in 0.35s var(--spring) both;
}
.cart-item.removing {
  transition: opacity 0.25s, transform 0.25s;
  opacity: 0;
  transform: translateX(30px);
}
.cart-item .thumb { width: 54px; height: 54px; flex: 0 0 auto; }
.cart-item .thumb svg { width: 100%; height: 100%; }
.cart-item .thumb.drink {
  background: var(--bg-chip);
  border-radius: 14px;
  display: grid; place-items: center;
}
.cart-item .thumb.drink svg { width: 38px; height: 38px; }

.cart-item .info { flex: 1; min-width: 0; }
.cart-item .ttl { font-weight: 800; font-size: 15px; line-height: 1.25; }
.cart-item .det { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.cart-item .pr { font-family: var(--font-display); color: var(--gold); font-weight: 620; font-size: 15.5px; margin-top: 5px; }

.cart-item .acts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.icon-row { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--bg-chip);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: transform 0.13s var(--pop), color 0.15s;
}
.icon-btn:active { transform: scale(0.86); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.danger:active { color: #E8503A; }

.frete-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(79, 184, 106, 0.14);
  border: 1px solid rgba(79, 184, 106, 0.3);
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}

.cart-totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0 6px;
}

.delivery-note {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-dim);
  background: var(--bg-chip);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  margin-top: 4px;
}
.cart-totals .lbl { color: var(--text-dim); font-weight: 700; }
.cart-totals .val { font-family: var(--font-display); font-size: 26px; font-weight: 640; color: var(--gold); }

.btn-ghost {
  padding: 15px 18px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  font-weight: 800;
  font-size: 15px;
  color: var(--text-dim);
  transition: transform 0.14s var(--pop);
}
.btn-ghost:active { transform: scale(0.95); }

.cta.whats { gap: 10px; justify-content: center; }
.cta.whats svg { width: 21px; height: 21px; flex: 0 0 auto; }

/* ============ toast ============ */

#toast-root {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(92px + var(--safe-b));
  display: flex;
  justify-content: center;
  z-index: 60;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.4s var(--pop), toast-out 0.3s ease 1.9s both;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ============ acessibilidade / desktop ============ */

@media (hover: hover) {
  .card:hover { transform: translateY(-4px); border-color: rgba(255, 122, 47, 0.35); }
  .card:hover .card-art svg { transform: rotate(10deg) scale(1.05); }
  .chip:hover, .btn-ghost:hover { border-color: rgba(255, 122, 47, 0.4); }
  .cta:hover, .cartbar-btn:hover { filter: brightness(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
