/* ============================================================
   FIRST Nutrient & Supplement — storefront
   Design system: the Supplement Facts panel as UI primitive.
   Rule weights carry hierarchy the way they do on a real label:
   8px = section break, 4px = subsection, 1px = row.
   ============================================================ */

:root {
  --ink:      #14171A;
  --ink-70:   #4A5056;
  --ink-40:   #8B9198;
  --mineral:  #ECEDE7;   /* page ground */
  --panel:    #FFFFFF;
  --rubber:   #0D2B31;   /* Akron deep teal */
  --volt:     #1F4FD8;   /* actions */
  --volt-dim: #E7EDFC;
  --zest:     #C9E33B;   /* in-stock / ready */
  --clay:     #B4472C;   /* alerts */
  --hair:     #D3D5CD;

  --rule-heavy: 8px;
  --rule-mid:   4px;
  --rule-hair:  1px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;

  --font-ui:   'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mineral);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

a { color: var(--volt); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--volt);
  outline-offset: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4); }

/* ---- Type scale --------------------------------------------------- */

.eyebrow {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-70);
  margin: 0 0 var(--sp-2);
}

h1, .h1 {
  font-size: clamp(38px, 7vw, 74px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.94;
  margin: 0 0 var(--sp-3);
  text-transform: uppercase;
}

h2, .h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0 0 var(--sp-3);
}

h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--sp-2); }

.lede { font-size: 18px; color: var(--ink-70); max-width: 56ch; }
.small { font-size: 13px; color: var(--ink-70); }
.data { font-family: var(--font-data); font-size: 13px; letter-spacing: -0.01em; }

/* ---- Rules: the label grammar ------------------------------------- */

.rule-heavy { border: 0; border-top: var(--rule-heavy) solid var(--ink); margin: 0; }
.rule-mid   { border: 0; border-top: var(--rule-mid)   solid var(--ink); margin: 0; }
.rule-hair  { border: 0; border-top: var(--rule-hair)  solid var(--hair); margin: 0; }

/* ---- Header -------------------------------------------------------- */

.masthead {
  background: var(--panel);
  border-bottom: var(--rule-heavy) solid var(--ink);
  position: sticky; top: 0; z-index: 40;
}

.masthead-in {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-5);
}

.wordmark {
  font-weight: 800; font-size: 26px; letter-spacing: -0.05em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  display: flex; align-items: baseline; gap: 7px;
}
.wordmark:hover { text-decoration: none; }
.wordmark small {
  font-family: var(--font-data); font-size: 9px; letter-spacing: 0.16em;
  color: var(--ink-40); font-weight: 400;
}

.nav { display: flex; gap: var(--sp-4); margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink); font-size: 14px; font-weight: 600;
  text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); text-decoration: none; }

.cart-pill {
  background: var(--ink); color: var(--panel);
  font-family: var(--font-data); font-size: 12px;
  padding: 8px 14px; border-radius: 999px; display: inline-flex; gap: 8px;
}
.cart-pill:hover { text-decoration: none; background: var(--rubber); }

/* ---- Store status strip ------------------------------------------- */

.status-strip {
  background: var(--rubber); color: #E4EAE9;
  font-family: var(--font-data); font-size: 11px; letter-spacing: 0.06em;
  padding: 7px 0; text-transform: uppercase;
}
.status-strip .wrap { display: flex; gap: var(--sp-4); flex-wrap: wrap; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--zest); margin-right: 6px; }
.dot.closed { background: var(--clay); }

/* ---- Hero: the shelf-talker --------------------------------------- */

.hero { background: var(--panel); border-bottom: var(--rule-heavy) solid var(--ink); }
.hero-in {
  max-width: var(--maxw); margin: 0 auto; padding: var(--sp-7) var(--sp-4) var(--sp-6);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-7); align-items: end;
}
.hero h1 span { display: block; color: var(--volt); }

