/* =============================================================================
   BOOM stylesheet — "Trusted Classic" design system.
   Hand-written, no framework, no build step. Loaded by partials/header.php on
   every storefront page (the admin panel has its own inline styles).

   House aesthetic:
   - Dense and information-first: small type, tight spacing.
   - Sharp corners everywhere (border-radius: 0).
   - "Hairline" 1px borders instead of shadows to separate things.
   - The hairline GRID trick: a container gets `background: var(--line)` and its
     cells get `gap: 1px` + an opaque background. The gap lets the container
     colour show through as predictable 1px rules between cells, with no
     double borders. Used by .reviews and the dashboard tiles.
   - Prices/figures are set in IBM Plex Mono with `font-variant-numeric:
     tabular-nums` so digits line up in columns (see .mono).

   Sections below, in order:
     Tokens · Base · Utility bar · Masthead/nav · Category strip · Layout ·
     Forms · Category picker · Footer · Home · Listing grid + cards ·
     Browse layout · Product page · Seller profile · Responsive
   ============================================================================= */

/* ---- Design tokens (colours + fonts) ------------------------------------- */
/* Single light theme — there is no dark-mode block. Change a brand colour here
   and it propagates everywhere via var(). */
:root {
  --ground: #FFFFFF;
  --surface: #F1F4F8;
  --surface-2: #E9EEF4;
  --line: #D8DEE6;
  --line-strong: #C2CBD6;
  --ink: #10192B;
  --muted: #4C5A6E;
  --navy: #14335E;
  --navy-link: #14335E;
  --gold: #B4780A;
  --gold-soft: #F5EAD6;
  --green: #276B45;
  --green-soft: #E1EEE6;
  --danger: #B4280A;

  --font-display: "Archivo", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1120px;   /* the shared content column width; every .inner centres to this */
}

/* ---- Base / reset ------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; } /* stop iOS bumping font size on rotate */
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; } /* responsive images; block kills the inline gap */
/* .mono: monospace + tabular-nums so figures in a column share the same digit width */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Keyboard-only focus ring (not shown on mouse click) */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---- Utility bar (the navy trust strip above the nav) ---- */
.utilbar {
  background: var(--navy);
  color: #EAF0F8;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.utilbar .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 7px 24px;
  display: flex; gap: 22px; flex-wrap: wrap;
}
.utilbar span, .utilbar .inner > a:first-child { display: inline-flex; align-items: center; gap: 7px; }
.utilbar span::before, .utilbar .inner > a:first-child::before { content: ""; width: 5px; height: 5px; background: var(--gold); } /* gold square bullet, incl. the now-linked "Buyer Protection" */
.utilbar a { color: inherit; }
.utilbar a:hover { text-decoration: underline; }
.utilbar .inner > a:last-child { margin-left: auto; } /* pushes only the trailing link to the far right */

/* ---- Masthead / nav ---- */
.masthead { border-bottom: 1px solid var(--line); }
.masthead .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.masthead nav { display: flex; gap: 18px; font-size: 14px; }
.masthead .spacer { margin-left: auto; } /* empty flex item that shoves .actions to the right */
.masthead .actions { display: flex; gap: 10px; align-items: center; font-size: 14px; }

/* ---- Category strip (horizontal scroller of top-level categories) ---- */
.catstrip { border-bottom: 1px solid var(--line); background: var(--surface); }
.catstrip .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 9px 24px;
  display: flex; gap: 20px; overflow-x: auto; font-size: 13px; /* scrolls sideways on narrow screens */
}
.catstrip a { color: var(--muted); white-space: nowrap; } /* never wrap a category name mid-strip */

/* ---- Layout primitives ---- */
main { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 64px; }
.narrow { max-width: 460px; margin: 0 auto; } /* centred column for auth forms */

/* text-wrap: balance = even line lengths in a heading */
h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -.02em; margin: 0 0 6px; text-wrap: balance; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }

