/* ===== Base ===== */
:root {
  --bg: #f6efe4;
  --paper: #fffdf9;
  --card: #ffffff;
  --ink: #1d1410;
  --ink-2: #2b201a;
  --muted: #6f625a;
  --cream: #fbf3e6;
  --accent: #c2410c;        /* tomate: branco sobre ele passa de 4.5:1 */
  --accent-dark: #9a3412;
  --accent-soft: #fdeadd;
  --gold: #f2b134;          /* mostarda */
  --gold-soft: #fff3d6;
  --green: #2f7d4f;
  --red: #b42318;
  --line: #eadfce;          /* bordas decorativas */
  --line-strong: #7d7068;   /* bordas de controles: 3:1 ou mais */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --shadow-sm: 0 1px 2px rgba(29, 20, 16, 0.05), 0 2px 8px rgba(29, 20, 16, 0.04);
  --shadow: 0 14px 34px -12px rgba(29, 20, 16, 0.22);
  --focus-ring: 3px solid var(--gold);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --topbar-h: 64px;
  --serif: 'Fraunces', Georgia, 'Iowan Old Style', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 72px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
[inert] { pointer-events: none; }
svg { flex-shrink: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(29, 20, 16, 0.92);
  backdrop-filter: saturate(1.3) blur(12px);
  color: var(--cream);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
}
.top-right { display: flex; align-items: center; gap: var(--space-4); }
.admin-link {
  padding: 6px 2px;
  color: #bfae9f;
  font-size: 0.8rem;
  text-decoration: none;
}
.admin-link:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.cart-btn:hover { background: #f6c25a; }
.cart-btn:active { transform: scale(0.97); }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.cart-btn .badge { background: var(--ink); color: var(--gold); }
.badge.bump { animation: bump 0.35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 110px) clamp(16px, 4vw, 40px) clamp(56px, 8vw, 96px);
  background:
    radial-gradient(ellipse 60% 70% at 12% 0%, rgba(242, 177, 52, 0.28), transparent 60%),
    radial-gradient(ellipse 55% 80% at 95% 100%, rgba(194, 65, 12, 0.4), transparent 60%),
    var(--ink);
  color: var(--cream);
  text-align: center;
}
.hero::after {
  /* faixa listrada na base, um toque de toalha de lanchonete */
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 28px);
  opacity: 0.85;
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px;
  border: 1px solid rgba(251, 243, 230, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: #f3e3cc;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd08b;
  box-shadow: 0 0 0 4px rgba(95, 208, 139, 0.2);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-variation-settings: 'SOFT' 50, 'WONK' 1;
}
.lead {
  max-width: 540px;
  margin: 20px auto 0;
  color: #d9c8b6;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: 32px;
}
.hero-cta .btn { min-height: 48px; padding: 0 24px; text-decoration: none; white-space: nowrap; }
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: #cbb8a4;
  font-size: 0.9rem;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { color: var(--gold); }

/* ===== Categorias ===== */
.cats {
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px max(clamp(16px, 4vw, 40px), calc((100% - 1120px) / 2 + 40px));
  background: rgba(246, 239, 228, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cats:empty { display: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cats a:hover { border-color: var(--accent); color: var(--accent); }
.cats a[aria-current='true'] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.cats a .n {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}
.cats a[aria-current='true'] .n { color: var(--gold); }

/* ===== Menu ===== */
.menu {
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 48px;
}
.cat { padding-top: 40px; }
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
}
.cat h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.cat-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: translateY(-6px);
}
.cat-count { color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card.popular { border-color: #f0cf8a; }
.card.in-cart { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }

/* Foto do produto com o emoji como reserva */
.media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, #fff7ea 0, transparent 70%),
    linear-gradient(160deg, var(--gold-soft), var(--accent-soft));
}
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1; /* a foto cobre o emoji de reserva */
  transition: transform 0.5s var(--ease);
}
.card:hover .media img { transform: scale(1.05); }
.icon {
  font-size: 3.4rem;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(29, 20, 16, 0.15));
}
.tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.photo-note {
  margin: 0;
  padding: 0 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
}
.info h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.info p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Controle de quantidade */
.qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card .qty:has(span) {
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
}
.qty button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.card .qty:has(span) button { border-color: transparent; background: #fff; color: var(--accent-dark); }
.qty button:hover { border-color: var(--accent); color: var(--accent); }
.qty span { min-width: 24px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty .add {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
}
.qty .add:hover { background: var(--accent-dark); color: #fff; }

/* Cardápio sem produtos */
.menu-empty {
  max-width: 440px;
  margin: 56px auto 24px;
  padding: 40px 28px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed #d8c7b1;
  border-radius: var(--radius);
}
.menu-empty .big { font-size: 3rem; line-height: 1; }
.menu-empty h2 { margin: 14px 0 6px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.menu-empty p { margin: 0 0 20px; color: var(--muted); }
.menu:has(.menu-empty) + .photo-note { display: none; }

/* Esqueleto enquanto carrega */
.skeleton-grid { padding-top: 40px; }
.skel {
  height: 300px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #efe5d7 0, #f8f1e7 50%, #efe5d7 100%) 0 0 / 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== Rodapé ===== */
.footer {
  padding: 44px clamp(16px, 4vw, 40px) 56px;
  background: var(--ink);
  color: #cbb8a4;
  text-align: center;
  font-size: 0.9rem;
}
.footer .brand { justify-content: center; margin-bottom: 10px; }
.footer p { margin: 0; }

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  transition: background 0.15s, transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost-light {
  background: transparent;
  border: 1px solid rgba(251, 243, 230, 0.4);
  color: var(--cream);
}
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.08); }
.btn.block { width: 100%; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
}
.icon-btn:hover { background: var(--accent-soft); }

/* ===== Carrinho (drawer) ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(29, 20, 16, 0.5);
  backdrop-filter: blur(2px);
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(440px, 100%);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
  transform: translateX(105%);
  transition: transform 0.35s var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.cart-lines {
  flex: 1;
  overflow-y: auto;
  padding: 6px 22px;
}
.empty { color: var(--muted); text-align: center; padding: 40px 8px; }
.line {
  display: grid;
  grid-template-columns: 1fr auto 84px;
  gap: 10px 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: 0; }
.line-info { display: flex; flex-direction: column; min-width: 0; }
.line-info strong { font-size: 0.98rem; }
.line-info span { color: var(--muted); font-size: 0.84rem; }
.line .qty { justify-self: start; }
.line .qty button { width: 30px; height: 30px; font-size: 1rem; }
.line-total { justify-self: end; align-self: center; font-variant-numeric: tabular-nums; }

.checkout {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
  background: var(--cream);
  overflow-y: auto;
  max-height: 62dvh;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-weight: 700;
}
.cart-total strong {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.fields { display: grid; gap: 12px; margin-bottom: 16px; }
.fields label { display: grid; gap: 5px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.fields input,
.fields textarea,
.chat-input input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
}
.fields input:focus,
.fields textarea:focus,
.chat-input input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--ink); }
.fields textarea { resize: vertical; }
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.seg legend { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; padding: 0; }
.seg label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.seg input { width: auto; margin: 0; accent-color: var(--accent); }
.hint { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 0.8rem; }

/* ===== Mapa da entrega ===== */
.fields input.autofilled { background: #f1f9f4; border-color: var(--green); }
.map-field { display: grid; gap: 8px; }
.map-head, .map-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-head span { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.map {
  height: 220px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e8e2d8;
  z-index: 0; /* o Leaflet usa z-index alto; fica abaixo do resto da gaveta */
}
.map-field.need-pin .map { border-color: var(--red); box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.25); }
.map-field.has-pin .map { border-color: var(--green); }
.map-hint { margin: 0; font-size: 0.78rem; color: var(--muted); }
.map-field.has-pin .map-hint { color: var(--green); font-weight: 700; }
.map-field.need-pin .map-hint { color: var(--red); font-weight: 700; }
.map-btn {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.map-btn:hover { border-color: var(--accent); color: var(--accent); }
.map-btn:disabled { opacity: 0.6; cursor: progress; }
/* Pino em gota na cor da casa */
.pin span {
  position: absolute;
  left: 3px;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transform: rotate(-45deg);
}
.pin span::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}
.leaflet-container { font: inherit; }

/* ===== Barra do carrinho (fixa embaixo) ===== */
.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 32;
  width: min(560px, calc(100% - 32px));
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 22px 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 1.08rem;
  font-weight: 800;
  box-shadow: 0 18px 40px -10px rgba(154, 52, 18, 0.65), 0 0 0 4px rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
  animation: bar-in 0.35s var(--ease);
  transition: background 0.15s;
}
.cart-bar:hover { background: var(--accent-dark); }
.cart-bar:active { transform: translateX(-50%) scale(0.98); }
.cart-bar-count {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 1.05rem;
}
.cart-bar-label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cart-bar-total { font-variant-numeric: tabular-nums; }
.cart-bar.pulse { animation: bar-pulse 0.45s var(--ease); }
@keyframes bar-in { from { transform: translate(-50%, 140%); } }
@keyframes bar-pulse { 40% { transform: translateX(-50%) scale(1.04); } }

/* Com a barra visível: o chat sobe e o fim da página ganha espaço */
.has-cart-bar .chat-fab { bottom: 100px; }
.has-cart-bar .chat { bottom: 168px; height: min(520px, calc(100dvh - 200px)); }
.has-cart-bar .toast { bottom: 100px; }
.has-cart-bar .footer { padding-bottom: 120px; }

/* ===== Chat ===== */
.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--green);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 14px 30px -8px rgba(47, 125, 79, 0.55);
  transition: transform 0.2s var(--ease), background 0.15s;
}
.chat-fab:hover { background: #256640; transform: translateY(-2px); }
.chat-fab .badge { background: var(--red); color: #fff; }

.chat {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 35;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 130px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(29, 20, 16, 0.28);
  overflow: hidden;
  animation: pop 0.25s var(--ease);
  transform-origin: bottom right;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--cream);
}
.chat-head .icon-btn { color: var(--cream); }
.chat-head .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.chat-head strong { display: block; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.online { font-size: 0.76rem; color: #9be3b5; }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg.cliente { align-self: flex-end; align-items: flex-end; }
.msg.loja { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 10px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.93rem;
  line-height: 1.45;
}
.msg.cliente .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.loja .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg time { margin-top: 3px; font-size: 0.7rem; color: var(--muted); }
.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input input { flex: 1; border-radius: var(--radius-pill); }
.chat-input .btn { padding: 10px 18px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  /* Escondido de verdade: fora da tela, transparente e sem receber toque.
     Antes ficava um pedaço preto visível embaixo quando o aviso estava vazio. */
  transform: translate(-50%, 24px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), opacity 0.25s ease, visibility 0s linear 0.35s;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition: transform 0.35s var(--ease), opacity 0.2s ease, visibility 0s;
}

/* ===== Celular: alvos de toque de 40px+, cards horizontais, leitura confortável ===== */
@media (max-width: 600px) {
  :root { --topbar-h: 58px; }
  .topbar { padding: 0 14px; }
  .brand { font-size: 1.08rem; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .top-right { gap: var(--space-2); }
  .admin-link { display: inline-flex; align-items: center; min-height: 40px; font-size: 0.75rem; }
  .cart-btn { height: 40px; padding: 0 14px; }
  .cart-label { display: none; }

  .hero { padding: 44px 18px 52px; }
  .hero-cta .btn { flex: 1 1 140px; }
  .hero-facts { gap: 8px 18px; margin-top: 28px; font-size: 0.84rem; }

  .cats { padding: 10px 14px; }

  .menu { padding: 0 14px 104px; } /* espaço para o botão do chat não cobrir o último item */
  .cat { padding-top: 30px; }
  .cat-head { margin-bottom: 14px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }

  .card { flex-direction: row; align-items: stretch; }
  .card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .media { flex: 0 0 112px; aspect-ratio: auto; min-height: 120px; }
  .icon { font-size: 2.4rem; }
  .tag { top: 8px; left: 8px; padding: 3px 7px; font-size: 0.62rem; }
  .info { padding: 12px 14px; }
  .info h3 { font-size: 1.05rem; }
  .info p { font-size: 0.86rem; margin-bottom: 10px; }
  .qty button { width: 40px; height: 40px; font-size: 1.2rem; }
  .qty .add { height: 40px; padding: 0 16px; font-size: 0.92rem; }

  .drawer { width: 100%; }
  .line { grid-template-columns: 1fr auto; }
  .line .qty { grid-column: 1; }
  .line-total { grid-column: 2; grid-row: 1; }
  .line .qty button { width: 40px; height: 40px; }
  .map { height: 240px; }
  .map-btn { min-height: 40px; }

  .chat { right: 8px; left: 8px; width: auto; bottom: 84px; }
  .chat-fab { right: 14px; bottom: 14px; height: 50px; padding: 0 18px 0 16px; }

  .cart-bar { bottom: 12px; width: calc(100% - 24px); height: 60px; font-size: 1rem; padding: 0 18px 0 10px; }
  .has-cart-bar .chat-fab { bottom: 84px; }
  .has-cart-bar .chat { bottom: 146px; height: min(500px, calc(100dvh - 170px)); }
  .has-cart-bar .toast { bottom: 148px; } /* acima do botão do chat */
  .has-cart-bar .menu { padding-bottom: 170px; }
}

/* ---------- Acompanhar pedido (topo do chat) ---------- */
.order-track { display: grid; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,.08); background: #fff7ec; max-height: 42%; overflow-y: auto; }
.track { display: grid; gap: 8px; }
.track + .track { padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); }
.track-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.track-status { font-weight: 700; color: var(--accent); font-size: 13px; }
.track-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.track-bar li { height: 5px; border-radius: 3px; background: rgba(0,0,0,.1); }
.track-bar li.on { background: var(--accent); }
.track-code { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: #fff; }
.track-code span { display: grid; font-weight: 700; font-size: 13px; }
.track-code small { font-weight: 500; opacity: .7; font-size: 11px; }
.track-code b { font: 800 28px/1 Manrope, monospace; letter-spacing: .18em; color: var(--gold); }

/* =====================================================================
   Celular (ajuste fino): abertura compacta para o cardápio aparecer logo,
   chat redondo ao lado da barra do carrinho (sem cobrir os botões + e −),
   respeito à área do gesto/entalhe do iPhone e campos sem zoom automático.
   ===================================================================== */
html, body { overflow-x: clip; }
@media (max-width: 600px) {
  .hero { padding: 26px 18px 34px; }
  .eyebrow { margin-bottom: 14px; padding: 5px 12px; font-size: 0.72rem; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 2.9rem); }
  .lead { margin-top: 10px; font-size: 0.95rem; }
  .hero-cta { margin-top: 18px; gap: 10px; }
  .hero-cta .btn { min-height: 46px; padding: 0 16px; }
  .hero-facts { margin-top: 16px; gap: 6px 14px; font-size: 0.8rem; }

  /* Chat: botão redondo no canto */
  .chat-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 58px; height: 58px; padding: 0; justify-content: center; border-radius: 50%; }
  .chat-fab .fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chat-fab svg { width: 24px; height: 24px; }
  .chat-fab .badge { position: absolute; top: -4px; right: -4px; box-shadow: 0 0 0 2px #fff; }
  .chat { bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* Barra do carrinho na mesma linha do chat, à esquerda dele */
  .cart-bar { left: calc(50% - 35px); width: calc(100% - 94px); bottom: calc(12px + env(safe-area-inset-bottom)); height: 58px; gap: 10px; padding: 0 14px 0 8px; font-size: 0.98rem; }
  .cart-bar-count { min-width: 40px; height: 40px; }
  .has-cart-bar .chat-fab { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .has-cart-bar .chat { bottom: calc(80px + env(safe-area-inset-bottom)); height: min(520px, calc(100dvh - 150px)); }
  .has-cart-bar .toast, .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .menu, .has-cart-bar .menu { padding-bottom: 96px; }
  .has-cart-bar .footer { padding-bottom: 96px; }

  /* Campos com 16px: o iPhone não dá zoom ao tocar */
  .fields input, .fields textarea, .fields select, .chat-input input { font-size: 16px; }
  .drawer .checkout, .drawer-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .chat-input { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .cart-bar-label svg { display: none; }
  .cart-bar { font-size: 0.92rem; }
}

/* Celular: carrinho com uma rolagem só e o botão de enviar sempre à vista */
@media (max-width: 600px) {
  #cart.drawer { overflow-y: auto; overscroll-behavior: contain; }
  #cart .drawer-head { position: sticky; top: 0; z-index: 2; background: var(--paper); }
  #cart .cart-lines { flex: none; overflow: visible; }
  #cart .checkout { flex: none; max-height: none; overflow: visible; padding-bottom: 0; }
  #cart #send-order {
    position: sticky;
    bottom: 0;
    z-index: 2;
    min-height: 54px;
    margin-top: 6px;
    box-shadow: 0 0 0 10px var(--cream), 0 -12px 24px 6px var(--cream);
  }
  #cart .checkout .hint { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ---------- Entregador ao vivo (cliente) ---------- */
.track-live { display: grid; gap: 6px; margin-bottom: 4px; }
.track-live:not([hidden]) + #track-list .track:first-child { padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.12); }
.track-map { height: 170px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(0,0,0,.1); background: #e8e2d8; z-index: 0; }
.track-live-info { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.track-pin span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 3px 10px rgba(0,0,0,.3); font-size: 18px; line-height: 1; }
.track-pin.moto span { border-color: var(--green); font-size: 22px; animation: moto-pulse 2s infinite; }
.track-pin.home span { border-color: var(--ink); }
@keyframes moto-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,125,79,.5), 0 3px 10px rgba(0,0,0,.3); } 70% { box-shadow: 0 0 0 14px rgba(47,125,79,0), 0 3px 10px rgba(0,0,0,.3); } 100% { box-shadow: 0 0 0 0 rgba(47,125,79,0), 0 3px 10px rgba(0,0,0,.3); } }
.order-track { max-height: 62%; }

/* Aviso fixo "a caminho" (fora do chat) */
.live-pill {
  position: fixed; left: 50%; bottom: 96px; z-index: 31; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 10px 16px; border: 0; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 0.9rem; white-space: nowrap;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.45); cursor: pointer;
}
.live-pill b { color: var(--gold); }
.live-pill .live-dot { width: 10px; height: 10px; border-radius: 50%; background: #5fd08b; flex: none; animation: moto-pulse 2s infinite; }
.has-cart-bar .live-pill { bottom: 100px; }
@media (max-width: 600px) {
  .live-pill { bottom: calc(80px + env(safe-area-inset-bottom)); font-size: 0.84rem; padding: 9px 14px; }
  .has-cart-bar .live-pill { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .track-map { height: 150px; }
}
@media (prefers-reduced-motion: reduce) { .track-pin.moto span, .live-pill .live-dot { animation: none; } }

/* Celular: chat em tela cheia (como um app de mensagens) */
@media (max-width: 600px) {
  .chat,
  .has-cart-bar .chat {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    z-index: 60;
    animation: sheet-up 0.25s var(--ease);
  }
  .chat .chat-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .chat .chat-head .icon-btn { width: 44px; height: 44px; font-size: 1.2rem; }
  .chat .order-track { max-height: 55%; }
  .chat .track-map { height: 190px; }
  body.chat-open { overflow: hidden; }
  body.chat-open .live-pill { display: none; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
