:root {
  --blue: #0058a3;
  --blue-dark: #00497f;
  --yellow: #ffda1a;
  --bg: #ffffff;
  --surface: #f5f6f7;
  --surface-2: #eef0f2;
  --ink: #111418;
  --muted: #6b7280;
  --line: #e6e8eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 20, 24, 0.04), 0 8px 24px rgba(0, 40, 90, 0.06);
  --shadow-lift: 0 12px 36px rgba(0, 40, 90, 0.14);
}

* { box-sizing: border-box; }

/* The [hidden] attribute must win over any `display` we set on overlays/badges,
   otherwise an invisible overlay (opacity:0) keeps capturing clicks. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--blue);
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  padding: 8px 16px;
  letter-spacing: .01em;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  background: var(--yellow); color: var(--blue);
  font-weight: 800; font-size: 15px; letter-spacing: .03em;
  padding: 6px 9px; border-radius: 7px;
}
.brand-word { font-weight: 700; font-size: 17px; color: var(--blue); letter-spacing: .005em; }

.cart-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff;
  border: none; border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: background .18s ease, transform .1s ease;
}
.cart-btn:hover { background: var(--blue-dark); }
.cart-btn:active { transform: scale(0.98); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--yellow); color: var(--blue);
  border-radius: 999px; font-size: 12px; font-weight: 800;
  display: inline-grid; place-items: center;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 218, 26, 0.18), transparent 50%),
    var(--surface);
  border-bottom: 1px solid var(--line);
  padding: clamp(40px, 7vw, 76px) clamp(16px, 4vw, 40px);
}
.hero-inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.02em;
}
.hero h1 span { color: var(--blue); }
.hero p {
  margin: 18px 0 0; max-width: 580px;
  font-size: clamp(15px, 1.6vw, 17px); line-height: 1.55; color: var(--muted);
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-tags span {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 500;
}

/* ---------- Catalog ---------- */
.catalog { padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 40px) 60px; max-width: 1240px; margin: 0 auto; }
.catalog-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 22px;
}
.catalog-head h2 { font-size: 22px; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  color: var(--ink); cursor: pointer; font-family: inherit; text-transform: capitalize;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.filter:hover { border-color: var(--blue); }
.filter.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.loading { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Product card ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card-media {
  aspect-ratio: 1 / 1; cursor: pointer;
  display: grid; place-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.card-media svg { width: 56%; height: 56%; color: var(--blue); opacity: .9; }
.card-media img, .modal-media img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.modal-media img { padding: 26px; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name { font-size: 15px; font-weight: 700; cursor: pointer; }
.card-type { font-size: 13px; color: var(--muted); }
.card-spec { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-price { margin-top: auto; padding-top: 12px; display: flex; align-items: baseline; gap: 8px; }
.card-price b { font-size: 18px; font-weight: 800; color: var(--ink); }
.card-price s { font-size: 12.5px; color: var(--muted); }
.card-add {
  margin-top: 12px;
  background: var(--blue); color: #fff; border: none; border-radius: 10px;
  padding: 11px; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .18s ease, transform .1s ease;
}
.card-add:hover { background: var(--blue-dark); }
.card-add:active { transform: scale(0.98); }
.card-add.added { background: #2e7d32; }

.seed-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 36px; }

/* category landing */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; padding: 0; font-family: inherit; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.cat-tile-img { aspect-ratio: 16 / 10; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.cat-tile-img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.cat-tile-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 15px; }
.cat-tile-meta b { font-size: 15px; font-weight: 700; }
.cat-tile-meta i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.filter.back { background: var(--blue); color: #fff; border-color: var(--blue); }
.load-more { background: var(--blue); color: #fff; border: none; border-radius: 11px; padding: 12px 22px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; }
.load-more:hover { background: var(--blue-dark); }
@media (max-width: 600px) { .cat-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 16px; }
.footer p { max-width: 760px; margin: 0 auto; text-align: center; font-size: 12.5px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { color: var(--blue); font-weight: 600; font-size: 13px; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Policy pages ---------- */
.policy { max-width: 760px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 32px) 64px; }
.policy h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin-bottom: 6px; }
.policy .updated { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.policy h2 { font-size: 18px; font-weight: 700; margin: 26px 0 8px; }
.policy p, .policy li { font-size: 14.5px; line-height: 1.65; color: #353a40; }
.policy ul { padding-left: 20px; }
.policy a { color: var(--blue); }
.policy .fill { background: #fff3df; color: #8a5a00; padding: 0 4px; border-radius: 3px; }

/* ---------- Cart drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(17, 20, 24, 0.42);
  opacity: 0; transition: opacity .25s ease;
}
.drawer-overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: min(420px, 92vw); height: 100%;
  background: #fff; display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 40, 90, 0.18);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 17px; font-weight: 700; }
.icon-btn {
  background: var(--surface); border: none; border-radius: 8px;
  width: 32px; height: 32px; font-size: 15px; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }

.cart-row { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-thumb {
  width: 64px; height: 64px; border-radius: 10px; flex: none;
  background: var(--surface); display: grid; place-items: center;
}
.cart-thumb svg { width: 60%; height: 60%; color: var(--blue); }
.cart-info { flex: 1; min-width: 0; }
.cart-info .nm { font-size: 14px; font-weight: 700; }
.cart-info .tp { font-size: 12.5px; color: var(--muted); }
.cart-info .pr { font-size: 14px; font-weight: 700; margin-top: 4px; }
.qty { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty button {
  width: 26px; height: 26px; border: 1px solid var(--line); background: #fff;
  border-radius: 7px; font-size: 15px; cursor: pointer; line-height: 1; color: var(--ink);
}
.qty button:hover { border-color: var(--blue); color: var(--blue); }
.qty span { font-size: 14px; font-weight: 600; min-width: 16px; text-align: center; }
.cart-remove { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; margin-top: 6px; }
.cart-remove:hover { color: #c0392b; }

.drawer-foot { border-top: 1px solid var(--line); padding: 18px 20px; }
.drawer-foot .line { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.drawer-foot .line.total { color: var(--ink); font-size: 17px; font-weight: 800; margin-top: 6px; }
.checkout-btn {
  width: 100%; margin-top: 12px;
  background: var(--blue); color: #fff; border: none; border-radius: 11px;
  padding: 14px; font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .18s ease, transform .1s ease;
}
.checkout-btn:hover { background: var(--blue-dark); }
.checkout-btn:active { transform: scale(0.99); }
.foot-note { font-size: 11.5px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.fragile-check { display: flex; align-items: center; gap: 9px; margin: 14px 0 4px; font-size: 13.5px; cursor: pointer; }
.fragile-check input { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; flex: none; }
.frag-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fff3df; color: #b26a00; }
.ship-refresh { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; width: 22px; height: 22px; font-size: 13px; line-height: 1; cursor: pointer; color: var(--blue); padding: 0; vertical-align: middle; margin-left: 4px; }
.ship-refresh:hover { background: #eef4fb; border-color: var(--blue); }

/* ---------- Product modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(17, 20, 24, 0.5);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .2s ease;
}
.modal-overlay.show { opacity: 1; }
.modal {
  background: #fff; border-radius: 18px; overflow: hidden;
  width: min(960px, 100%); max-height: 90vh; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1.05fr;
  transform: scale(0.97); transition: transform .2s ease;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-media { background: #fff; display: grid; place-items: center; min-height: 320px; }
.m-link { display: inline-block; font-size: 13px; color: var(--blue); font-weight: 600; margin-top: 8px; }
.m-link:hover { text-decoration: underline; }
.modal-media svg { width: 55%; height: 55%; color: var(--blue); }
.modal-info { padding: 30px 32px; position: relative; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface); border: none; border-radius: 8px;
  width: 32px; height: 32px; font-size: 15px; cursor: pointer; color: var(--ink);
}
.modal-info h3 { font-size: 24px; font-weight: 800; }
.modal-info .m-type { color: var(--muted); font-size: 15px; margin-top: 2px; }
.modal-info .m-desc { margin: 16px 0; font-size: 14px; line-height: 1.6; color: #353a40; }
.modal-info .m-meta { font-size: 13px; color: var(--muted); display: grid; gap: 6px; margin-bottom: 18px; }
.modal-info .m-meta b { color: var(--ink); font-weight: 600; }
.modal-info .m-price { font-size: 26px; font-weight: 800; }
.modal-info .m-price s { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.modal-info .m-break { font-size: 12px; color: var(--muted); margin: 4px 0 18px; }

/* product modal — gallery + details */
.modal-gallery { padding: 22px; display: flex; flex-direction: column; gap: 12px; align-self: start; }
.mg-main { background: var(--surface); border-radius: 12px; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.mg-main img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.mg-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.mg-thumb { width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0; cursor: pointer; overflow: hidden; }
.mg-thumb.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.mg-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.m-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; align-items: center; }
.m-size { background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 11px; border-radius: 999px; }
.m-rating { font-size: 13px; color: #b26a00; font-weight: 600; }
.m-rating em { color: var(--muted); font-style: normal; font-weight: 400; }
.m-stock { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.m-stock.in { background: #e7f5e8; color: #2e7d32; }
.m-stock.out { background: #fdecea; color: #c0392b; }

.m-attrs, .m-meas { margin: 14px 0; font-size: 13.5px; }
.m-attrs div, .m-meas > div:not(.m-meas-h) { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.m-attrs span, .m-meas > div span { color: var(--muted); }
.m-attrs b, .m-meas b { font-weight: 600; }
.m-meas-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }

.m-buy { display: flex; gap: 12px; align-items: stretch; margin: 18px 0 10px; }
.m-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.m-qty button { width: 38px; height: 100%; min-height: 44px; border: none; background: #fff; font-size: 18px; cursor: pointer; color: var(--ink); }
.m-qty button:hover { background: var(--surface); }
.m-qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: 15px; }
.m-buy .card-add { flex: 1; margin: 0; }

@media (max-width: 560px) {
  .modal { grid-template-columns: 1fr; }
  .modal-media { min-height: 220px; }
  .modal-gallery { padding: 16px 16px 0; }
  .modal-info { padding: 20px; }
}

/* card badges */
.opt-badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(17,20,24,.82); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.card-stock { font-size: 12px; color: #2e7d32; font-weight: 600; margin-top: 2px; }

/* modal: price line + breakdown beneath it */
.m-price { font-size: 27px; font-weight: 800; margin-top: 4px; }
.m-break { font-size: 12.5px; color: var(--muted); margin: 4px 0 16px; }

/* modal spec rows (single-line dimensions) */
.m-spec { margin: 14px 0; font-size: 13.5px; }
.m-spec div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.m-spec span { color: var(--muted); }
.m-spec b { font-weight: 600; text-align: right; }

/* variant picker */
.m-variants { margin: 16px 0; }
.m-variants-h { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.m-variants-h b { color: var(--ink); text-transform: capitalize; }
.m-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-family: inherit; padding: 0; transition: border-color .15s ease; }
.swatch:hover { border-color: var(--blue); }
.swatch.active { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.sw-colour { width: 52px; height: 52px; overflow: hidden; }
.sw-colour img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.sw-size { padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--ink); }
.sw-size.active { background: #eef4fb; color: var(--blue); }

/* qty + total above add-to-cart */
.m-qtyrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.m-total { text-align: right; }
.m-total span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.m-total b { font-size: 20px; font-weight: 800; }
.modal-info .card-add { width: 100%; margin: 0; }
.m-link { display: inline-block; margin-top: 12px; }

/* ---------- Checkout ---------- */
.back-link { color: var(--blue); font-size: 14px; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

.checkout {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 40px) 60px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px; align-items: start;
}
.co-form h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 800; letter-spacing: -0.01em; }
.co-sub { color: var(--muted); margin: 6px 0 22px; font-size: 14px; }

.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff; outline: none;
  transition: border-color .15s ease;
}
.field input:focus { border-color: var(--blue); }
.pin-status { font-size: 12.5px; min-height: 16px; color: var(--muted); }
.pin-status.ok { color: #2e7d32; }
.pin-status.warn { color: #b26a00; }
.form-err {
  background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb;
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 4px;
}

.co-summary { position: sticky; top: 90px; }
.summary-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow);
}
.summary-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sr-main { display: flex; flex-direction: column; gap: 2px; }
.sr-name { font-weight: 700; font-size: 14px; }
.sr-type { font-size: 12.5px; color: var(--muted); }
.sr-price { font-weight: 700; font-size: 14px; white-space: nowrap; }
.summary-empty { color: var(--muted); font-size: 14px; padding: 12px 0; }
.summary-empty a { color: var(--blue); font-weight: 600; }
.summary-totals { padding-top: 14px; }
.summary-totals .line { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.summary-totals .line.total { color: var(--ink); font-size: 18px; font-weight: 800; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.checkout-btn:disabled { background: #b8c2cc; cursor: not-allowed; }

/* ---------- Confirmation ---------- */
.confirm { max-width: 560px; margin: 0 auto; padding: clamp(40px, 8vw, 80px) 20px; }
.confirm-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 40px 32px; text-align: center; box-shadow: var(--shadow);
}
.confirm-tick {
  width: 60px; height: 60px; border-radius: 50%;
  background: #e7f5e8; color: #2e7d32; font-size: 30px;
  display: grid; place-items: center; margin: 0 auto 18px;
}
.confirm-card h1 { font-size: 26px; font-weight: 800; }
.confirm-card p { color: var(--muted); font-size: 14.5px; margin: 10px 0; }
.order-ref {
  font-size: 24px; font-weight: 800; color: var(--blue); letter-spacing: .04em;
  background: var(--surface); border-radius: 10px; padding: 12px; margin: 8px 0 14px;
}

@media (max-width: 820px) {
  .checkout { grid-template-columns: 1fr; }
  .co-summary { position: static; }
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* ---------- Seller console ---------- */
.console-tag {
  margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}
.gate {
  max-width: 360px; margin: 60px auto; padding: 32px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); display: grid; gap: 12px;
}
.gate h2 { font-size: 18px; font-weight: 800; }
.gate p { margin: 0; color: var(--muted); font-size: 14px; }
.gate input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none;
}
.gate input:focus { border-color: var(--blue); }

.seller-wrap { max-width: 920px; margin: 0 auto; padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 32px) 60px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; text-transform: capitalize; color: var(--muted);
}
.pill b { color: var(--blue); margin-left: 6px; }

.order-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.oc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oc-ref { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.oc-time { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.status-badge { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: capitalize; }
.st-new { background: #e6f0fb; color: #0058a3; }
.st-sourcing, .st-purchased { background: #fff3df; color: #b26a00; }
.st-shipped { background: #efe7fb; color: #6b3fb5; }
.st-delivered { background: #e7f5e8; color: #2e7d32; }
.st-cancelled { background: #f3f4f6; color: #6b7280; }

.oc-cust { font-size: 14px; margin: 12px 0 4px; }
.oc-items { font-size: 13.5px; color: #353a40; margin: 8px 0; display: grid; gap: 3px; }
.oc-addr { font-size: 13px; color: var(--muted); margin: 8px 0; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.oc-total { font-weight: 800; font-size: 16px; }
.oc-status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.oc-status select {
  font-family: inherit; font-size: 13.5px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; text-transform: capitalize;
}
.save-tag { font-size: 12px; color: #2e7d32; min-width: 48px; }
.pay-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }
.pay-paid { background: #e7f5e8; color: #2e7d32; }
.pay-pending { background: #fff3df; color: #b26a00; }
.pay-failed { background: #fdecea; color: #c0392b; }
.oc-break { font-size: 12.5px; color: var(--muted); margin: 6px 0; }

/* ---------- Header actions + account link ---------- */
.header-actions { display: flex; align-items: center; gap: 14px; }
.account-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--blue); }
.account-link:hover { text-decoration: underline; }
@media (max-width: 420px) { .account-link span { display: none; } }

/* ---------- Account page ---------- */
.account-wrap { max-width: 720px; margin: 0 auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 32px) 60px; }
.auth-card { max-width: 400px; margin: 24px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); }
.auth-tab { flex: 1; padding: 14px; background: var(--surface); border: none; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: #fff; color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.auth-form { padding: 22px; display: flex; flex-direction: column; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .checkout-btn { margin-top: 6px; }

.profile-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; margin-bottom: 26px; }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-head h1 { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); font-size: 14px; }
.orders-h { font-size: 18px; font-weight: 700; margin: 0 0 14px; }

/* tracking timeline */
.track { display: flex; margin: 16px 0 8px; }
.track-step { flex: 1; position: relative; text-align: center; }
.track-step .dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 1; }
.track-step .lbl { font-size: 11px; color: var(--muted); }
.track-step::before { content: ''; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.track-step:first-child::before { display: none; }
.track-step.done .dot { background: var(--blue); border-color: var(--blue); }
.track-step.done .lbl { color: var(--ink); font-weight: 500; }
.track-step.done::before { background: var(--blue); }
.track-step.current .dot { box-shadow: 0 0 0 4px rgba(0, 88, 163, .15); }
.track.cancelled { color: #c0392b; font-weight: 600; font-size: 14px; padding: 8px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .topbar { font-size: 11.5px; padding: 7px 12px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-name { font-size: 14px; }
  .card-type { font-size: 12px; }
  .card-price b { font-size: 16px; }
  .card-add { padding: 10px; font-size: 13px; }
  .card-media img { padding: 12px; }
  .catalog-head h2 { font-size: 19px; }
  .checkout { gap: 24px; }
  .modal-info { padding: 22px; }
  .modal-info h3 { font-size: 21px; }
}
@media (max-width: 420px) {
  .header { padding: 12px 16px; gap: 10px; }
  .header-actions { gap: 10px; }
  .cart-btn { padding: 9px 13px; }
  .cart-btn span:not(.cart-count) { display: none; }   /* keep cart icon + count */
  .brand-word { font-size: 15px; }
  .brand-badge { font-size: 14px; padding: 5px 8px; }
  .track-step .lbl { font-size: 9.5px; }
  .order-card { padding: 14px; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Commerce ops (seller console + tracking + address book) ---------- */
.oc-ops { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.ops-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-in {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 7px 10px;
  font: inherit; font-size: 13px; width: 130px; background: var(--bg);
}
.ops-in.grow { flex: 1; min-width: 150px; }
.ops-in:focus { border-color: var(--blue); outline: none; }
.ops-btn {
  border: 1.5px solid var(--blue); color: var(--blue); background: var(--bg);
  border-radius: 9px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ops-btn:hover { background: var(--blue); color: #fff; }
.ops-btn:disabled { opacity: 0.55; cursor: default; }
.refund-btn { border-color: #c0392b; color: #c0392b; }
.refund-btn:hover { background: #c0392b; color: #fff; }
.refund-btn.armed { background: #c0392b; color: #fff; }
.ops-margin { font-size: 12.5px; color: var(--ink); }
.margin-ok { color: #2e7d32; }
.margin-bad { color: #c0392b; }
.pay-refunded { background: #ede7f6; color: #5e35b1; }
.evt { font-size: 12.5px; color: var(--muted); }
.evt summary { cursor: pointer; font-weight: 600; }
.evt-row { display: flex; gap: 10px; padding: 3px 0 0 12px; }
.evt-ts { flex: none; min-width: 118px; }
.evt-kind { flex: none; font-weight: 600; color: var(--ink); min-width: 62px; }
.ship-info { font-size: 13px; color: var(--ink); background: var(--surface); border-radius: 9px; padding: 8px 12px; margin-top: 8px; }
.ship-info a { color: var(--blue); font-weight: 600; }
.addr-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.addr-chips-label { font-size: 12.5px; color: var(--muted); flex-basis: 100%; }
.addr-chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.addr-chip:hover { border-color: var(--blue); }
.addr-chip.active { border-color: var(--blue); background: #e8f1fa; color: var(--blue-dark); font-weight: 600; }
