:root {
  --cor: #e11d48;
  --cor-2: #0f172a;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --ok: #16a34a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* O atributo hidden precisa vencer os display: flex/grid dos componentes */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 18px; }

h1, h2, h3 { margin: 0 0 6px; line-height: 1.2; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cor-2);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: rgba(255, 255, 255, .7); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ---------------- Botoes ---------------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter .15s, transform .1s, background .15s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cor); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: rgba(255, 255, 255, .12); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .2); }
.btn.light { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.light:hover { background: #f8fafc; }
.btn.grow { flex: 1; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.badge {
  background: rgba(255, 255, 255, .22);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 10px;
}
.icon-btn:hover { background: #f1f5f9; }

/* ---------------- Aviso / hero ---------------- */
.notice {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
  padding: 10px 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.hero {
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-info { padding: 26px; }
.hero-info h1 { font-size: 28px; }
.hero-info p { color: var(--muted); font-size: 15px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; }

/* ---------------- Categorias ---------------- */
.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 14px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cat.active { background: var(--cor); border-color: var(--cor); color: #fff; }

/* ---------------- Catalogo ---------------- */
.catalog { padding-bottom: 60px; }
.cat-section { margin-bottom: 28px; }
.cat-section h2 { font-size: 20px; margin: 18px 0 12px; }

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-media { height: 160px; background: #f1f5f9; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 34px;
}
.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--cor);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 9px;
  border-radius: 999px;
}
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 16px; }
.card-body .desc { color: var(--muted); font-size: 13px; 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; gap: 10px; padding-top: 8px; }
.price { font-weight: 800; color: var(--cor); font-size: 17px; }
.price small { color: var(--muted); font-weight: 500; font-size: 12px; text-decoration: line-through; margin-left: 6px; }
.combo-items { font-size: 12px; color: var(--muted); }
.sold-out { font-size: 12px; font-weight: 700; color: #b91c1c; }

/* ---------------- Drawer / modal ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 40;
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(15, 23, 42, .18);
}
.drawer-head, .drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-foot { border-bottom: 0; border-top: 1px solid var(--line); flex-direction: column; align-items: stretch; }
.drawer-head h2 { font-size: 18px; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .5);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal-card.narrow { width: min(440px, 100%); }
.modal-card .close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(255, 255, 255, .9); }
.pm-image img { width: 100%; height: 210px; object-fit: cover; border-radius: 18px 18px 0 0; }
.pm-body { padding: 20px; }
.pm-body h2 { font-size: 22px; }
.pm-price { font-size: 20px; font-weight: 800; color: var(--cor); margin-bottom: 12px; }

/* ---------------- Carrinho ---------------- */
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #f1f5f9; flex-shrink: 0; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info strong { display: block; font-size: 14px; }
.cart-item .info small { color: var(--muted); display: block; font-size: 12px; line-height: 1.4; }
.cart-item .info .line-total { font-weight: 700; font-size: 14px; }
.cart-item .actions { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.link-danger { background: none; border: 0; color: #b91c1c; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }

.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { border: 0; background: #f8fafc; width: 30px; height: 30px; font-size: 16px; cursor: pointer; color: var(--text); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }

.summary { margin: 12px 0; font-size: 14px; }
.summary .row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--muted); }
.summary .row.total { color: var(--text); font-weight: 800; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.summary .row.discount { color: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---------------- Formularios ---------------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--cor) 35%, transparent); border-color: var(--cor); }
textarea { resize: vertical; }

.segmented { display: flex; gap: 8px; margin-bottom: 12px; }
.segmented button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.segmented button.active { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 10%, #fff); color: var(--cor); }

.pay-list { display: grid; gap: 8px; margin-bottom: 12px; }
.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}
.pay-option input { accent-color: var(--cor); }
.pay-option.active { border-color: var(--cor); background: color-mix(in srgb, var(--cor) 6%, #fff); }

.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { text-transform: uppercase; }
.coupon-msg { font-size: 12px; margin-top: 6px; }
.coupon-msg.ok { color: var(--ok); }
.coupon-msg.err { color: #b91c1c; }

.add-option { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.add-option .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-option label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; flex: 1; }
.add-option input[type="checkbox"] { accent-color: var(--cor); width: 17px; height: 17px; }
.add-option .price-small { color: var(--muted); font-size: 13px; }
.add-option .qty { margin-top: 8px; }

.qty-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }

/* ---------------- Pedido ---------------- */
.order-code {
  background: var(--cor-2);
  color: #fff;
  border-radius: 14px;
  text-align: center;
  padding: 18px;
  margin-bottom: 14px;
}
.order-code small { display: block; opacity: .7; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.order-code strong { font-size: 32px; letter-spacing: .12em; font-family: ui-monospace, Consolas, monospace; }

.steps { list-style: none; padding: 0; margin: 0 0 16px; }
.steps li { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--muted); }
.steps li .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 6px; flex-shrink: 0; }
.steps li.done { color: var(--text); font-weight: 600; }
.steps li.done .dot { background: var(--ok); }
.steps li.current .dot { background: var(--cor); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cor) 20%, transparent); }

.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.alert.info { background: #eff6ff; color: #1e40af; }
.alert.ok { background: #f0fdf4; color: #166534; }
.alert.warn { background: #fffbeb; color: #92400e; }

.track-form { display: flex; gap: 8px; margin: 10px 0 16px; }
.track-form .input { text-transform: uppercase; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--cor-2);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 90;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  max-width: 90vw;
}

.skeleton { height: 240px; border-radius: var(--radius); background: linear-gradient(90deg, #eef1f5, #f8fafc, #eef1f5); background-size: 200% 100%; animation: shine 1.2s infinite; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
@keyframes shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- Rodape ---------------- */
.footer { background: #fff; border-top: 1px solid var(--line); padding: 22px 0; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--cor); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.footer-links .social-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero img { min-height: 160px; max-height: 200px; }
  .brand-text small { display: none; }
  .top-actions .btn { padding: 9px 12px; font-size: 14px; }
  .hero-info { padding: 20px; }
  .hero-info h1 { font-size: 22px; }
  .field.row-2 { grid-template-columns: 1fr; }
}
