:root {
  --ink: #111936;
  --muted: #737b92;
  --accent: #43aec0;
  --accent-dark: #268c9e;
  --accent-soft: #daf4f7;
  --surface: #ffffff;
  --canvas: #f4f6f7;
  --soft: #f0f1f3;
  --line: #e6e8ec;
  --danger: #c94358;
  --success: #12a66a;
  --radius-card: 22px;
  --radius-control: 14px;
  --shadow: 0 12px 30px rgba(17, 25, 54, .10);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); }
button, input { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; }
img { display: block; width: 100%; }
.stage { min-height: 100vh; display: grid; place-items: center; }
.phone { position: relative; width: min(100%, 430px); min-height: 100dvh; background: var(--surface); overflow: hidden; box-shadow: 0 0 0 1px rgba(17,25,54,.05), 0 24px 70px rgba(17,25,54,.14); }
.screen { min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 20px calc(116px + env(safe-area-inset-bottom)); animation: appear .22s cubic-bezier(.23,1,.32,1); }
.screen.no-tabs { padding-bottom: calc(34px + env(safe-area-inset-bottom)); }
@keyframes appear { from { opacity: 0; transform: translateY(5px) } }
.topbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 30px; letter-spacing: -.04em; line-height: 1.05; }
h2 { margin-bottom: 14px; font-size: 21px; letter-spacing: -.025em; }
h3 { margin-bottom: 4px; font-size: 16px; line-height: 1.25; }
.subtitle, .muted { color: var(--muted); }
.subtitle { margin: 0; font-size: 14px; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; }
.icon-btn svg, .nav-icon svg, .small-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-radius: 16px; background: var(--soft); margin-bottom: 22px; }
.search svg { width: 20px; stroke: var(--muted); fill: none; stroke-width: 2; }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; }
.clear-search { background: transparent; color: var(--muted); padding: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 25px 0 12px; }
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-size: 12px; }
.drop-card { position: relative; min-height: 212px; overflow: hidden; border-radius: 26px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.drop-photo { position: absolute; inset: 0 0 0 42%; background-image: url('assets/marketplace-sprite.png'); background-size: 400% 200%; background-position: 0 0; }
.drop-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink), transparent 70%); }
.drop-copy { position: relative; z-index: 1; width: 67%; padding: 22px; }
.drop-copy .chip { background: rgba(255,255,255,.15); color: #fff; }
.drop-copy h2 { font-size: 25px; margin: 18px 0 6px; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 16px; }
.price { font-weight: 850; font-variant-numeric: tabular-nums; }
.old-price { opacity: .65; text-decoration: line-through; font-size: 13px; }
.mini-btn, .primary, .secondary { min-height: 48px; border-radius: 999px; font-weight: 750; }
.mini-btn { padding: 0 17px; background: white; color: var(--ink); }
.primary { width: 100%; background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(67,174,192,.25); }
.secondary { width: 100%; background: var(--soft); color: var(--ink); }
.primary:active, .secondary:active, .mini-btn:active, .icon-btn:active, .card:active { transform: scale(.98); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border-radius: 999px; background: var(--soft); color: var(--muted); padding: 10px 14px; font-weight: 700; font-size: 13px; }
.chip.active { background: var(--ink); color: white; }
.merchant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; text-align: left; transition: transform .12s ease; }
.merchant-card .photo { height: 118px; }
.card-copy { padding: 13px; }
.card-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.concept { display: inline-block; margin-top: 9px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.photo { background-image: url('assets/marketplace-sprite.png'); background-size: 400% 200%; background-repeat: no-repeat; background-color: var(--soft); }
.photo-0 { background-position: 0 0; } .photo-1 { background-position: 33.333% 0; }
.photo-2 { background-position: 66.666% 0; } .photo-3 { background-position: 100% 0; }
.photo-4 { background-position: 0 100%; } .photo-5 { background-position: 33.333% 100%; }
.photo-6 { background-position: 66.666% 100%; } .photo-7 { background-position: 100% 100%; }
.empty { text-align: center; padding: 48px 22px; border: 1px dashed var(--line); border-radius: var(--radius-card); }
.empty .small-icon { margin: 0 auto 14px; }
.bottom-nav { position: fixed; z-index: 20; left: 50%; translate: -50% 0; width: min(100%, 430px); bottom: 0; min-height: calc(86px + env(safe-area-inset-bottom)); padding: 9px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,1fr); }
.nav-item { position: relative; min-height: 72px; background: transparent; color: #b4b7bd; display: grid; justify-items: center; align-content: center; gap: 4px; font-size: 11px; font-weight: 700; }
.nav-icon { width: 34px; height: 34px; display: grid; place-items: center; }
.nav-item.active { color: var(--ink); }
.nav-item.active .nav-icon { width: 58px; height: 58px; margin-top: -34px; border-radius: 50%; color: white; background: var(--accent); box-shadow: 0 0 0 9px white, 0 8px 22px rgba(17,25,54,.17); }
.nav-item.active .nav-icon svg { width: 25px; height: 25px; }
.nav-item.active span:last-child { margin-top: 5px; }
.cart-badge { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; padding: 0 5px; background: var(--ink); color: white; font-size: 10px; }
.hero { position: relative; height: 220px; margin: -20px -20px 20px; overflow: hidden; background-image: url('assets/marketplace-sprite.png'); background-size: 400% 200%; background-position: 0 0; }
.hero::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(17,25,54,.9)); }
.hero-actions { position: absolute; z-index: 2; inset: 16px 16px auto; display: flex; justify-content: space-between; }
.hero-actions .icon-btn { background: rgba(255,255,255,.93); }
.hero-title { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 16px; color: white; }
.hero-title h1 { font-size: 26px; }
.hero-title p { margin: 5px 0 0; font-size: 13px; opacity: .82; }
.notice { background: var(--accent-soft); color: #246b78; border-radius: 14px; padding: 11px 13px; font-size: 12px; line-height: 1.4; margin: 14px 0; }
.menu-tabs { position: sticky; top: 0; z-index: 3; background: white; margin: 0 -20px; padding: 10px 20px; }
.product-list { display: grid; gap: 12px; margin-top: 12px; }
.product { display: grid; grid-template-columns: 112px 1fr; min-height: 122px; }
.product .photo { min-height: 100%; }
.product .card-copy { display: flex; flex-direction: column; align-items: flex-start; }
.product .card-copy p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { width: 100%; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.add { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: white; font-size: 22px; line-height: 1; }
.floating-cart { position: fixed; z-index: 25; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; width: min(calc(100% - 40px), 390px); min-height: 58px; border-radius: 999px; background: var(--ink); color: #fff; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.modal-backdrop { position: absolute; z-index: 50; inset: 0; background: rgba(17,25,54,.42); display: flex; align-items: flex-end; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0 } }
.sheet { width: 100%; max-height: 92%; overflow-y: auto; border-radius: 28px 28px 0 0; background: white; padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); animation: sheet .3s cubic-bezier(.23,1,.32,1); }
@keyframes sheet { from { transform: translateY(100%) } }
.handle { width: 40px; height: 5px; border-radius: 99px; background: #d3d5d9; margin: 0 auto 14px; }
.detail-photo { height: 235px; border-radius: var(--radius-card); margin-bottom: 20px; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; }
.detail-head h2 { font-size: 25px; }
.stepper { height: 46px; display: inline-flex; align-items: center; background: var(--soft); border-radius: 999px; padding: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; background: white; font-size: 20px; }
.stepper span { min-width: 38px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.sheet-actions { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.cart-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-row .photo { height: 76px; border-radius: 16px; }
.cart-row-head { display: flex; justify-content: space-between; gap: 8px; }
.cart-row-head h3 { margin: 0; }
.remove { background: transparent; color: var(--danger); font-size: 12px; padding: 0; }
.cart-row-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.cart-row .stepper { height: 36px; }
.cart-row .stepper button { width: 29px; height: 29px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 24px; }
.choice { min-height: 70px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: white; text-align: left; }
.choice.active { border-color: var(--accent); background: var(--accent-soft); }
.choice small { display: block; color: var(--muted); margin-top: 4px; }
.summary { background: var(--soft); border-radius: var(--radius-card); padding: 18px; margin: 18px 0; }
.summary-line { display: flex; justify-content: space-between; gap: 20px; margin: 10px 0; color: var(--muted); font-size: 14px; }
.summary-line.total { padding-top: 13px; border-top: 1px solid #d8dbe0; color: var(--ink); font-size: 18px; font-weight: 850; }
.payment-method { display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px solid var(--accent); border-radius: var(--radius-card); }
.vult-mark { width: 45px; height: 45px; border-radius: 14px; background: var(--accent); color: white; display: grid; place-items: center; font-weight: 900; font-size: 20px; }
.grow { flex: 1; }
.payment-actions { display: grid; gap: 10px; margin-top: 24px; }
.text-button { background: transparent; color: var(--muted); min-height: 44px; font-weight: 700; }
.state-screen { display: grid; align-content: center; text-align: center; min-height: calc(100dvh - 80px); }
.state-icon { width: 86px; height: 86px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--success); }
.state-icon.danger { background: var(--danger); }
.state-icon svg { width: 42px; height: 42px; stroke: currentColor; fill: none; stroke-width: 2; }
.state-screen h1 { font-size: 30px; }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg) } }
.order-ref { display: inline-block; margin: 9px auto 20px; padding: 9px 13px; border-radius: 999px; background: var(--soft); font-weight: 800; font-variant-numeric: tabular-nums; }
.preview-products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-products .photo { height: 130px; }
.placeholder { display: grid; align-content: center; min-height: 70dvh; text-align: center; }
.placeholder .small-icon { margin: 0 auto 18px; }
.small-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 112px; transform: translate(-50%, 20px); opacity: 0; width: min(calc(100% - 40px), 360px); padding: 13px 16px; border-radius: 999px; background: var(--ink); color: white; text-align: center; font-size: 13px; font-weight: 700; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-bar { margin-top: 24px; display: flex; justify-content: center; }
.demo-bar button { background: transparent; color: var(--muted); font-size: 12px; text-decoration: underline; }

@media (max-width: 360px) {
  .screen { padding-left: 16px; padding-right: 16px; }
  .merchant-grid { grid-template-columns: 1fr; }
  .drop-copy { width: 76%; }
  .drop-photo { left: 35%; }
}
@media (min-width: 431px) {
  .phone { min-height: min(900px, 96dvh); height: min(900px, 96dvh); border-radius: 34px; }
  .screen { min-height: 100%; height: 100%; overflow-y: auto; }
  .bottom-nav, .modal-backdrop { position: absolute; left: 0; translate: 0 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
