/* 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 */
.hero { margin: 4px 0 8px; padding: 28px; border-radius: 20px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; }
.hero h1 { font-size: 30px; color: #fff; }
.hero p { margin: 0; max-width: 640px; opacity: .92; }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.trust li { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 13px; font-weight: 600; }
.trust li img { width: 24px; height: 24px; border-radius: 6px; background: #fff; }
.trust li svg { margin-left: 4px; }

/* 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) {
  .hero { padding: 20px; }
  .hero h1 { font-size: 24px; }
  .trust li { font-size: 12px; }
  .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; }
.hero-title { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.hero-title h1 { margin: 0; }
.hero-logo { flex: none; height: 64px; min-width: 64px; max-width: 160px; border-radius: 16px; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 6px; }
.hero-logo img { max-height: 52px; max-width: 148px; object-fit: contain; display: block; }
@media (max-width: 520px) { .hero-logo { height: 52px; min-width: 52px; } .hero-logo img { max-height: 40px; } }
@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-logo { max-width: 120px; }
  .hero-logo img { max-width: 108px; }
}
