:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --brand: #0f3b66;
  --accent: #f08a00;
  --accent-dark: #d97a00;
  --ok: #067d3f;
  --warn: #9a5b00;
  --r: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.4; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* Header and search, like a marketplace app */
.top { position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff; padding: 10px 12px 12px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 1100px; margin: 0 auto 8px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.logo .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.logo small { display: block; font-weight: 400; font-size: 11px; opacity: .75; }
.top-links { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.1); }
.icon-btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.searchbar { display: flex; max-width: 1100px; margin: 0 auto; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.searchbar input { flex: 1; min-width: 0; border: 0; padding: 12px 12px; font-size: 16px; outline: none; color: var(--ink); }
.searchbar button { border: 0; background: var(--accent); color: #fff; padding: 0 16px; font-weight: 600; cursor: pointer; }

main { max-width: 1100px; margin: 0 auto; padding: 10px 10px 90px; }

/* Filter chips under the search */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { border-color: var(--brand); background: #e8eef5; color: var(--brand); font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; margin: 2px 2px 8px; }

/* Result rows: small image tile on the left, details on the right */
.results { display: grid; gap: 8px; }
@media (min-width: 900px) { .results { grid-template-columns: 1fr 1fr; } }
.row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; background: var(--card); border-radius: var(--r); padding: 10px; }
.tile { width: 104px; height: 104px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.tile img { max-width: 92%; max-height: 92%; object-fit: contain; }
.tile.empty::after { content: "No photo"; font-size: 11px; color: var(--muted); }
.info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.brand { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.title { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.part { font-size: 12px; color: var(--muted); }
.price { font-size: 19px; font-weight: 700; }
.price sup { font-size: 11px; top: -.5em; position: relative; }
.stock { font-size: 12px; color: var(--ok); }
.stock.low { color: var(--warn); }
.row .add { margin-top: 4px; align-self: flex-start; border: 0; background: var(--accent); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.row .add.done { background: var(--ok); }

/* Category tiles on the home screen */
.section-h { font-size: 16px; font-weight: 700; margin: 6px 2px 10px; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
@media (min-width: 700px) { .cats { grid-template-columns: repeat(6, 1fr); } }
.cat { background: var(--card); border-radius: var(--r); padding: 8px; text-align: center; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.cat .tile { width: 100%; height: auto; aspect-ratio: 1; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 999px; padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; }
.btn.alt { background: var(--accent); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* Product page */
.pd { background: var(--card); border-radius: var(--r); padding: 12px; }
@media (min-width: 900px) { .pd { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px; } }
.pd .hero { aspect-ratio: 1; display: grid; place-items: center; background: #f8fafc; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.pd .hero img { max-width: 92%; max-height: 92%; object-fit: contain; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.thumbs .tile { width: 56px; height: 56px; cursor: pointer; flex: 0 0 auto; }
.pd h1 { font-size: 18px; line-height: 1.3; margin: 10px 0 4px; font-weight: 600; }
.pd .price { font-size: 26px; margin: 6px 0 2px; }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 999px; width: max-content; margin: 10px 0; overflow: hidden; }
.qty button { border: 0; background: #f8fafc; width: 40px; height: 38px; font-size: 18px; cursor: pointer; }
.qty input { width: 52px; height: 38px; border: 0; text-align: center; font-size: 16px; }
.buy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.block { background: var(--card); border-radius: var(--r); padding: 14px; margin-top: 10px; }
.block h2 { font-size: 15px; margin: 0 0 8px; }
table.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.specs td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.specs td:first-child { color: var(--muted); width: 45%; }
.docs a { display: block; padding: 8px 0; color: var(--brand); border-bottom: 1px solid var(--line); }
.notice { background: #fff8e6; border: 1px solid #f3d38b; border-radius: 10px; padding: 10px; font-size: 13px; }

/* Sticky buy bar on phones */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 900px) { .buybar { display: none; } }

/* Cart and checkout */
.cart-line { display: grid; grid-template-columns: 72px 1fr; gap: 10px; background: var(--card); border-radius: var(--r); padding: 10px; margin-bottom: 8px; }
.cart-line .tile { width: 72px; height: 72px; }
.cart-line .ops { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cart-line .qty { margin: 0; }
.link { color: var(--brand); font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; }
.totals { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.totals .line { display: flex; justify-content: space-between; }
form.checkout { display: grid; gap: 10px; background: var(--card); border-radius: var(--r); padding: 14px; }
form.checkout input { padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; width: 100%; }
form.checkout .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error { color: #b00020; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty h1 { color: var(--ink); font-size: 20px; }

/* Filter sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow: auto; background: #fff; border-radius: 16px 16px 0 0; z-index: 41; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { left: auto; right: 16px; bottom: 16px; width: 380px; border-radius: 16px; } }
.sheet h3 { font-size: 15px; margin: 12px 0 8px; }
.sheet .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet .foot { position: sticky; bottom: 0; background: #fff; padding-top: 12px; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }

.foot-note { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 12px 30px; }
.foot-note a { color: var(--brand); }

/* Team pages reuse these */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.small { font-size: 12px; color: var(--muted); }

/* On phones the sticky bar carries the buy buttons */
@media (max-width: 899px) { .pd .buy-row { display: none; } }
.panel { overflow-x: auto; }