.hero-facts { border-top: var(--rule-mid) solid var(--ink); padding-top: var(--sp-3); }
.hero-facts dl { margin: 0; }
.hero-facts div {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  padding: 9px 0; border-bottom: var(--rule-hair) solid var(--hair);
}
.hero-facts dt { font-size: 13px; font-weight: 600; }
.hero-facts dd { margin: 0; font-family: var(--font-data); font-size: 13px; color: var(--ink-70); text-align: right; }

/* ---- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 700;
  letter-spacing: 0.01em; padding: 13px 22px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--panel); cursor: pointer;
  border-radius: 2px; text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--rubber); border-color: var(--rubber); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.btn-primary { background: var(--volt); border-color: var(--volt); }
.btn-primary:hover { background: #163CAA; border-color: #163CAA; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--panel); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- Category rail ------------------------------------------------- */

.rail {
  display: flex; gap: var(--sp-2); overflow-x: auto; padding: var(--sp-4) 0;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail a {
  white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink);
  border: 1.5px solid var(--ink); padding: 8px 15px; border-radius: 999px;
  background: transparent;
}
.rail a:hover, .rail a.on { background: var(--ink); color: var(--panel); text-decoration: none; }

/* ---- SIGNATURE: the product label panel ---------------------------- */

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: var(--sp-4); padding-bottom: var(--sp-7);
}

.label-card {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  display: flex; flex-direction: column;
  position: relative;
}

.label-card__head {
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: var(--rule-heavy) solid var(--ink);
}
.label-card__brand {
  font-family: var(--font-data); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-40);
}
.label-card__name {
  font-size: 20px; font-weight: 800; letter-spacing: -0.028em;
  line-height: 1.05; margin: 3px 0 0; text-transform: uppercase;
}
.label-card__sub { font-size: 12px; color: var(--ink-70); margin-top: 3px; }

.label-card__serving {
  display: flex; justify-content: space-between;
  padding: 7px var(--sp-3); font-size: 12px; font-weight: 700;
  border-bottom: var(--rule-mid) solid var(--ink);
}
.label-card__serving span:last-child { font-family: var(--font-data); font-weight: 400; }

.facts { padding: 0 var(--sp-3); margin: 0; flex: 1; }
.facts__row {
  display: flex; justify-content: space-between; gap: var(--sp-2);
  padding: 6px 0; border-bottom: var(--rule-hair) solid var(--hair);
  font-size: 13px;
}
.facts__row:last-child { border-bottom: 0; }
.facts__row b { font-weight: 700; }
.facts__row span { font-family: var(--font-data); font-size: 12px; color: var(--ink-70); }

