/* Merchant storefront. --brand comes from the merchant's chosen colour. */

:root {
  --brand: #4f46e5;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
  --bg: #f6f7fb;
  --card: #fff;
  --ink: #0f172a;
  --muted: #5b6475;
  --border: #e4e7ee;
  --good: #047857;
  --good-bg: #e7f7f0;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --wait: #8a5a00;
  --wait-bg: #fff6e0;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; }
.fine svg { width: 16px; height: 16px; margin-top: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 64px; padding-block: 10px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 17px; min-width: 0; }
.logo:hover { text-decoration: none; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800; flex: none; }
.logo-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 0 16px; height: 44px; max-width: 560px; margin-inline: auto; }
.search svg { color: var(--muted); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; height: 100%; }
.track-link { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); white-space: nowrap; min-height: 44px; }
@media (max-width: 720px) {
  .top-in { flex-wrap: wrap; gap: 8px 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .track-link { margin-left: auto; }
  .track-link span { font-size: 14px; }
  .logo-name { max-width: 52vw; }
}

/* Hero */

/* Category rail */
.rail { display: flex; gap: 10px; overflow-x: auto; padding: 16px 0 8px; scrollbar-width: thin; }
.rail a { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--ink); font-weight: 600; font-size: 14px; min-height: 44px; }
.rail a:hover { text-decoration: none; border-color: var(--brand); }
.rail a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rail-ic { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.rail-ic img { width: 22px; height: 22px; object-fit: contain; }
.rail-ic.all { color: var(--brand); }
.rail-n { font-size: 12px; color: var(--muted); font-weight: 600; }
.rail a.on .rail-n { color: rgba(255,255,255,.8); }

/* Grid */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 12px; }
.list-head span { color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 40px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--ink); transition: box-shadow .15s, transform .15s, border-color .15s; }
.card:hover { text-decoration: none; box-shadow: 0 10px 28px rgba(15, 23, 42, .08); transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.card-img, .pimg { width: 64px; height: 64px; border-radius: 14px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; margin-bottom: 8px; overflow: hidden; }
.card-img img { width: 44px; height: 44px; object-fit: contain; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.card-name { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card-stock { font-size: 13px; color: var(--muted); margin: 0; }
.card-stock.ok { color: var(--good); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; gap: 8px; }
.price { font-size: 19px; font-weight: 800; }
.cta { background: var(--brand); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; }
.card.gone { filter: grayscale(1); opacity: .6; }
.card.gone .cta { background: var(--muted); }
@media (max-width: 520px) { .card { padding: 12px; } .price { font-size: 16px; } .cta { padding: 5px 10px; } }

/* Panels, product page */
main.wrap { padding-top: 20px; }
.crumb { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px; }
.panel.narrow { max-width: 460px; margin: 40px auto; }
.panel.center { text-align: center; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; margin-bottom: 48px; }
@media (max-width: 900px) { .pgrid { grid-template-columns: 1fr; } }
.phead { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.pimg { width: 88px; height: 88px; flex: none; margin: 0; }
.pimg img { width: 60px; height: 60px; object-fit: contain; }
.about { color: #334155; border-top: 1px solid var(--border); padding-top: 16px; overflow-wrap: anywhere; }
.buybox { position: sticky; top: 84px; }
@media (max-width: 900px) { .buybox { position: static; } }
.big-price { font-size: 32px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.02em; }
.big-price small { font-size: 15px; color: var(--muted); font-weight: 600; }
.buy, .stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label small { color: var(--muted); font-weight: 500; }
input[type=text], input[type=search], input[type=email], input[type=number], input:not([type]) { height: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: #fff; font-weight: 500; }
input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search input[type=search] { border: 0; border-radius: 0; padding: 0; height: 100%; background: transparent; }
.search input:focus { box-shadow: none; }
label > span:first-child { display: inline-flex; gap: 4px; align-items: baseline; }
.qty-row { display: flex; align-items: center; justify-content: space-between; }
.stepper { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: #f1f3f8; font-size: 20px; cursor: pointer; }
.stepper input { width: 56px; height: 44px; border: 0; border-radius: 0; text-align: center; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.total-box { display: flex; justify-content: space-between; align-items: center; background: var(--brand-soft); border-radius: 14px; padding: 14px 16px; }
.total-box b { font-size: 24px; }
.methods { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.methods legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.method { flex: 1; min-width: 130px; flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 48px; }
.method:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.method input { accent-color: var(--brand); margin: 0; }
.method img { border-radius: 6px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: #334155; }
.amt { font-weight: 800; color: var(--ink); }
.paynum { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; background: #f1f3f8; border-radius: 12px; padding: 6px 6px 6px 14px; }
.paynum code { font-size: 19px; font-weight: 700; letter-spacing: .04em; }
.copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; min-height: 40px; }
.copy.done { color: var(--good); border-color: var(--good); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 12px; padding: 0 20px; min-height: 48px; font-weight: 700; cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn.busy { opacity: .7; cursor: progress; }
.note { border-radius: 12px; padding: 12px 14px; margin: 0 0 4px; font-size: 14px; }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.good { background: var(--good-bg); color: var(--good); margin: 20px 0 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.dock { display: none; }
@media (max-width: 900px) {
  .dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-top: 1px solid var(--border); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .dock b { font-size: 20px; }
  body:has(.dock) .foot { padding-bottom: 90px; }
}

/* Order page */
.progress { list-style: none; display: flex; gap: 8px; padding: 0; margin: 8px 0 20px; }
.progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); position: relative; text-align: center; }
.progress li span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eef0f5; font-weight: 700; z-index: 1; }
.progress li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--border); }
.progress li.done span { background: var(--good); color: #fff; }
.progress li.done { color: var(--good); }
.progress li.now span { background: var(--brand); color: #fff; }
.progress li.now { color: var(--ink); }
.progress.stopped li.now span { background: var(--bad); }
.waiting { display: flex; gap: 12px; align-items: flex-start; background: var(--wait-bg); color: var(--wait); border-radius: 14px; padding: 14px 16px; }
.waiting svg { width: 22px; height: 22px; margin-top: 2px; }
.waiting p { margin: 2px 0 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; color: var(--good); }
.goods { background: #0f172a; color: #e2e8f0; border-radius: 14px; padding: 16px; white-space: pre-wrap; word-break: break-all; font-size: 14px; margin: 0; }
.sum { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; }
.sum dt { color: var(--muted); }
.sum dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.help-title { font-weight: 700; margin: 20px 0 8px; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; }
.big-ic svg { width: 40px; height: 40px; color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--border); background: #fff; margin-top: 24px; padding: 24px 0; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot-in p { margin: 4px 0 0; color: var(--muted); max-width: 420px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; min-height: 44px; }
@media (max-width: 520px) {
  .panel { padding: 18px; }
  .phead h1 { font-size: 21px; }
}

/* Merchant logo */
.mark.has-logo { background: #fff; border: 1px solid var(--border); overflow: hidden; width: auto; min-width: 40px; max-width: 120px; padding: 0; }
.mark.has-logo img { height: 38px; width: auto; max-width: 118px; object-fit: contain; display: block; }
@media (max-width: 720px) {
  .mark.has-logo { max-width: 88px; }
  .mark.has-logo img { max-width: 86px; height: 34px; }
  .logo:has(.has-logo) .logo-name { max-width: 34vw; font-size: 15px; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate; margin: 4px 0 8px; padding: 44px 44px 40px; border-radius: 28px; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 92%, #fff) 0%, var(--brand) 45%, color-mix(in srgb, var(--brand) 55%, #000) 100%);
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--brand) 70%, transparent);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before { content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 36px 36px; mask-image: radial-gradient(ellipse 70% 90% at 75% 40%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 70% 90% at 75% 40%, #000 10%, transparent 70%); }
.hero-bg i { position: absolute; border-radius: 50%; filter: blur(60px); }
.hero-bg .b1 { width: 340px; height: 340px; right: -80px; top: -120px; background: rgba(255,255,255,.28); }
.hero-bg .b2 { width: 280px; height: 280px; left: 30%; bottom: -160px; background: color-mix(in srgb, var(--brand) 40%, #fff); opacity: .45; }
.hero-bg .b3 { width: 200px; height: 200px; left: -60px; top: -60px; background: rgba(0,0,0,.25); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); }
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74,222,128,0); } }
.hero-title { display: flex; align-items: center; gap: 16px; margin: 16px 0 10px; }
.hero h1 { margin: 0; color: #fff; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; text-shadow: 0 2px 20px rgba(0,0,0,.15); }
.hero-logo { flex: none; height: 72px; min-width: 72px; max-width: 170px; border-radius: 20px; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.hero-logo img { max-height: 56px; max-width: 154px; object-fit: contain; display: block; }
.hero-sub { margin: 0; max-width: 520px; font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero .btn.hero-main { background: #fff; color: var(--brand); border-color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.hero .btn.hero-main span { transition: transform .15s; }
.hero .btn.hero-main:hover span { transform: translateX(3px); }
.hero .btn.hero-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.hero .btn.hero-ghost img { border-radius: 50%; background: #fff; }
.hero-stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 2px solid rgba(255,255,255,.3); }
.hero-stats b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.hero-stats span { font-size: 12.5px; color: rgba(255,255,255,.8); }
.hero-stats .pay-marks { display: flex; gap: 6px; height: 26px; align-items: center; }
.pay-marks img { width: 26px; height: 26px; border-radius: 7px; background: #fff; }

.hero-show { position: relative; height: 300px; }
.float { position: absolute; display: flex; align-items: center; gap: 12px; width: min(330px, 100%); padding: 12px 14px; border-radius: 18px; color: var(--ink);
  background: rgba(255,255,255,.96); box-shadow: 0 20px 40px -12px rgba(0,0,0,.35); animation: bob 6s ease-in-out infinite; }
.float:hover { text-decoration: none; }
.float.f1 { top: 6px; right: 4%; transform: rotate(2deg); }
.float.f2 { top: 104px; left: 0; transform: rotate(-2deg); animation-delay: -2s; z-index: 2; }
.float.f3 { top: 202px; right: 10%; transform: rotate(1deg); animation-delay: -4s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.f-img { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; background: #fff; }
.f-img img { width: 30px; height: 30px; object-fit: contain; }
.f-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.f-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-text small { color: var(--muted); font-size: 12px; }
.f-price { font-weight: 800; font-size: 16px; color: var(--brand); white-space: nowrap; }
.hero-chip { position: absolute; left: 8%; bottom: -6px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: #111827; color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.25); z-index: 3; }
.hero-chip svg { color: #facc15; width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .float, .hero-badge i { animation: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 32px 28px; }
  .hero-show { display: none; }
}
@media (max-width: 520px) {
  .hero { padding: 24px 20px; border-radius: 22px; }
  .hero-title { gap: 12px; margin-top: 14px; }
  .hero-logo { height: 54px; min-width: 54px; max-width: 120px; border-radius: 14px; padding: 6px; }
  .hero-logo img { max-height: 42px; max-width: 108px; }
  .hero-sub { font-size: 14.5px; }
  .hero-cta .btn { flex: 1; white-space: nowrap; padding: 0 14px; font-size: 14.5px; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
  .hero-stats li { padding-left: 10px; min-width: 0; }
  .hero-stats b { font-size: 20px; }
  .hero-stats span { font-size: 11.5px; }
  .hero-stats .pay-marks { height: 24px; }
  .pay-marks img { width: 22px; height: 22px; border-radius: 6px; }
  .hero h1 { font-size: 28px; }
}