/* ---- Forms ---- */
.card { border: 1px solid var(--line); background: var(--ground); padding: 24px; } /* the generic bordered panel */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line-strong); background: var(--ground); color: var(--ink);
  font: inherit; border-radius: 0; /* sharp corners, matching the house style */
}
/* outline-offset: -1px draws the focus ring just inside the border so the field doesn't jump */
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; border-color: var(--gold); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-block; padding: 10px 18px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; border-radius: 0;
}
.btn:hover { background: #0F2949; text-decoration: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.gold:hover { background: #9A6608; }
.btn.ghost { background: transparent; color: var(--navy-link); } /* outline-only button */
.btn.block { display: block; width: 100%; text-align: center; }  /* full-width form submit */

.alert { padding: 10px 13px; border: 1px solid var(--line); font-size: 13.5px; margin-bottom: 16px; }
.alert.error { background: #FBEAE6; border-color: #E5B7AC; color: var(--danger); } /* one-off soft red — no token */
.alert.ok { background: var(--green-soft); border-color: #A9CDB8; color: var(--green); }

.formfoot { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---- Status pill (orders.php, order.php) ---------------------------------- */
.pill { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border: 1px solid var(--line-strong); text-transform: uppercase; letter-spacing: .03em; }
.pill.ok { color: var(--green); border-color: #A9CDB8; background: var(--green-soft); }
.pill.warn { color: var(--gold); border-color: #E6D3AE; background: var(--gold-soft); }
.pill.bad { color: var(--danger); border-color: #E5B7AC; background: #FBEAE6; }

/* ---- Order list rows (orders.php) ------------------------------------------ */
.orderlist { display: flex; flex-direction: column; border: 1px solid var(--line); }
.ordrow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ordrow:last-child { border-bottom: none; }
.ordrow:hover { background: var(--surface); text-decoration: none; }
.ordrow img, .ordrow-noimg { width: 54px; height: 54px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; background: var(--surface-2); }
.ordrow-noimg { display: grid; place-items: center; font-size: 9px; color: var(--muted); text-align: center; }
.ordrow-body { flex: 1; min-width: 0; }
.ordrow-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ordrow-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ordrow-price { font-size: 14px; white-space: nowrap; }
@media (max-width: 600px) { .ordrow { flex-wrap: wrap; } .ordrow-price { order: 3; } }

/* ---- Category picker (onboarding checkboxes) ---- */
/* auto-fill + minmax = as many ~150px columns as fit, each stretching to fill */
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pickgrid label {
  background: var(--ground); border: 1px solid var(--line); padding: 10px 12px; font-size: 13px; cursor: pointer;
  display: flex; gap: 8px; align-items: flex-start;
}
.pickgrid label:hover { background: var(--surface); border-color: var(--line-strong); }
/* adjacent-sibling selector: style the <span> that follows a checked checkbox */
.pickgrid input:checked + span { font-weight: 600; color: var(--navy); }

/* ---- Footer (trust band + site links) ---- */
.trustband { border-top: 1px solid var(--line); background: var(--surface); }
.trustband .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 22px 24px;
  display: flex; gap: 32px; flex-wrap: wrap; font-size: 13px;
}
.trustband b { font-family: var(--font-display); display: block; font-size: 13px; }
.trustband span { color: var(--muted); }
footer.site { border-top: 1px solid var(--line); }
footer.site > .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 8px;
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px;
}
.footcol b { font-family: var(--font-display); font-size: 13px; display: block; margin-bottom: 10px; }
.footcol p { font-size: 12.5px; color: var(--muted); margin: 0; max-width: 32ch; }
.footcol a { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.footcol a:hover { color: var(--navy); text-decoration: none; }
.footbottom { border-top: 1px solid var(--line); margin-top: 20px; }
.footbottom .inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; font-size: 12px; color: var(--muted); }
@media (max-width: 820px) { footer.site > .inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { footer.site > .inner { grid-template-columns: 1fr; } }

/* ---- "How it works" page (steps + money-side note) ------------------------ */
.hiw-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0 8px; }
.hiw-track { background: var(--ground); border: 1px solid var(--line); padding: 22px 24px 26px; }
.hiw-track h2 { margin: 0 0 14px; }
.hiw-steps { list-style: none; counter-reset: hiw; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.hiw-steps li { counter-increment: hiw; position: relative; padding-left: 40px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.hiw-steps li::before {
  content: counter(hiw); position: absolute; left: 0; top: -2px;
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.hiw-steps li b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.hiw-note { margin-top: 20px; }
.hiw-note ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.hiw-note ul b { color: var(--ink); }
@media (max-width: 860px) { .hiw-cols { grid-template-columns: 1fr; } }

/* ---- Homepage "how it works" 3-step band ---------------------------------- */
.home-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 44px 0 0; }
.home-steps > div { background: var(--ground); padding: 20px 22px; }
.home-steps .num { font-family: var(--font-mono); color: var(--gold); font-size: 12px; font-weight: 600; }
.home-steps h3 { font-family: var(--font-display); font-size: 15px; margin: 6px 0 6px; }
.home-steps p { font-size: 13px; color: var(--muted); margin: 0; }
@media (max-width: 700px) { .home-steps { grid-template-columns: 1fr; } }

/* ---- Simple content pages (about, faq, terms, privacy, buyer-protection) -- */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 30px; }
.prose p { margin: 0 0 14px; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 20px; color: var(--ink); }
.prose li { margin-bottom: 6px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq-item p { margin: 10px 0 0; color: var(--muted); }

/* ---- Home ---- */
/* ---- Hero carousel (index.php only) --------------------------------------
   .hero-track is a flex row, one .hero-slide per slide at flex:0 0 100%;
   js/hero-carousel.js moves it with `transform: translateX(-n * 100%)` and a
   CSS transition — no scroll-snap, so the auto-advance timer stays in full
   control. Falls back to a single static slide with no JS at all: the track
   just never moves. */
.hero-carousel { position: relative; overflow: hidden; border: 1px solid var(--line); margin-bottom: 28px; }
.hero-track { display: flex; transition: transform .5s ease; }
@media (prefers-reduced-motion: reduce) { .hero-track { transition: none; } }
.hero-slide { flex: 0 0 100%; min-width: 0; min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.hero-slide-default { padding: 28px 32px; }
/* clamp(min, preferred, max): scales with viewport width but never past the bounds.
   max-width in ch units caps the line at ~16 characters for a tight headline. */
.hero-slide-default h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 16ch; }
.hero-slide-default .lead { max-width: 54ch; } /* ~54 chars is a comfortable reading measure */
.home-cta { display: flex; gap: 10px; margin-top: 18px; }

.hero-slide-deal { background-size: cover; background-position: center; padding: 28px 32px; }
.hero-deal-card {
  background: var(--navy); color: #fff; padding: 22px 26px; max-width: 380px;
  border: 1px solid rgba(255,255,255,.25);
}
.hero-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.hero-deal-card h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 6px 0 12px; color: #fff; }
.hero-deal-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hero-deal-price .ask { font-size: 1.3rem; font-weight: 600; }
.hero-deal-price .mkt { color: #B9C3D2; text-decoration: line-through; font-size: 13px; }
.hero-deal-countdown { font-size: 13px; color: #EAF0F8; margin-bottom: 14px; }
.hero-deal-countdown strong { font-family: var(--font-mono); }

.hero-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 22px; height: 3px; padding: 0; border: none; background: rgba(255,255,255,.55); cursor: pointer; }
.hero-slide-default ~ .hero-dots, .hero-carousel > .hero-dots { background: transparent; }
.hero-dot.on { background: var(--gold); }
/* the dots sit over whichever slide is showing; the default slide is light,
   so give the dots a dark track to stay visible on white too */
.hero-dots { padding: 4px 8px; background: rgba(16,25,43,.06); }

/* ---- Horizontally-scrolling single row (e.g. "Most viewed") -------------- */
.lrow-wrap { position: relative; }
.lrow {
  display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x proximity; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.lrow::-webkit-scrollbar { height: 6px; }
.lrow::-webkit-scrollbar-thumb { background: var(--line-strong); }
.lrow .lcard { flex: 0 0 210px; scroll-snap-align: start; }
.lrow-nav {
  position: absolute; top: 50%; margin-top: -16px; width: 32px; height: 32px;
  border: 1px solid var(--line-strong); background: var(--ground); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px; z-index: 1;
}
.lrow-nav:hover { border-color: var(--navy); }
.lrow-nav.prev { left: -14px; }
.lrow-nav.next { right: -14px; }
@media (max-width: 640px) { .lrow-nav { display: none; } /* touch swipe covers it */ }
/* row-head: section title on the left, "See all" link on the right, baselines aligned */
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.row-head h2 { margin: 0; }
.row-head a { font-size: 13px; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.catgrid a { background: var(--ground); color: var(--ink); border: 1px solid var(--line); padding: 12px 14px; font-size: 13.5px; }
.catgrid a:hover { background: var(--surface); border-color: var(--navy); text-decoration: none; }

/* ---- Listing grid + cards (partials/listing-card.php) ---- */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-items: start; }
.lcard { background: var(--ground); color: var(--ink); display: flex; flex-direction: column; border: 1px solid var(--line); }
.lcard:hover { text-decoration: none; border-color: var(--navy); }
/* aspect-ratio keeps every card image the same shape (4:3) regardless of the
   source file; object-fit: cover then crops to fill without distortion.
   position: relative makes it the anchor for the absolutely-placed .chips. */
.lcard-img { position: relative; aspect-ratio: 4 / 3; flex: 0 0 auto; background: var(--surface-2); overflow: hidden; }
.lcard-img img { width: 100%; height: 100%; object-fit: cover; }
.lcard-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.chip {
  position: absolute; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  padding: 2px 6px; letter-spacing: .01em;
}
.chip.savings { left: 0; bottom: 0; background: var(--gold); color: #fff; }  /* gold, bottom-left */
.chip.countdown { right: 0; top: 0; background: var(--ink); color: #fff; }   /* dark, top-right */
.lcard-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
/* -webkit-line-clamp: 2 — truncate the title to two lines with an ellipsis
   (needs the -webkit-box display + vertical orientation) */
.lcard-title { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard-price { font-size: 15px; font-weight: 600; margin-top: 2px; }
.lcard-was { font-size: 11.5px; color: var(--muted); text-decoration: line-through; } /* struck-through market price */
.lcard-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---- Browse layout (listings.php) ---- */
.browse { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; } /* fixed filter rail + fluid results */
.filters { border: 1px solid var(--line); padding: 16px; position: sticky; top: 16px; } /* rail follows the scroll */
.filters .field.two, .field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } /* two inputs side by side (min/max price) */
.results-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
.results-head select { padding: 6px 8px; border: 1px solid var(--line-strong); font: inherit; background: var(--ground); color: var(--ink); }
.pager { display: flex; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.pager a { padding: 6px 11px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 13px; }
.pager a.on { background: var(--navy); color: #fff; border-color: var(--navy); } /* current page */

/* ---- Product / listing detail page (listing.php) ---- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; } /* gallery | info, 50/50 */
.pdp-gallery #pdp-main, .pdp-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); } /* square main image */
.pdp-noimg { display: grid; place-items: center; color: var(--muted); }
.thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 60px; height: 60px; object-fit: cover; border: 1px solid var(--line); cursor: pointer; }
.pdp-cat { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.pdp-cat a { color: var(--muted); }
.priceblock { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.priceblock .ask { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; }
.priceblock .mkt { color: var(--muted); text-decoration: line-through; }
.priceblock .chip.savings { position: static; } /* inline here, not pinned to a corner like on cards */
.pdp-countdown { background: var(--gold-soft); border: 1px solid #E6D3AE; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.pdp-loc { font-size: 13px; color: var(--muted); }
.pdp-owner { margin: 14px 0; }
.owner-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.big { font-size: 15px; padding: 13px 22px; width: 100%; margin-top: 8px; }
.pdp-protect { font-size: 12px; color: var(--green); margin-top: 6px; }
.pdp-seller { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 18px 0; display: flex; justify-content: space-between; font-size: 13px; }
.pdp-desc { font-size: 14px; }
.pdp-desc h2 { margin-top: 0; }

/* ---- Seller profile (seller.php) ---- */
.seller-stats { display: flex; gap: 18px; font-size: 13px; margin: 8px 0; flex-wrap: wrap; }
/* hairline-grid: 1px container background shows through the 1px gaps as dividers */
.reviews { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.review { background: var(--ground); padding: 12px 14px; font-size: 13.5px; }
.review .rmeta { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---- Responsive: collapse the two-column layouts, then trim the nav ---- */
@media (max-width: 860px) {
  .browse { grid-template-columns: 1fr; }  /* filter rail stacks above results */
  .filters { position: static; }           /* stop it sticking once stacked */
  .pdp { grid-template-columns: 1fr; }      /* gallery above info */
}
@media (max-width: 640px) {
  .masthead nav { display: none; }          /* drop the inline nav on phones */
  h1 { font-size: 1.55rem; }
}
