/* ============================================================
   GEN DISTRIBUTIONS — STOREFRONT
   Navy header · Gold ratings/trust accents · Orange primary action
   Trade portal is untouched — this file only affects the shop.
   No build step. Edit directly.
   ============================================================ */

:root {
  --navy: #131a2c;
  --navy-2: #1c2740;
  --navy-3: #283757;
  --ink: #16202e;
  --gold: #d9a441;
  --gold-dark: #9c7222;
  --gold-bg: #fbf3e2;
  --orange: #d97a2c;
  --orange-dark: #b6621e;
  --slate: #6b7688;
  --slate-light: #98a2b3;
  --paper: #ffffff;
  --bg: #f4f6f8;
  --rule: #e2e6ec;
  --rule-strong: #c7ced9;
  --danger: #b13a3a;
  --danger-bg: #fbebeb;
  --success: #1f7a4d;
  --success-bg: #e8f5ec;

  --radius: 6px;
  --wrap: 1320px;
  --shadow: 0 1px 3px rgba(19, 26, 44, .08);
  --shadow-md: 0 4px 14px rgba(19, 26, 44, .10);
  --shadow-lg: 0 16px 44px rgba(19, 26, 44, .22);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 700; color: var(--ink); margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.page { padding: 1.5rem 0 3.5rem; }
.muted { color: var(--slate); }
.small { font-size: .8125rem; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; min-height: 100vh; }
.grow { flex: 1; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-weight: 700; font-size: .875rem; padding: .68rem 1.2rem;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--orange); color: #fff; cursor: pointer;
  transition: background .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--orange-dark); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-dark { background: var(--navy); }
.btn-dark:hover { background: var(--navy-2); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--rule-strong); }
.btn-outline:hover { background: var(--paper); border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--slate); border-color: transparent; padding: .4rem .55rem; }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-sm { padding: .48rem .8rem; font-size: .8rem; }
.btn-lg { padding: .9rem 1.7rem; font-size: .95rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .3rem; font-size: .8125rem; font-weight: 600; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--rule-strong);
  border-radius: var(--radius); background: var(--paper); font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(19,26,44,.08); }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.qty-stepper button { background: var(--bg); border: none; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; color: var(--ink); }
.qty-stepper button:hover { background: var(--rule); }
.qty-stepper input { width: 48px; text-align: center; border: none; border-left: 1px solid var(--rule-strong); border-right: 1px solid var(--rule-strong); height: 36px; padding: 0; }

