/* Storefront — marketplace-dense, ink header with a market-amber CTA.
   Prices and order numbers are always tabular/mono: numbers are data. */
:root {
  --hd: #151b26;
  --hd-2: #202839;
  --amber: #f0a028;
  --amber-dark: #d88a12;
  --link: #1f6fb2;
  --bg: #eef0f3;
  --card: #ffffff;
  --line: #dfe3e8;
  --text: #1c2430;
  --muted: #6b7686;
  --ok: #1e7e34;
  --bad: #c22f4d;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 18px 20px 50px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 17px; }

/* ── Header: the search bar is the hero ─────────────────── */
.hd { background: var(--hd); color: #fff; }
.hd-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 12px 20px; }
.logo { color: #fff; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-dot { color: var(--amber); }
.searchbar { flex: 1; display: flex; border-radius: 8px; overflow: hidden; background: #fff; max-width: 720px; }
.searchbar select { border: 0; background: #f0f2f4; padding: 0 10px; font-size: 13px; color: var(--muted); border-right: 1px solid var(--line); max-width: 130px; }
.searchbar input { flex: 1; border: 0; padding: 11px 14px; font-size: 14.5px; min-width: 0; }
.searchbar input:focus, .searchbar select:focus { outline: none; }
.searchbar:focus-within { box-shadow: 0 0 0 3px rgba(240,160,40,.55); }
.searchbar button { border: 0; background: var(--amber); padding: 0 18px; font-size: 19px; cursor: pointer; color: var(--hd); }
.searchbar button:hover { background: var(--amber-dark); }
.cart-link { color: #fff; font-weight: 600; white-space: nowrap; }
.cart-count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 7px; background: var(--amber); color: var(--hd); border-radius: 20px; font-family: var(--mono); font-size: 12.5px; padding: 0 5px; }
.catnav { background: var(--hd-2); padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.catnav a { color: #cfd6e2; padding: 9px 13px; font-size: 13.5px; white-space: nowrap; }
.catnav a:hover, .catnav a.on { color: #fff; box-shadow: inset 0 -3px 0 var(--amber); text-decoration: none; }

/* ── Product grid / cards ───────────────────────────────── */
.sec { margin-bottom: 30px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.more { font-size: 13.5px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.pc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--text); display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s; }
.pc:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(21,27,38,.10); }
.pc-img { aspect-ratio: 1; display: grid; place-items: center; background: #fafbfc; border-radius: 7px; overflow: hidden; }
.pc-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { color: var(--muted); font-size: 12px; }
.pc-name { font-size: 13.5px; line-height: 1.4; height: 3.9em; overflow: hidden; }
.pc-price { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.pc-price s { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 6px; }

/* ── Listing pages ──────────────────────────────────────── */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sub { color: var(--muted); margin-top: 3px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 13.5px; width: 96px; background: #fff; }
.filters select { width: auto; }
.filters button { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.filters button:hover { border-color: var(--muted); }
.none { color: var(--muted); padding: 30px 0; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 22px; align-items: center; }
.pg { background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 7px 13px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.pg.on { border-color: transparent; background: none; color: var(--muted); }

/* ── Product detail: gallery / info / buy box ───────────── */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.pd { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) 280px; gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.pd-main { aspect-ratio: 1; display: grid; place-items: center; background: #fafbfc; border-radius: 10px; overflow: hidden; }
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pd-thumbs img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; border: 2px solid var(--line); cursor: pointer; }
.pd-thumbs img.on, .pd-thumbs img:hover { border-color: var(--amber); }
.pd-info h1 { font-size: 20px; line-height: 1.35; margin-bottom: 10px; }
.pd-short { color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.pd-price { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.pd-price s { font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.buybox { border: 1px solid var(--line); border-radius: 10px; padding: 16px; height: fit-content; background: #fcfdfe; }
.bb-price { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.bb-stock { font-size: 13px; margin-bottom: 12px; }
.bb-stock.ok { color: var(--ok); } .bb-stock.no { color: var(--bad); }
.buybox label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.buybox select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; font-size: 13.5px; background: #fff; }
.bb-add { display: block; width: 100%; margin-top: 15px; background: var(--amber); color: var(--hd); border: 0; border-radius: 24px; padding: 12px; font-size: 14.5px; font-weight: 700; cursor: pointer; text-align: center; }
.bb-add:hover { background: var(--amber-dark); text-decoration: none; }
.bb-add:disabled { background: var(--line); cursor: not-allowed; }
.bb-add.center { width: auto; padding: 12px 22px; }
.pd-desc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-top: 20px; }
.pd-desc h2 { margin-bottom: 12px; }
.rich { line-height: 1.65; overflow-wrap: break-word; }
.rich img { border-radius: 8px; margin: 8px 0; }

/* ── Cart & checkout ────────────────────────────────────── */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 16px; align-items: start; }
.cart-items, .co-form { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px; }
.ci { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ci:last-child { border-bottom: 0; }
.ci-img img { width: 76px; height: 76px; object-fit: contain; background: #fafbfc; border-radius: 8px; }
.ci-body { flex: 1; min-width: 0; }
.ci-name { color: var(--text); font-weight: 600; }
.ci-var { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ci-actions { margin-top: 8px; }
.ci-actions select { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12.5px; }
.ci-price { font-family: var(--mono); font-weight: 700; font-size: 15.5px; }
.cart-sum { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.cs-row { display: flex; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.cs-row strong { font-family: var(--mono); }
.co-form { padding: 20px; }
.co-form h2 { margin-bottom: 6px; }
.co-form label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.co-form input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; font-size: 14px; }
.co-form input:focus { outline: 2px solid var(--amber); outline-offset: 0; border-color: transparent; }
.err { background: #fdeef1; color: var(--bad); border: 1px solid #f5c6d0; border-radius: 8px; padding: 10px 14px; margin-top: 12px; }
.confirm { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 44px; text-align: center; max-width: 560px; margin: 30px auto; }
.confirm-mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #e8f6ec; color: var(--ok); display: grid; place-items: center; font-size: 26px; }
.confirm p { margin-top: 10px; }
.empty-store { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 44px; text-align: center; }
.empty-store p { color: var(--muted); margin-top: 8px; }

/* ── Footer ─────────────────────────────────────────────── */
.ft { background: var(--hd); color: #9aa5b5; font-size: 13px; margin-top: 40px; }
.ft .wrap { display: flex; justify-content: space-between; padding: 20px; }
.ft a { color: #cfd6e2; }

@media (max-width: 980px) {
  .pd { grid-template-columns: 1fr 1fr; }
  .buybox { grid-column: 1 / -1; }
  .cart { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hd-inner { flex-wrap: wrap; }
  .searchbar { order: 3; max-width: none; width: 100%; }
  .pd { grid-template-columns: 1fr; }
}

/* ── Phase 3: accounts & payments ─────────────────────────────────── */
.acct-link a{color:inherit;text-decoration:none;font-size:.92rem;white-space:nowrap;opacity:.9}
.acct-link a:hover{opacity:1;text-decoration:underline}
.auth{max-width:420px;margin:32px auto}
.auth .co-form{display:flex;flex-direction:column;gap:6px}
.notice{background:#eef6ff;border:1px solid #bcd9f7;color:#1b4a7a;padding:10px 14px;border-radius:8px}
.acct-head{display:flex;align-items:center;gap:16px;margin-bottom:12px}
.linkish{background:none;border:none;color:#0a66c2;cursor:pointer;padding:0;font:inherit;text-decoration:underline}
.orders-tbl{width:100%;border-collapse:collapse}
.orders-tbl th,.orders-tbl td{text-align:left;padding:10px 12px;border-bottom:1px solid #e5e5e5}
.badge{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.8rem;background:#eee}
.b-pending{background:#fff3cd;color:#7a5b00}.b-paid{background:#d9f2e3;color:#136f3e}
.b-fulfilling,.b-shipped{background:#e0ecff;color:#1b4a7a}.b-delivered{background:#d9f2e3;color:#136f3e}
.b-cancelled,.b-refunded{background:#fde2e2;color:#8a1f1f}

/* ── Phase 4: shipping options ────────────────────────────────────── */
.ship-opt{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #ddd;border-radius:8px;margin:6px 0;cursor:pointer}
.ship-opt:has(input:checked){border-color:#0a66c2;background:#f4f9ff}
.ship-opt strong{margin-left:auto}

/* ── Phase 5: reviews, wishlist, promos ───────────────────────────── */
.stars{color:#999;font-size:.9rem;white-space:nowrap}
.stars-on{color:#e8a11c}
.stars-n{color:#767676;font-size:.85em}
.nolink{text-decoration:none}
.reviews{margin-top:40px;max-width:760px}
.rev{border-top:1px solid #eee;padding:14px 0}
.rev-head{display:flex;gap:10px;align-items:center}
.rev-meta{color:#767676;font-size:.85rem;margin:4px 0 8px}
.verified{color:#136f3e}
.rev-form{max-width:480px;margin-top:16px}
.rev-form textarea{width:100%;font:inherit;padding:8px}
.wish-form{margin-top:10px}
.wish-btn{width:100%;background:none;border:1px solid #ccc;border-radius:8px;padding:8px;cursor:pointer;font:inherit}
.wish-btn.on{border-color:#c2185b;color:#c2185b}
.pc-wrap form{text-align:center;margin-top:-6px}
.promo-form{display:flex;gap:6px;margin:10px 0;flex-wrap:wrap}
.promo-form input[type=text]{flex:1;min-width:0;padding:8px;border:1px solid #ccc;border-radius:6px;font:inherit}
.btn-sm{padding:8px 14px;border:1px solid #333;background:#fff;border-radius:6px;cursor:pointer;font:inherit}
.promo-row{color:#136f3e}

/* ── Phase 8: hero carousel, ad strips, logo ──────────────────────── */
.hero{position:relative;max-width:1280px;margin:0 auto 8px;overflow:hidden;border-radius:0 0 10px 10px}
.hero-slide{display:none}
.hero-slide.on{display:block}
.hero-slide img{width:100%;max-height:380px;object-fit:cover;display:block}
.hero-nav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.85);border:0;font-size:1.4rem;padding:14px 12px;cursor:pointer;border-radius:6px}
.hero-nav.prev{left:12px}.hero-nav.next{right:12px}
.hero-dots{position:absolute;bottom:10px;left:0;right:0;display:flex;justify-content:center;gap:8px}
.hero-dots button{width:10px;height:10px;border-radius:50%;border:0;background:rgba(255,255,255,.6);cursor:pointer;padding:0}
.hero-dots button.on{background:#fff}
.ad-strip{max-width:1280px;margin:18px auto;display:grid;gap:16px;padding:0 16px}
.ad-strip.cols-1{grid-template-columns:1fr}
.ad-strip.cols-2{grid-template-columns:1fr 1fr}
.ad-strip.cols-3{grid-template-columns:repeat(3,1fr)}
.ad img{width:100%;border-radius:8px;display:block;object-fit:cover;max-height:180px}
.logo-img{height:36px;display:block;object-fit:contain;max-width:180px}
@media (max-width:720px){.ad-strip.cols-2,.ad-strip.cols-3{grid-template-columns:1fr}.hero-slide img{max-height:200px}}
