/* Black Saints Direct marketplace: the retail-first storefront, the Business & Wholesale landing page and the protected Wholesale Workspace.
   Shared by marketplace.html, shop.html, product.html, business.html and workspace.html. Brand tokens match the existing site (dark surface, brass, silver). */
:root {
  --bg: #0a0a0c;
  --surface: #121216;
  --card: #17171c;
  --border: #26262d;
  --border-strong: #3a3a45;
  --silver: #c9cdd6;
  --brass: #b98d3e;
  --brass-hi: #d3a650;
  --blue: #5b86e5;
  --blue-deep: #3b6bd6;
  --text: #ececf0;
  --muted: #a3a3ae;
  --green: #4cc27a;
  --red: #e36a6a;
  --amber: #d9a73b;
  --radius: 10px;
  --maxw: 1240px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--brass-hi); }
a:hover { color: #f0c46d; }
h1, h2, h3 { color: #fff; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--brass); color: #171208; padding: 10px 14px; border-radius: 6px; z-index: 300; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 2px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── header ───────────────────────────────────────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(10,10,12,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: 18px; padding: 14px 20px; max-width: var(--maxw); margin: 0 auto; }
.wordmark { font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.35rem; letter-spacing: .08em; color: var(--silver); text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--brass); }
.search { flex: 1; display: flex; gap: 8px; max-width: 560px; }
.search input { flex: 1; min-width: 0; }
.util { display: flex; gap: 16px; align-items: center; margin-left: auto; white-space: nowrap; }
.util a { color: var(--silver); text-decoration: none; font-size: .92rem; }
.util a:hover { color: #fff; }
.primary { border-top: 1px solid var(--border); }
.primary ul { list-style: none; margin: 0 auto; padding: 0 20px; max-width: var(--maxw); display: flex; gap: 4px; overflow-x: auto; }
.primary a { display: block; padding: 11px 14px; color: var(--muted); text-decoration: none; font-size: .92rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.primary a:hover { color: #fff; }
.primary a[aria-current="page"] { color: #fff; border-bottom-color: var(--brass); }
.primary a.business { color: var(--blue); }
.primary a.business:hover { color: #9db8f5; }

/* ── controls ─────────────────────────────────────────────────────────────────────────────────────────── */
input, select, textarea { background: #0d0d10; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); padding: 10px 12px; font: inherit; font-size: .95rem; width: 100%; }
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; }
input::placeholder, textarea::placeholder { color: #7d7d88; }
label { display: block; font-size: .84rem; color: var(--muted); margin: 14px 0 6px; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brass); color: #171208; border: 1px solid var(--brass); border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--brass-hi); color: #171208; }
.btn.secondary, button.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--card); color: #fff; }
.btn.blue, button.blue { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn.blue:hover, button.blue:hover { background: var(--blue); color: #fff; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ── hero ─────────────────────────────────────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: #08080a; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.hero .copy p { color: var(--muted); font-size: 1.08rem; max-width: 46ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero img { width: 100%; border-radius: 14px; border: 1px solid var(--border); display: block; background: #0f0f13; }
.eyebrow { color: var(--brass); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.hero.business .eyebrow { color: var(--blue); }

/* ── sections and cards ───────────────────────────────────────────────────────────────────────────────── */
.section { padding: 44px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head a { font-size: .92rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--brass); }
.tile strong { font-size: 1.02rem; }
.tile span { color: var(--muted); font-size: .85rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.product:hover { border-color: var(--border-strong); }
.product .media { display: block; aspect-ratio: 4 / 3; background: #101015; }
.product .media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product .body { display: flex; flex-direction: column; gap: 4px; padding: 14px; flex: 1; }
.product .brand { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.product .name { color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem; line-height: 1.3; }
.product .name:hover { color: #fff; text-decoration: underline; }
.price { font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 600; color: #fff; }
.product .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.stock { font-size: .82rem; color: var(--green); }
.stock.low { color: var(--amber); }
.stock.out { color: var(--red); }
.note-line { font-size: .82rem; color: var(--muted); }
.notice { background: #0d0d10; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: .9rem; color: var(--muted); margin: 14px 0; }
.notice.amber { border-color: rgba(217,167,59,.45); color: var(--amber); }
.notice.blue { border-color: rgba(91,134,229,.45); color: #b4c8f5; }
.empty { text-align: center; padding: 56px 20px; background: var(--card); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty h2 { color: #fff; }

/* ── the quiet wholesale invitation ───────────────────────────────────────────────────────────────────── */
.invite { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 26px; background: linear-gradient(90deg, #11151f, #0f1118); border: 1px solid rgba(91,134,229,.35); border-radius: var(--radius); }
.invite p { margin: 0; color: var(--silver); max-width: 70ch; }

/* ── trust strip and footer ───────────────────────────────────────────────────────────────────────────── */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.trust a { padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.trust a:hover { border-color: var(--brass); }
.trust strong { display: block; margin-bottom: 2px; }
.trust span { color: var(--muted); font-size: .86rem; }
.site-footer { border-top: 1px solid var(--border); background: #08080a; padding: 30px 0 40px; margin-top: 20px; color: var(--muted); font-size: .88rem; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: #fff; }

/* ── shop: filters and results ────────────────────────────────────────────────────────────────────────── */
.shop { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding-top: 28px; padding-bottom: 40px; align-items: start; }
.filters { position: sticky; top: 130px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.filters h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.filters ul { list-style: none; padding: 0; margin: 0 0 16px; }
.filters li a { display: flex; justify-content: space-between; padding: 7px 8px; border-radius: 6px; color: var(--silver); text-decoration: none; font-size: .92rem; }
.filters li a:hover { background: #1f1f26; color: #fff; }
.filters li a[aria-current="true"] { background: #23232b; color: #fff; }
.filters li a small { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: .92rem; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 26px; }

/* ── product page ─────────────────────────────────────────────────────────────────────────────────────── */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; padding-top: 30px; padding-bottom: 44px; }
.detail .gallery img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #101015; aspect-ratio: 4 / 3; object-fit: contain; }
.detail .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.detail .thumbs button { padding: 0; width: 64px; height: 64px; background: #101015; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.detail .thumbs img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; border: 0; border-radius: 0; }
.detail .buy { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 18px 0; }
.detail .buy .row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.detail .buy .qty { width: 92px; }
.specs { width: 100%; border-collapse: collapse; font-size: .92rem; }
.specs th, .specs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 500; width: 40%; }
.crumbs { font-size: .86rem; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); }

/* ── business landing ─────────────────────────────────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin-bottom: 6px; }
.panel p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 18px 56px; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-deep); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.steps strong { display: block; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: .9rem; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 7px 0 7px 26px; position: relative; color: var(--silver); }
.checks li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 9px; height: 5px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

/* ── Wholesale Workspace ──────────────────────────────────────────────────────────────────────────────── */
.workspace-body { --accent: var(--blue); }
.ws-signin { max-width: 440px; margin: 40px auto; }
.ws-signin .panel { padding: 26px; }
.ws-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0 10px; }
.ws-head h1 { font-size: 1.6rem; margin: 0; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--border-strong); color: var(--muted); }
.chip.ok { color: var(--green); border-color: rgba(76,194,122,.5); }
.chip.warn { color: var(--amber); border-color: rgba(217,167,59,.5); }
.chip.bad { color: var(--red); border-color: rgba(227,106,106,.5); }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 16px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: #fff; background: transparent; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--blue); }
.tabs button:disabled { opacity: .45; }
.ws-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.ws-tools input { flex: 1 1 240px; max-width: 360px; }
.ws-tools select { width: auto; min-width: 200px; flex: 0 1 260px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data thead th { background: #14141a; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.wprice { color: #fff; font-weight: 600; }
.rprice { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.err { color: var(--red); font-size: .9rem; min-height: 1.2em; margin-top: 10px; }
/* ── quotes, orders and the wire reference ───────────────────────────────────────────────────────────── */
.qty-add { display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.qty-input { width: 5.5rem; flex: 0 0 auto; }
.ship-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; align-items: center; max-width: 40rem; margin: 16px 0 6px; }
.ref-box { display: inline-block; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.5rem; letter-spacing: .08em; color: #fff; border: 2px solid var(--brass); border-radius: var(--radius); padding: 10px 16px; margin: 6px 0 14px; overflow-wrap: anywhere; }
#wire-list .panel { margin-bottom: 16px; }
#quote-totals { margin-top: 16px; }
#order-placed h3, #wire-list h3 { margin: 22px 0 10px; font-size: 1.05rem; }
#wire-list h3 { margin-top: 0; }
#quote-expiry { margin-top: 12px; }

/* ── responsive ───────────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; }
  .hero img { order: -1; }
  .shop { grid-template-columns: 1fr; }
  .filters { position: static; }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .primary ul { padding: 0 12px; }
  .wrap { padding: 0 16px; }
  .section { padding: 32px 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product .body { padding: 10px; }
  .price { font-size: 1.1rem; }
  .invite { padding: 18px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 10px; }
  .ws-tools input, .ws-tools select { flex: 1 1 100%; max-width: none; }
  .ship-grid { grid-template-columns: minmax(0, 1fr); gap: 4px 0; }
  .ship-grid label { margin-top: 8px; font-size: .85rem; color: var(--muted); }
  .ref-box { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