.err { background: var(--danger-bg); border: 1px solid #e6bcbc; color: var(--danger); padding: .65rem .85rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1rem; }
.ok  { background: var(--success-bg); border: 1px solid #b7ddc4; color: var(--success); padding: .65rem .85rem; border-radius: var(--radius); font-size: .85rem; margin-bottom: 1rem; }

/* ---------- Header ---------- */
.topbar { background: var(--navy-2); color: #b7c0d1; font-size: .74rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 32px; gap: 1rem; }
.topbar a { color: #b7c0d1; }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar .gold { color: var(--gold); }

.masthead { background: var(--navy); }
.masthead .wrap { display: flex; align-items: center; gap: 1.25rem; padding: .85rem 1.25rem; }

.logo { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo img { width: 38px; height: 38px; border-radius: 4px; }
.logo-name { font-weight: 800; font-size: 1.05rem; color: #fff; line-height: 1.1; }
.logo-tag { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: #8b98b0; font-weight: 700; margin-top: 1px; }

.searchbar { flex: 1; display: flex; max-width: 680px; }
.searchbar input { border-radius: var(--radius) 0 0 var(--radius); border: none; height: 42px; }
.searchbar button { border-radius: 0 var(--radius) var(--radius) 0; height: 42px; padding: 0 1.3rem; background: var(--gold); color: var(--navy); border: none; }
.searchbar button:hover { background: #c99532; }

.head-actions { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.head-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .4rem .7rem; border: none; background: transparent; color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; border-radius: var(--radius); position: relative;
}
.head-btn:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.head-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.cart-badge {
  position: absolute; top: 0; right: 6px; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- Nav (category rail) ---------- */
.nav { background: var(--navy-2); }
.nav .wrap { display: flex; overflow-x: auto; }
.nav a { color: #d7deea; font-size: .8rem; font-weight: 600; padding: .65rem 1rem; white-space: nowrap; }
.nav a:hover { background: var(--navy-3); text-decoration: none; color: #fff; }
.nav a.active { background: var(--navy-3); color: #fff; }

.crumbs { font-size: .8125rem; color: var(--slate); padding: .9rem 0; display: flex; gap: .45rem; flex-wrap: wrap; }
.crumbs a { color: var(--slate); }
.crumbs a:hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 3rem 0;
}
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; }
.hero h1 { color: #fff; font-size: 2.3rem; max-width: 16ch; margin-bottom: .8rem; }
.hero h1 span { color: var(--gold); }
.hero p { color: #c2cadb; font-size: 1rem; max-width: 46ch; margin: 0 0 1.5rem; }
.hero-panel {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 1.4rem;
}
.hero-panel .row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: .875rem; }
.hero-panel .row:last-child { border-bottom: none; }
.hero-panel .row b { color: var(--gold); }

/* ---------- Trust badges ---------- */
.trust-row { background: var(--paper); border-bottom: 1px solid var(--rule); }
.trust-row .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.1rem 1.25rem; }
.trust-item { display: flex; align-items: center; gap: .65rem; }
.trust-item svg { width: 26px; height: 26px; stroke: var(--gold-dark); flex-shrink: 0; }
.trust-item .t { font-weight: 700; font-size: .85rem; color: var(--ink); }
.trust-item .d { font-size: .75rem; color: var(--slate); }

/* ---------- Category grid ---------- */
.cat-tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4/3; background: var(--navy); display: block; border: 1px solid var(--rule);
}
.cat-tile img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: transform .25s ease; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile .label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .7rem .85rem;
  background: linear-gradient(transparent, rgba(19,26,44,.88));
}
.cat-tile h3 { color: #fff; margin: 0; font-size: .95rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.25rem 0 1.1rem; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.card-pad { padding: 1.4rem; }
.grid { display: grid; gap: 1.1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Product card (tile) ---------- */
.tile {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: box-shadow .12s, border-color .12s;
}
.tile:hover { box-shadow: var(--shadow-md); border-color: var(--rule-strong); }
.tile .thumb { aspect-ratio: 1/1; background: var(--bg); overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .body { padding: .9rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.tile .tname { font-size: .875rem; font-weight: 600; color: var(--ink); line-height: 1.35; min-height: 2.5em; }
.tile .tname:hover { color: var(--navy); text-decoration: underline; }
.tile .foot { margin-top: auto; padding-top: .55rem; }

.badge {
  position: absolute; top: .55rem; left: .55rem; z-index: 2;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: .28rem .5rem; border-radius: 4px;
}
.badge-gold { background: var(--gold); color: var(--navy); }
.badge-orange { background: var(--orange); color: #fff; }
.badge-slate { background: var(--navy); color: #fff; }

.by { font-size: .74rem; color: var(--slate); }
.by .house { font-weight: 600; color: var(--ink); }

/* Star rating — only rendered when real review data exists. No placeholder stars. */
.stars { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--slate); }
.stars svg { width: 13px; height: 13px; fill: var(--gold); stroke: none; }
.stars .count { color: var(--slate); }

.price { font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.price-unit { font-size: .72rem; color: var(--slate); font-weight: 500; }
.price-was { font-size: .78rem; color: var(--slate-light); text-decoration: line-through; font-weight: 500; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .24rem .5rem; border-radius: 4px; background: var(--bg); color: var(--slate); }
.pill-gold { background: var(--gold-bg); color: var(--gold-dark); }
.pill-stock { background: var(--success-bg); color: var(--success); }
.pill-out { background: var(--danger-bg); color: var(--danger); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--paper); }
.table th { font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--slate); font-weight: 700; text-align: left; padding: .7rem .85rem; background: var(--bg); border-bottom: 1px solid var(--rule-strong); }
.table td { padding: .8rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 350px; gap: 1.75rem; align-items: start; }
.summary { position: sticky; top: 1rem; }
.srow { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .9rem; }
.srow.total { border-top: 2px solid var(--ink); margin-top: .6rem; padding-top: .8rem; font-size: 1.15rem; font-weight: 800; }
.line { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.line:last-child { border-bottom: none; }
.line .thumb { width: 92px; height: 92px; flex-shrink: 0; border: 1px solid var(--rule); background: var(--bg); overflow: hidden; border-radius: var(--radius); }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .info { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 4rem 1.5rem; }

/* ---------- Gate / checkout card ---------- */
.gate { max-width: 460px; margin: 3rem auto; }
.gate .card { border-top: 4px solid var(--orange); }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #9aa5ba; margin-top: auto; padding: 2.75rem 0 1.5rem; }
.footer h4 { color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .8rem; }
.footer a { color: #9aa5ba; font-size: .85rem; display: block; padding: .2rem 0; }
.footer a:hover { color: #fff; text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 2rem; }
.footer-blurb { font-size: .85rem; line-height: 1.7; max-width: 36ch; }
.footer-bottom { border-top: 1px solid var(--navy-3); margin-top: 2.25rem; padding-top: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .78rem; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; }
.toast { background: var(--navy); color: #fff; padding: .75rem 1.1rem; border-radius: var(--radius); border-left: 4px solid var(--gold); box-shadow: var(--shadow-lg); font-size: .85rem; min-width: 250px; }
.toast.good { border-left-color: var(--success); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero .wrap { grid-template-columns: 1fr; }
  .trust-row .wrap { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .masthead .wrap { flex-wrap: wrap; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .logo-tag { display: none; }
}
@media (max-width: 540px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .trust-row .wrap { grid-template-columns: 1fr; }
}
