/* Northwind Supply — the sandbox storefront.
 *
 * Deliberately built like a real shop rather than a bare fixture: a sticky
 * header, a filter rail, rating stars, a footer full of link lists. The noise
 * is the point. A scraper that only works on a page containing nothing but the
 * table has not been tested on anything.
 */

@font-face {
  font-family: 'NW Sans';
  src: url('../assets/fonts/archivo-var.woff2') format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --ink:      #16181d;
  --ink-2:    #5f6673;
  --ink-3:    #8d93a1;
  --rule:     #e4e6ea;
  --bg:       #ffffff;
  --wash:     #f6f7f9;
  --brand:    #0f5c4a;      /* deep green, nothing like the extension's violet */
  --brand-2:  #d8efe6;
  --sale:     #b23b2e;
  --gold:     #d8a33a;
}

* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'NW Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.55;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------- announcement + header ---------- */

.strip {
  background: var(--brand); color: #fff; font-size: 13px;
  text-align: center; padding: 8px 20px; letter-spacing: .01em;
}
.strip b { font-variation-settings: 'wght' 600; }

header.site { border-bottom: 1px solid var(--rule); background: #fff; position: sticky; top: 0; z-index: 40; }
.bar { display: flex; align-items: center; gap: 30px; padding-block: 15px; }
.brand { font-size: 19px; letter-spacing: -.4px; text-decoration: none; white-space: nowrap; }
.brand b { font-variation-settings: 'wght' 700; }
.brand span { color: var(--brand); }
.bar nav { display: flex; gap: 22px; }
.bar nav a { font-size: 14px; text-decoration: none; color: var(--ink-2); }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.search {
  border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 13px; width: 190px; background: var(--wash);
}
.cart { font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.cart b {
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 1px 7px; font-size: 11px; margin-left: 5px;
}

/* ---------- page furniture ---------- */

.crumbs { font-size: 13px; color: var(--ink-3); padding: 20px 0 0; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.head { padding: 14px 0 22px; border-bottom: 1px solid var(--rule); margin-bottom: 26px; }
.head h1 { font-size: 28px; letter-spacing: -.7px; margin: 0 0 6px; font-variation-settings: 'wght' 600; }
.head p { margin: 0; color: var(--ink-2); }

.layout { display: grid; grid-template-columns: 208px 1fr; gap: 40px; padding-bottom: 70px; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } aside.rail { display: none; } }

aside.rail h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .11em;
  color: var(--ink-3); margin: 0 0 10px; font-variation-settings: 'wght' 600;
}
aside.rail ul { list-style: none; margin: 0 0 28px; padding: 0; }
aside.rail li { padding: 4px 0; }
aside.rail a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
aside.rail a:hover { color: var(--ink); }
aside.rail .count { color: var(--ink-3); font-size: 12px; }

.toolbar {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  font-size: 14px; color: var(--ink-2);
}
.toolbar select { font: inherit; font-size: 13px; padding: 6px 10px;
                  border: 1px solid var(--rule); border-radius: 7px; background: #fff; }
.toolbar .right { margin-left: auto; }

/* ---------- product cards ---------- */

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 22px; }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.product { position: relative; }
.product .shot {
  display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  background: var(--wash); margin-bottom: 12px; position: relative;
}
.product .shot svg { width: 100%; height: 100%; display: block; }
.product .flag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  background: #fff; border-radius: 4px; padding: 3px 8px;
  font-variation-settings: 'wght' 600;
}
.product .flag.sale { background: var(--sale); color: #fff; }
.product .flag.new  { background: var(--ink); color: #fff; }

.product h3 { margin: 0 0 3px; font-size: 15px; font-variation-settings: 'wght' 600; }
.product h3 a { text-decoration: none; }
.product h3 a:hover { text-decoration: underline; }
.product .maker { color: var(--ink-3); font-size: 13px; margin-bottom: 6px; }
.product .row { display: flex; align-items: baseline; gap: 9px; }
.product .price { font-variation-settings: 'wght' 700; }
.product .was { color: var(--ink-3); text-decoration: line-through; font-size: 13px; }
.product .stars { color: var(--gold); font-size: 12px; letter-spacing: .5px; }
.product .stars em { color: var(--ink-3); font-style: normal; margin-left: 4px; }
.product .stock { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.product .stock.low { color: var(--sale); }
.product .sku { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- pagination ---------- */

.pager { display: flex; gap: 7px; align-items: center; margin-top: 40px; }
.pager a, .pager span {
  min-width: 36px; text-align: center; padding: 7px 11px; font-size: 14px;
  border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; color: var(--ink-2);
}
.pager a:hover { border-color: var(--ink-3); color: var(--ink); }
.pager .on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .next { font-variation-settings: 'wght' 600; color: var(--ink); }

/* ---------- tables ---------- */

table.data { border-collapse: collapse; width: 100%; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); }
table.data thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); font-variation-settings: 'wght' 600;
  border-bottom: 1px solid var(--ink);
}
table.data tbody tr:hover { background: var(--wash); }
table.data td a { color: var(--brand); text-decoration: none; font-variation-settings: 'wght' 600; }
table.data td a:hover { text-decoration: underline; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.callout {
  background: var(--brand-2); border-radius: 10px; padding: 16px 20px; margin: 0 0 26px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.callout .big { font-size: 26px; letter-spacing: -.6px; font-variation-settings: 'wght' 700; color: var(--brand); }
.callout p { margin: 0; color: #1d4a3f; font-size: 14px; }

/* ---------- product detail ---------- */

.detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; padding-bottom: 60px; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; gap: 28px; } }
.gallery .main { border-radius: 12px; overflow: hidden; background: var(--wash); aspect-ratio: 4/3; }
.gallery .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.gallery .thumbs div { border-radius: 7px; overflow: hidden; background: var(--wash); aspect-ratio: 1; }
.buy h1 { font-size: 30px; letter-spacing: -.8px; margin: 0 0 6px; font-variation-settings: 'wght' 600; }
.buy .maker { color: var(--ink-3); margin-bottom: 14px; }
.buy .pricing { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.buy .pricing .now { font-size: 26px; font-variation-settings: 'wght' 700; }
.buy .pricing .was { color: var(--ink-3); text-decoration: line-through; }
.buy .avail { font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.buy .add {
  display: inline-block; background: var(--ink); color: #fff; border: 0;
  padding: 13px 30px; border-radius: 8px; font: inherit; font-size: 15px;
  font-variation-settings: 'wght' 600; cursor: pointer;
}
.buy .add.ghost { background: #fff; color: var(--ink); border: 1px solid var(--rule); margin-left: 8px; }
.buy .blurb { margin: 24px 0 0; color: var(--ink-2); }

.specs { width: 100%; border-collapse: collapse; margin-top: 26px; }
.specs th, .specs td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.specs th { color: var(--ink-3); font-variation-settings: 'wght' 500; width: 42%; }

.related { border-top: 1px solid var(--rule); padding: 34px 0 70px; }
.related h2 { font-size: 19px; margin: 0 0 20px; font-variation-settings: 'wght' 600; letter-spacing: -.3px; }
.related .grid { grid-template-columns: repeat(4, 1fr); }

/* ---------- footer ---------- */

footer.site { background: var(--wash); border-top: 1px solid var(--rule); padding: 44px 0 30px; }
footer.site .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 820px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
footer.site h5 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .11em;
  color: var(--ink-3); margin: 0 0 12px; font-variation-settings: 'wght' 600;
}
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { padding: 3px 0; }
footer.site a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
footer.site a:hover { color: var(--ink); }
footer.site .signup { display: flex; gap: 8px; margin-top: 12px; }
footer.site .signup input {
  flex: 1; border: 1px solid var(--rule); border-radius: 8px; padding: 9px 12px;
  font: inherit; font-size: 14px; background: #fff;
}
footer.site .signup button {
  border: 0; background: var(--ink); color: #fff; border-radius: 8px;
  padding: 9px 18px; font: inherit; font-size: 14px; cursor: pointer;
}
footer.site .fine {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--rule);
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3);
}
footer.site .fine .sep { margin-left: auto; }

/* ---------- the sandbox banner, so nobody mistakes this for a real shop ---- */

.sandbox {
  background: #16181d; color: #fff; padding: 11px 0; font-size: 13px;
}
.sandbox .shell { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sandbox b { font-variation-settings: 'wght' 600; }
.sandbox a { color: #9fe8d0; }
.sandbox .tag {
  border: 1px solid #3a4048; border-radius: 5px; padding: 2px 8px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9aa2ad;
}

/* ---------- mobile pass ----------
   The storefront chrome was a single flex row that assumed desktop width, so
   the header pushed the document to 751px and every page scrolled sideways at
   any phone size. Layout only: no element is added, removed or renamed, so
   what the extension detects here is unchanged. */

@media (max-width: 700px) {

  .shell { padding: 0 16px; }

  /* The header row: brand, nav and tools could not share 390px. Give the nav
     and the tools their own lines and let the nav scroll if it must. */
  .bar { flex-wrap: wrap; gap: 12px 18px; padding-block: 12px; }
  .bar nav {
    order: 3; width: 100%; gap: 18px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .bar nav::-webkit-scrollbar { display: none; }
  .bar nav a { white-space: nowrap; padding: 11px 0; display: inline-block; }
  .brand { padding: 8px 0; display: inline-block; }
  .sandbox a, .sandbox .shell > a { display: inline-block; padding: 8px 0; }
  .tools { margin-left: auto; gap: 10px; }
  .search { width: 100%; min-width: 0; flex: 1 1 120px; }

  /* A sticky header that eats a third of a phone screen is worse than one
     that scrolls away. */
  header.site { position: static; }

  /* Data tables stay tables -- stacking a price list destroys it -- so they
     scroll inside their own box rather than the page. */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table.data { width: auto; min-width: 100%; }
  .table-scroll th, .table-scroll td { white-space: nowrap; }

  /* Spec pairs read better stacked than squeezed into 42/58. */
  .specs th, .specs td { display: block; width: auto; padding: 0; }
  .specs th { padding-top: 12px; color: var(--ink-3); }
  .specs td { padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
  .specs tr:last-child td { border-bottom: 0; }

  /* Four related products across a phone is 80px each. */
  /* minmax(0,...) not 1fr: a 1fr track refuses to go below its content's
     min-width, which is what pushed the related row past the viewport. */
  .grid, .related .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* The listing toolbar put a 140px select on a margin-left:auto span. */
  .toolbar { flex-wrap: wrap; gap: 8px 12px; }
  .toolbar .right { margin-left: 0; }
  .toolbar select { max-width: 100%; }

  .gallery .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* A card is ~168px at two-up. The price/stars row is a nowrap flex line
     that is wider than that, and a grid track only stops the track from
     growing -- it does not stop the content inside it from spilling. */
  .product .row { flex-wrap: wrap; gap: 4px 9px; }
  .product .stars { letter-spacing: 0; }
  .product h3 { overflow-wrap: anywhere; }

  .pager { flex-wrap: wrap; gap: 6px; }
  .pager a, .pager span { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }

  footer.site .cols { grid-template-columns: 1fr; gap: 26px; }
  footer.site h5 { font-size: 12px; }
  footer.site li { padding: 6px 0; }
  footer.site .fine .sep { margin-left: 0; }
}
