/* ============== FLAME.DELIVERY — mobile-first design system ============== */
:root {
  --primary: #dc2626;
  --primary-foreground: #fff;
  --flame: #f59e0b;
  --bg: #fafaf5;
  --card: #ffffff;
  --foreground: #1a120b;
  --muted: #f2eeea;
  --muted-foreground: #7a716b;
  --border: #eae4de;
  --destructive: #dc2626;
  --radius: 0.9rem;
  --shadow-primary: 0 20px 40px -20px rgba(220,38,38,.55);
}
* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #eeeae5;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1,h2,h3,.font-display { font-family: 'Bebas Neue', system-ui, sans-serif; letter-spacing: .02em; margin: 0; font-weight: 400; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* Layout */
.frame-outer { min-height: 100vh; background: #eeeae5; }
.frame { max-width: 28rem; margin: 0 auto; min-height: 100vh; background: var(--bg); box-shadow: 0 20px 60px rgba(0,0,0,.12); position: relative; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(250,250,245,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar.transparent { border: none; background: transparent; }
.topbar-left { display: flex; align-items: center; gap: 8px; }
.logo { display: inline-flex; align-items: center; font-family: 'Bebas Neue'; font-size: 26px; color: var(--primary); }
.logo .dot { color: var(--foreground); }
.logo-badge { margin-left: 4px; background: var(--primary); color: #fff; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid var(--border); position: relative; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; background: var(--primary); color: #fff; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Icons */
.icon { width: 20px; height: 20px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 12px; height: 12px; }

/* Hero */
.hero { border-radius: 24px; overflow: hidden; margin-top: 16px; position: relative; }
.hero img { width: 100%; height: 176px; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,.3) 50%, transparent); }
.hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.hero-content h2 { font-size: 30px; line-height: 1; margin-top: 8px; }
.hero-content p { font-size: 12px; opacity: .9; margin: 4px 0 0; }

/* Info bar */
.address { display: flex; align-items: center; gap: 8px; padding: 0; margin: 0; text-align: left; width: 100%; }
.address .icon { color: var(--primary); width: 16px; height: 16px; }
.address .up { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); }
.address .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 12px; margin-top: 16px; font-size: 14px; }
.stats > .sep { width: 1px; height: 16px; background: var(--border); }
.stats .star { color: var(--flame); fill: var(--flame); }
.muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Search */
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 12px 16px; margin-top: 16px; }
.search input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; }

/* Section */
.section { padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; margin-bottom: 8px; }
.section-title h3 { font-size: 20px; }

