/* Pastel do Japa — mobile-first */
:root {
  --bg: #1c1917;
  --surface: #292524;
  --surface-2: #37322e;
  --red: #c62828;
  --red-dark: #a31f1f;
  --yellow: #f5c518;
  --cream: #faf6ec;
  --text: #f0ece3;
  --muted: #b3aca0;
  --green: #25d366;
  --green-dark: #1eb857;
  --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabeçalho ---------- */
.hero {
  background: linear-gradient(160deg, var(--red) 0%, var(--red-dark) 70%);
  padding: 28px 16px 22px;
  text-align: center;
}
.hero-brand { margin: 0; }
.hero-logo {
  display: block;
  margin: 0 auto;
  width: min(340px, 78vw);
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .4));
}
.hero-tagline { color: var(--cream); margin-top: 6px; }
.hero-info {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.hero-hours { font-size: .85rem; color: var(--cream); }
.hero-address { margin-top: 8px; font-size: .8rem; color: rgba(255, 255, 255, .75); }

.badge {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .3);
}
.badge.open { color: #7dffa8; }
.badge.closed { color: #ffd08a; }

/* ---------- Como pedir ---------- */
.howto {
  max-width: 900px;
  margin: 16px auto 0;
  padding: 16px;
}
.howto h2 {
  color: var(--yellow);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.howto-steps {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 14px 16px 14px 36px;
  display: grid;
  gap: 10px;
  font-size: .92rem;
}
.howto-steps li::marker { color: var(--yellow); font-weight: 800; }
.howto-fee {
  margin-top: 10px;
  background: var(--surface);
  border: 1px dashed var(--yellow);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .9rem;
}

/* ---------- Navegação de categorias ---------- */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 16px;
  border-bottom: 1px solid var(--surface-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
}
.cat-nav a:active, .cat-nav a:hover { background: var(--surface-2); }
.cat-nav a { white-space: nowrap; }

/* Desktop: mostra todas as categorias quebrando linha, sem rolagem */
@media (min-width: 700px) {
  .cat-nav {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
  .category { scroll-margin-top: 110px; }
}

/* ---------- Busca ---------- */
.search-wrap { padding: 14px 16px 0; max-width: 900px; margin: 0 auto; }
#search {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
}
#search::placeholder { color: var(--muted); }
#search:focus { outline: 2px solid var(--yellow); border-color: transparent; }

/* ---------- Cardápio ---------- */
.menu {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 16px 120px;
}
.category { margin-top: 26px; scroll-margin-top: 64px; }
.category > h2 {
  background: var(--red);
  color: #fff;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.category-items {
  background: var(--surface);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-2);
}
.item:last-child { border-bottom: none; }
.item-info { flex: 1 1 200px; min-width: 0; }
.item-name { font-weight: 600; }
.item-cod { color: var(--yellow); font-size: .78rem; font-weight: 700; margin-right: 6px; }
.item-price { color: var(--muted); font-size: .85rem; margin-top: 2px; }

.item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Seletor de tamanho */
.size-toggle { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--surface-2); }
.size-toggle button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--bg);
  color: var(--muted);
  border: none;
  font: inherit;
  padding: 7px 14px;
  min-width: 92px;
  cursor: pointer;
  touch-action: manipulation;
}
.size-toggle .size-name { font-size: .82rem; font-weight: 700; }
.size-toggle .size-price { font-size: .76rem; font-variant-numeric: tabular-nums; }
.size-toggle button.active { background: var(--yellow); color: #201a00; }
.size-toggle button.active .size-price { font-weight: 700; }
.size-toggle button:disabled { cursor: default; }
.size-toggle button.unavailable { opacity: .4; text-decoration: line-through; }

/* Contador de quantidade */
.qty {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid var(--surface-2);
  overflow: hidden;
}
.qty button {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  width: 40px;
  height: 40px;
  cursor: pointer;
  touch-action: manipulation;
}
.qty button:active { background: var(--red); }
.qty .qty-n {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qty .qty-n.has { color: var(--yellow); }

.no-results { padding: 30px 10px; text-align: center; color: var(--muted); }

/* Categoria indisponível no momento (ex.: yakisoba qua/sáb 18h-21h) */
.category.blocked { display: none !important; }
.cat-nav a[hidden] { display: none; }

/* ---------- Botão flutuante do carrinho ---------- */
.cart-fab {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--green);
  color: #06300f;
  border: none;
  border-radius: 99px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.cart-fab:active { background: var(--green-dark); }
.cart-fab-count {
  background: #06300f;
  color: #fff;
  border-radius: 99px;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  padding: 0 7px;
}
.cart-fab-label { flex: 1; text-align: left; }

/* ---------- Painel do carrinho ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 40;
}
.cart-panel {
  position: fixed;
  z-index: 50;
  inset: auto 0 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  padding: 0 16px 24px;
  overscroll-behavior: contain;
}
.cart-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--surface-2);
  z-index: 1;
}
.cart-header h2 { font-size: 1.2rem; color: var(--yellow); }
.icon-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
}

.cart-items { padding: 6px 0; }
.cart-group + .cart-group { margin-top: 10px; }
.cart-cat {
  color: var(--yellow);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 8px 0 2px;
  border-bottom: 1px solid var(--surface-2);
}
.cart-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--surface-2);
}
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-size: .92rem; font-weight: 600; }
.cart-line-price { font-size: .82rem; color: var(--muted); }
.cart-line-subtotal { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-empty { text-align: center; color: var(--muted); padding: 24px 0; }

.cart-summary { padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.cart-summary .row { display: flex; justify-content: space-between; font-size: 1.05rem; }
.cart-summary strong { color: var(--yellow); }

/* ---------- Formulário ---------- */
.checkout { padding-top: 14px; }
.checkout h3 { color: var(--yellow); margin-bottom: 8px; }
.checkout label { display: block; font-size: .88rem; font-weight: 600; margin: 12px 0 4px; }
.checkout input[type="text"],
.checkout input[type="tel"],
.checkout textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--surface-2);
  background: var(--surface);
  color: var(--text);
}
.checkout input:focus, .checkout textarea:focus { outline: 2px solid var(--yellow); border-color: transparent; }

.choice-group { border: none; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.choice-group legend { font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 99px;
  padding: 9px 14px;
  font-size: .92rem;
  cursor: pointer;
}
.choice:has(input:checked) { background: var(--yellow); color: #201a00; font-weight: 700; border-color: var(--yellow); }
.choice input { accent-color: var(--red); }

.form-error {
  background: #4a1414;
  color: #ffb4b4;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  font-size: .9rem;
}

.btn-whatsapp {
  width: 100%;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green);
  color: #06300f;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-whatsapp:active { background: var(--green-dark); }

/* ---------- Rodapé ---------- */
.footer {
  background: var(--surface);
  text-align: center;
  padding: 24px 16px 32px;
  font-size: .88rem;
}
.footer p + p { margin-top: 4px; }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; margin-top: 8px; }

/* ---------- Telas maiores ---------- */
@media (min-width: 700px) {
  .cart-fab { left: auto; min-width: 320px; }
  .cart-panel {
    inset: 0 0 0 auto;
    width: 440px;
    max-height: 100dvh;
    border-radius: 18px 0 0 18px;
  }
  .item { flex-wrap: nowrap; }
}
