:root {
  --brand: #c62828;
  --brand-dark: #8e1b1b;
  --ink: #1d1b1a;
  --muted: #6f6a66;
  --line: #ece7e3;
  --bg: #faf7f4;
  --card: #fff;
  --ok: #1b7f4b;
  --warn: #b26a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- topo ---------- */
.hero {
  background: radial-gradient(120% 140% at 0% 0%, var(--brand) 0%, var(--brand-dark) 70%);
  color: #fff; padding: 28px 0 56px;
}
.hero.has-cover { background-size: cover; background-position: center; }
.store-head { display: flex; gap: 14px; align-items: center; }
.logo {
  width: 72px; height: 72px; border-radius: 50%; flex: none;
  background: #fff; color: var(--brand); display: grid; place-items: center;
  font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255,255,255,.35);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }
.store-head h1 { margin: 0; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.01em; }
.tagline { margin: 10px 0 0; opacity: .9; font-size: .92rem; max-width: 52ch; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: rgba(255,255,255,.18);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #9e9e9e; }
.pill.open .dot { background: #5fe39a; }
.info-btn { background: none; border: 0; color: #fff; text-decoration: underline; font-size: .85rem; padding: 0; margin-left: 8px; opacity: .9; }

/* ---------- barra de categorias ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  margin-top: -36px; padding-top: 0;
}
.searchbox {
  display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow); padding: 0 14px; height: 48px;
}
.searchbox input { border: 0; outline: 0; flex: 1; background: transparent; font-size: 1rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; border: 1px solid var(--line); background: var(--card);
  padding: 7px 14px; border-radius: 99px; font-size: .88rem; font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.closed-banner {
  background: #fff4e5; color: #7a4a00; border: 1px solid #ffd8a8; border-radius: 12px;
  padding: 12px 14px; font-size: .92rem; margin: 6px 0 4px;
}

/* ---------- produtos ---------- */
main { padding-bottom: 120px; }
.cat { scroll-margin-top: 120px; }
.cat h2 { font-size: 1.1rem; margin: 22px 0 10px; letter-spacing: -.01em; }
.grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
.prod {
  display: flex; gap: 12px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  transition: border-color .15s, transform .15s;
}
.prod:hover { border-color: #d9cfc8; }
.prod:active { transform: scale(.99); }
.prod .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod h3 { margin: 0; font-size: .98rem; font-weight: 650; }
.prod p { margin: 4px 0 8px; font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .price { margin-top: auto; font-weight: 700; }
.prod .old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: .85rem; margin-left: 6px; }
.prod img { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex: none; background: var(--line); }
.prod.out { opacity: .55; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #f3ece7; color: var(--muted); margin-top: 6px; align-self: flex-start; }
.tag.half { background: #fdeaea; color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- barra da sacola ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.cartbar button {
  width: 100%; max-width: 728px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center;
  background: var(--brand); color: #fff; border: 0; border-radius: 14px; height: 56px; padding: 0 18px;
  font-weight: 700; font-size: 1rem; box-shadow: 0 8px 24px rgba(198,40,40,.35);
}
.badge { background: rgba(255,255,255,.22); border-radius: 99px; padding: 2px 9px; font-size: .85rem; margin-right: 8px; }

/* ---------- folhas (modais) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(20,14,10,.48); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease-out;
}
@media (min-width: 700px) { .overlay { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 20px 20px 0 0; animation: up .2s ease-out; position: relative;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 700px) { .sheet { border-radius: 20px; } }
.sheet-head {
  position: sticky; top: 0; background: var(--card); z-index: 2;
  display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.sheet-head h3 { margin: 0; font-size: 1.05rem; }
.x { border: 0; background: #f2ede9; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.sheet-body { padding: 16px 18px 8px; }
.sheet-foot {
  position: sticky; bottom: 0; background: var(--card); padding: 12px 18px 16px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center;
}
.prod-img { width: 100%; height: 200px; object-fit: cover; display: block; }
.desc { color: var(--muted); margin: 6px 0 0; }

.group { margin-top: 18px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; background: #f7f2ee; margin: 0 -18px; padding: 10px 18px; }
.group-head b { font-size: .95rem; }
.req { font-size: .72rem; font-weight: 700; background: var(--ink); color: #fff; padding: 2px 8px; border-radius: 99px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt:last-child { border-bottom: 0; }
.opt input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.opt .on { flex: 1; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #f2ede9; border-radius: 12px; padding: 4px; margin-top: 14px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 650; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; height: 50px; }
.qty button { border: 0; background: none; width: 42px; height: 100%; font-size: 1.3rem; color: var(--brand); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }
.btn {
  border: 0; border-radius: 12px; height: 50px; padding: 0 18px; font-weight: 700; font-size: 1rem;
  background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.block { width: 100%; }
.btn.grow { flex: 1; justify-content: space-between; }
.btn.ghost { background: #f2ede9; color: var(--ink); }
.btn.ok { background: var(--ok); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); font-weight: 600; padding: 0; }

label.f { display: block; font-size: .85rem; font-weight: 600; margin: 14px 0 6px; }
.in, select.in, textarea.in {
  width: 100%; border: 1px solid #ddd5cf; border-radius: 11px; padding: 0 13px; height: 48px; background: #fff; font-size: 1rem;
}
textarea.in { height: 76px; padding: 10px 13px; resize: vertical; }
.in:focus { outline: 2px solid rgba(198,40,40,.25); border-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section-t { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 22px 0 4px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 10px; text-align: left; font-weight: 650;
}
.choice button small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.choice button.on { border-color: var(--brand); background: #fff6f6; }
.choice.three { grid-template-columns: 1fr 1fr 1fr; }

.verified { display: flex; align-items: center; justify-content: space-between; background: #ecf7f0; color: var(--ok); border-radius: 11px; padding: 12px 14px; font-weight: 600; }
.otp { letter-spacing: .5em; font-size: 1.4rem; text-align: center; font-weight: 700; }
.alert { border-radius: 11px; padding: 11px 13px; font-size: .9rem; margin-top: 12px; }
.alert.err { background: #fdecea; color: #8a1c13; }
.alert.info { background: #eef4fb; color: #1d4f86; }
.alert.warn { background: #fff4e5; color: #7a4a00; }

.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item .t { flex: 1; }
.cart-item .t b { display: block; font-size: .95rem; }
.cart-item .t small { color: var(--muted); display: block; }
.mini-qty { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; height: 34px; }
.mini-qty button { border: 0; background: none; width: 30px; height: 100%; color: var(--brand); font-size: 1.1rem; }
.totals { margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: .92rem; box-shadow: var(--shadow);
  animation: up .2s ease-out;
}
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-table tr.today td { font-weight: 700; color: var(--brand); }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 0 10px; }
