/* Cardápio público: leve, mobile-first, sem fonte externa (abre rápido no 4G). */
:root {
  --accent: #ff6a3d;
  --on-accent: #ffffff;
  --bg: #f6f3f0;
  --card: #ffffff;
  --text: #1d1b1a;
  --muted: #6b6560;
  --line: #e7e1db;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.state {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.state h1 { color: var(--text); font-size: 20px; margin: 0 0 8px; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.button {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
}

/* Topo */
.hero {
  background: var(--accent);
  color: var(--on-accent);
  padding: 20px 16px 18px;
  padding-top: calc(20px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.9);
  flex: none;
}
.hero-text { flex: 1; min-width: 0; }
.hero h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.muted-on-accent { margin: 2px 0 0; font-size: 13px; opacity: 0.85; }
.whatsapp {
  flex: none;
  background: rgba(255, 255, 255, 0.18);
  color: var(--on-accent);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* Categorias fixas no topo */
.chips {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Itens */
main { max-width: 720px; margin: 0 auto; padding: 4px 16px 8px; }
.section h2 { font-size: 18px; margin: 22px 0 10px; }
.item {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.item-text { flex: 1; min-width: 0; }
.item h3 { margin: 0; font-size: 16px; }
.item-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price { margin: 8px 0 0; font-weight: 700; color: var(--accent-text, var(--text)); }
.thumb {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--line);
}
.item.unavailable { opacity: 0.55; }
.tag-unavailable {
  display: inline-block;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

/* Detalhe do item */
.detail {
  border: 0;
  padding: 0;
  width: min(520px, 100vw);
  max-height: 92vh;
  border-radius: 18px;
  overflow: auto;
}
.detail::backdrop { background: rgba(0, 0, 0, 0.55); }
.detail-photo { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); }
.detail-body { padding: 16px 18px 22px; }
.detail-body h2 { margin: 0; font-size: 20px; }
.detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 22px;
  line-height: 36px;
}