/* Horizontal scroll */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.card-feat { width: 160px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); background: var(--card); border-radius: 16px; }
.card-feat img { width: 100%; height: 96px; object-fit: cover; }
.card-feat-body { padding: 12px; }
.card-feat .tag { display: flex; align-items: center; gap: 4px; color: var(--primary); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.card-feat .name { font-size: 14px; font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-feat .prices { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.card-feat .old { font-size: 11px; color: var(--muted-foreground); text-decoration: line-through; }
.card-feat .new { font-size: 14px; font-weight: 700; color: var(--primary); }

/* Category tabs */
.tabs { position: sticky; top: 60px; z-index: 20; background: rgba(250,250,245,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.tabs-inner { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; background: var(--muted); color: var(--foreground); transition: .15s; }
.tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }

/* Product list */
.plist { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pitem { display: flex; gap: 12px; border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 12px; }
.pitem img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.pitem .body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pitem .rating { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted-foreground); }
.pitem .rating .star { color: var(--flame); fill: var(--flame); }
.pitem h4 { font-size: 14px; font-weight: 600; margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem p { font-size: 12px; color: var(--muted-foreground); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pitem .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.pitem .price { font-weight: 700; color: var(--primary); }
.add-btn { width: 36px; height: 36px; border-radius: 999px; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-primary); transition: transform .15s; }
.add-btn:active { transform: scale(.95); }

.empty { border: 2px dashed var(--border); border-radius: 16px; padding: 32px; text-align: center; font-size: 14px; color: var(--muted-foreground); }

/* Floating cart bar */
.floating { position: sticky; bottom: 0; z-index: 30; padding: 16px; pointer-events: none; }
.floating .pill { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; background: var(--primary); color: #fff; border-radius: 999px; padding: 16px 20px; box-shadow: 0 20px 40px -10px rgba(220,38,38,.5); font-weight: 600; }
.floating .cnt { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 12px; margin-right: 8px; }

/* Product page */
.product-hero { position: relative; }
.product-hero .topbar { position: absolute; left: 0; right: 0; top: 0; }
.product-hero img { width: 100%; height: 288px; object-fit: cover; }
.combo-hero img { height: 240px; }
.product-body { background: var(--bg); border-radius: 24px 24px 0 0; padding: 24px 20px; margin-top: -24px; position: relative; padding-bottom: 128px; }
.product-body h1 { font-size: 28px; margin-top: 4px; }
.product-body .desc { font-size: 14px; color: var(--muted-foreground); margin: 8px 0 0; }

textarea, .input {
  width: 100%; border: 1px solid var(--border); background: var(--card);
  border-radius: 14px; padding: 12px; font-size: 14px; outline: none; resize: none;
}
textarea:focus, .input:focus { border-color: var(--primary); }

.label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); margin-bottom: 6px; }

.qty-pill { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 6px; margin-top: 24px; }
.qty-btn { width: 40px; height: 40px; border-radius: 999px; background: var(--muted); display: grid; place-items: center; }
.qty-btn.primary { background: var(--primary); color: #fff; }
.qty-pill .val { min-width: 32px; text-align: center; font-size: 18px; font-weight: 700; }

.cta-pill { margin-top: 24px; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-radius: 999px; background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); transition: transform .15s; }
.cta-pill:active { transform: scale(.98); }
.cta-pill:disabled { opacity: .5; }

/* Combo groups */
.group { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 16px; margin-top: 16px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-up { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); font-weight: 600; }
.group-name { font-size: 14px; font-weight: 600; margin-top: 2px; }
.chip-count { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--muted); color: var(--foreground); }
.chip-count.complete { background: var(--primary); color: #fff; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: var(--muted); margin-top: 12px; }
.progress .bar { height: 100%; background: var(--primary); transition: width .3s; }
.opts { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--bg); border-radius: 12px; padding: 8px; }
.opt.dashed { border-style: dashed; }
.opt img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.opt .none-box { width: 56px; height: 56px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.opt .info { flex: 1; min-width: 0; }
.opt .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.opt .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .desc { font-size: 11px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.badge-upcharge { background: rgba(245,158,11,.15); color: var(--flame); padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.badge-price { background: rgba(220,38,38,.1); color: var(--primary); padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.badge-locked { background: rgba(220,38,38,.1); color: var(--primary); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.qty-mini { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px; }
.qty-mini button { width: 30px; height: 30px; border-radius: 999px; background: var(--muted); display: grid; place-items: center; color: var(--muted-foreground); }
.qty-mini button.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(220,58,26,.35); }
.qty-mini button:disabled { opacity: .4; }
.qty-mini .val { min-width: 22px; text-align: center; font-size: 15px; font-weight: 700; }
.group-hint { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted-foreground); }

/* Sticky CTA */
.sticky-cta { position: sticky; bottom: 0; padding: 16px; background: linear-gradient(to top, var(--bg) 60%, transparent); }

/* Cart page */
.cart-list { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.cart-item { display: flex; gap: 12px; border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 12px; }
.cart-item img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.cart-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item h4 { font-size: 14px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item .note { font-size: 11px; color: var(--muted-foreground); white-space: pre-line; line-height: 1.35; margin-top: 4px; }
.cart-item .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }

.panel { margin: 0 16px 12px; border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 16px; font-size: 14px; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-head .icon { color: var(--primary); }
.panel-head .title { font-weight: 600; }

.row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.divider { height: 1px; background: var(--border); margin: 8px 0; }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); color: #fff; padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-primary); width: 100%; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-size: 12px; font-weight: 600; }
.pay-opt.active { border-color: var(--primary); background: rgba(220,38,38,.1); color: var(--primary); }

.address-time { display: flex; align-items: center; gap: 8px; background: rgba(220,38,38,.08); border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 600; margin-top: 12px; }
.address-time .icon { color: var(--primary); }
.address-time .time { color: var(--primary); }

/* Checkout PIX */
.timer-bar { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(220,38,38,.3); background: rgba(220,38,38,.1); color: var(--primary); border-radius: 16px; padding: 12px; font-size: 14px; font-weight: 600; }
.timer-bar.expired { border-color: rgba(220,38,38,.4); background: rgba(220,38,38,.15); }
.pix-box { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 16px; }
.qr-holder { margin: 0 auto; display: none; place-items: center; width: 176px; height: 176px; background: #fff; border-radius: 12px; overflow: hidden; }
@media (min-width: 640px) { .qr-holder { display: grid; } }
.qr-holder img { max-width: 100%; height: 100%; object-fit: contain; }
.pix-code { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 12px; }
.pix-code .lab { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); }
.pix-code .val { font-family: 'Courier New', monospace; font-size: 11px; line-height: 1.4; word-break: break-all; color: var(--foreground); margin-top: 4px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--muted); border-top-color: var(--primary); border-radius: 999px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

.order-summary { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 16px; }
.os-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-foreground); margin-bottom: 12px; }
.os-item { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; margin-bottom: 12px; }
.os-item img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.os-item .info { flex: 1; min-width: 0; }
.os-item .info .head { display: flex; align-items: center; gap: 8px; }

/* Success page */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; align-items: flex-start; gap: 12px; }
.timeline .dot { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--muted); color: var(--muted-foreground); display: grid; place-items: center; flex-shrink: 0; }
.timeline li.done .dot { background: var(--primary); color: #fff; border-color: var(--primary); }
.timeline li.active .dot { background: rgba(220,38,38,.1); color: var(--primary); border-color: var(--primary); }
.timeline li.active .lab { font-weight: 700; }
.timeline .lab { font-size: 14px; color: var(--muted-foreground); padding-top: 6px; }
.timeline li.done .lab { color: var(--foreground); font-weight: 500; }
.timeline .working { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--primary); margin-top: 2px; }

.gift-card { border: 1px solid rgba(220,38,38,.3); border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, rgba(220,38,38,.15), var(--card), var(--card)); }
.gift-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.gift-icon { width: 44px; height: 44px; border-radius: 999px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--foreground); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: slideDown .3s ease-out; max-width: calc(100% - 32px); }
.toast.error { background: var(--destructive); }
@keyframes slideDown { from { transform: translate(-50%, -100%); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Empresa banner */
.empresa-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); max-width: 28rem; width: calc(100% - 32px); z-index: 50; background: var(--destructive); color: #fff; border-radius: 16px; padding: 12px; display: flex; align-items: flex-start; gap: 8px; box-shadow: 0 20px 40px rgba(220,38,38,.4); animation: slideDown .4s ease-out; font-size: 12px; font-weight: 600; line-height: 1.35; }

/* Empresa accordion */
.acc-item { border: 1px solid var(--border); background: var(--card); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.acc-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px; text-align: left; }
.acc-head .name { font-weight: 600; }
.acc-head .desc { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.acc-body { padding: 0 16px 16px; display: none; }
.acc-item.open .acc-body { display: block; }
.acc-item.open .acc-head .chev { transform: rotate(180deg); }

/* Empresa loading overlay */
.overlay-loading { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 24px; }
.overlay-loading .box { background: var(--card); border-radius: 20px; padding: 32px; text-align: center; max-width: 320px; }
.overlay-loading .spinner { width: 40px; height: 40px; margin: 0 auto 16px; }

/* Utility */
.hidden { display: none !important; }
.strike { text-decoration: line-through; }