.label-card__foot {
  border-top: var(--rule-mid) solid var(--ink);
  padding: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-3);
}
.price { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.price s { font-size: 14px; font-weight: 400; color: var(--ink-40); margin-left: 6px; }
.label-card__foot .btn { margin-left: auto; }

.stock-tag {
  position: absolute; top: -1.5px; right: -1.5px;
  font-family: var(--font-data); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 9px;
  background: var(--zest); color: var(--ink); border: 1.5px solid var(--ink);
}
.stock-tag.low  { background: #F6C544; }
.stock-tag.out  { background: var(--ink); color: var(--panel); }

/* ---- Product page --------------------------------------------------- */

.product { display: grid; grid-template-columns: 1fr 420px; gap: var(--sp-7); padding: var(--sp-6) 0; }
@media (max-width: 900px) { .product { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1.5px solid var(--ink); padding: var(--sp-5);
}
.panel + .panel { margin-top: var(--sp-4); }

.variant-list { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.variant {
  display: flex; align-items: center; gap: var(--sp-3);
  border: 1.5px solid var(--hair); padding: var(--sp-3); cursor: pointer;
  background: var(--panel);
}
.variant:has(input:checked) { border-color: var(--volt); background: var(--volt-dim); }
.variant input { accent-color: var(--volt); }
.variant__meta { flex: 1; }
.variant__price { font-family: var(--font-data); font-weight: 600; }

.dshea {
  border-top: var(--rule-mid) solid var(--ink); margin-top: var(--sp-5);
  padding-top: var(--sp-3); font-size: 11px; color: var(--ink-70); line-height: 1.45;
}

/* ---- Forms ---------------------------------------------------------- */

label.field { display: block; margin-bottom: var(--sp-3); }
label.field > span {
  display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 5px;
}
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font-family: var(--font-ui); font-size: 15px;
  padding: 11px 12px; border: 1.5px solid var(--ink); border-radius: 2px;
  background: var(--panel); color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 620px) { .row2 { grid-template-columns: 1fr; } }

/* ---- Cart / checkout ------------------------------------------------ */

.checkout { display: grid; grid-template-columns: 1fr 380px; gap: var(--sp-5); padding: var(--sp-6) 0; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }

.summary { position: sticky; top: 96px; align-self: start; }
.summary__row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: var(--rule-hair) solid var(--hair); font-size: 14px;
}
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: var(--rule-heavy) solid var(--ink); margin-top: var(--sp-2); padding-top: var(--sp-3);
  font-size: 22px; font-weight: 800;
}

.line {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-3);
  align-items: center; padding: var(--sp-3) 0;
  border-bottom: var(--rule-hair) solid var(--hair);
}
.qty { display: flex; border: 1.5px solid var(--ink); }
.qty button {
  width: 34px; height: 34px; border: 0; background: transparent;
  font-size: 17px; cursor: pointer; font-family: var(--font-ui);
}
.qty input { width: 44px; border: 0; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink);
  text-align: center; font-family: var(--font-data); padding: 0; height: 34px; }

.seg { display: flex; border: 1.5px solid var(--ink); }
.seg label {
  flex: 1; text-align: center; padding: 12px; cursor: pointer; font-weight: 700; font-size: 14px;
}
.seg label:has(input:checked) { background: var(--ink); color: var(--panel); }
.seg input { position: absolute; opacity: 0; }

/* ---- Order status tracker ------------------------------------------ */

.tracker { display: flex; gap: 3px; margin: var(--sp-4) 0; }
.tracker div {
  flex: 1; height: 8px; background: var(--hair);
}
.tracker div.on { background: var(--zest); }
.tracker div.now { background: var(--volt); }

.pickup-code {
  font-family: var(--font-data); font-size: 46px; font-weight: 700;
  letter-spacing: 0.12em; border: var(--rule-mid) solid var(--ink);
  padding: var(--sp-3) var(--sp-4); display: inline-block; background: var(--zest);
}

/* ---- Flash notices --------------------------------------------------- */

.notice {
  border-left: var(--rule-heavy) solid var(--ink); background: var(--panel);
  padding: var(--sp-3) var(--sp-4); margin: var(--sp-4) 0; font-size: 14px;
}
.notice.err { border-left-color: var(--clay); }
.notice.ok  { border-left-color: var(--zest); }

.empty {
  border: 1.5px dashed var(--hair); padding: var(--sp-7) var(--sp-4);
  text-align: center; color: var(--ink-70);
}

/* ---- Footer ---------------------------------------------------------- */

.foot {
  background: var(--rubber); color: #C6D2D1; margin-top: var(--sp-8);
  border-top: var(--rule-heavy) solid var(--ink); padding: var(--sp-7) 0 var(--sp-5);
}
.foot a { color: #FFF; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot h4 { font-family: var(--font-data); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #7E9B99; margin: 0 0 var(--sp-3); }
.foot ul { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 2; }
.foot .fine { font-size: 11px; color: #7E9B99; margin-top: var(--sp-5); line-height: 1.6; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: var(--sp-5); }
  .nav { gap: var(--sp-3); }
  .nav a.hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
