/* Apothify — single design-system stylesheet.
   Brand: #0096C7. Bright white + soft blue. Mobile-first. App-like. */

/* ============================================================
   1. Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, picture, svg, video, canvas { max-width: 100%; display: block; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   2. Design tokens — aligned to the Apothify design spec
   ============================================================ */
:root {
  /* Brand */
  --brand:        #0096C7;     /* primary blue (logo locked) */
  --brand-ink:    #006C91;     /* darker hover / link */

  /* Surfaces */
  --bg:           #FFFFFF;
  --bg-soft:      #F6FBFF;     /* page sections */
  --brand-soft:   #EAF7FC;     /* light blue surface */
  --brand-softer: #DFF5FC;     /* pale tint (selected / hover bg) */

  /* Text */
  --ink:          #0B1F33;     /* H1 / strong text */
  --ink-soft:     #2F3A45;     /* body text */
  --ink-mute:     #6B7C8F;     /* helper / meta */

  /* Lines */
  --line:         #DCEAF5;     /* card border / divider */
  --line-strong:  #B9E2F5;     /* emphasized info border */

  /* Status tiers (calm, not fear-based) */
  --info-bg:       #EAF6FF;
  --info-border:   #B9E2F5;
  --caution-bg:    #FFF4D8;
  --caution-border:#E6B94F;
  --warn-bg:       #FFE8E6;
  --warn-border:   #E26D5A;
  --ok-bg:         #EAF8EF;
  --ok-text:       #1F7A4D;

  /* Legacy single-color shortcuts (kept so older selectors keep working) */
  --ok:           var(--ok-text);
  --warn:         #B7791F;
  --caution:      #C05621;
  --block:        #B91C1C;

  /* Soft shadows — never harsh */
  --shadow-sm:    0 1px 2px rgba(11, 31, 51, .04);
  --shadow-md:    0 6px 20px rgba(11, 31, 51, .06);
  --shadow-lg:    0 14px 40px rgba(11, 31, 51, .08);

  /* Radius scale — clean, app-like */
  --r-sm:         10px;
  --r-md:         20px;
  --r-lg:         26px;
  --r-pill:       999px;

  /* Spacing scale */
  --s-1:          .5rem;
  --s-2:          1rem;
  --s-3:          1.5rem;
  --s-4:          2.5rem;
  --s-5:          4rem;
  --s-6:          6.5rem;     /* big section breathing room */

  /* Layout */
  --max-w:        1220px;
  --container-px: clamp(1.25rem, 4vw, 1.75rem);

  /* Typography */
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

/* ============================================================
   3. Base typography
   ============================================================ */
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.018em; color: var(--ink); line-height: 1.12; }
h1 { font-size: clamp(2.25rem, 2.2vw + 1.6rem, 4rem); line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 1.2vw + 1.3rem, 2.75rem); line-height: 1.12; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, .5vw + 1.05rem, 1.6rem); line-height: 1.2; }
h4 { font-size: 1.15rem; line-height: 1.3; }
p  { color: var(--ink-soft); line-height: 1.65; }
small { color: var(--ink-mute); font-size: .9rem; }

a { color: var(--brand-ink); }
a:hover { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--brand-soft); color: var(--ink); }

/* ============================================================
   4. Layout primitives
   ============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding-left: var(--container-px); padding-right: var(--container-px); }
.section { padding: clamp(3rem, 6vw, var(--s-6)) 0; }
.section-tight { padding: clamp(2rem, 4vw, var(--s-4)) 0; }
.stack > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-3); }

.row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.row.between { justify-content: space-between; }

.grid { display: grid; gap: var(--s-2); }
@media (min-width: 600px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.center { display: flex; align-items: center; justify-content: center; }
.muted { color: var(--ink-mute); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Skip link */
.skip-link { position: absolute; left: -1000px; top: -1000px; padding: .5rem 1rem; background: var(--ink); color: #fff; border-radius: var(--r-sm); }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 1000; }

/* ============================================================
   5. Header / nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner { display: flex; align-items: center; gap: var(--s-2); padding-top: .75rem; padding-bottom: .75rem; }
.brand-link { display: inline-flex; align-items: center; line-height: 0; }
.brand-mark { height: 28px; width: auto; max-width: 180px; display: block; }
@media (min-width: 600px) { .brand-mark { height: 32px; } }

.nav { display: none; gap: 1.25rem; margin-left: auto; align-items: center; }
@media (min-width: 900px) { .nav { display: flex; } }
.nav a { color: var(--ink); font-weight: 500; padding: .35rem .25rem; }
.nav a[aria-current="page"] { color: var(--brand-ink); }

.header-cart { margin-left: auto; }
.cart-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem;
  background: var(--brand-soft); color: var(--brand-ink);
  border-radius: 999px; font-weight: 600;
}
.cart-pill[data-empty="true"] .cart-count { display: none; }
.cart-count { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 .5rem; min-width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }

.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--bg-soft); }
@media (min-width: 900px) { .menu-btn { display: none; } }
.menu-btn svg { width: 22px; height: 22px; }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 100; pointer-events: none; visibility: hidden; }
.drawer[aria-hidden="false"] { pointer-events: auto; visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); opacity: 0; transition: opacity .2s; }
.drawer[aria-hidden="false"] .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(85vw, 360px); background: #fff; transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column; }
.drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-close { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--bg-soft); }
.drawer-nav { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.drawer-nav a { padding: .85rem .5rem; font-size: 1.05rem; color: var(--ink); border-radius: var(--r-sm); }
.drawer-nav a:hover { background: var(--brand-softer); }

/* ============================================================
   6. Hero
   ============================================================ */
.hero {
  padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(2.5rem, 5vw, 5rem);
  background:
    radial-gradient(900px 480px at 85% -10%, var(--brand-softer) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.hero h1 { max-width: 18ch; }
.hero p.lead { font-size: 1.2rem; max-width: 52ch; color: var(--ink-soft); margin-top: var(--s-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--s-3); }

.search-hero { position: relative; max-width: 640px; margin-top: var(--s-3); }
.search-hero input {
  width: 100%; padding: 1.1rem 3.5rem 1.1rem 1.4rem;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-pill);
  font-size: 1.05rem; box-shadow: var(--shadow-sm); color: var(--ink);
}
.search-hero input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); outline: none; }
.search-hero button[type="submit"] {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--r-pill); background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.search-hero button[type="submit"]:hover { background: var(--brand-ink); }

/* ============================================================
   7. Cards, badges, tags
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.card-title { font-weight: 700; font-size: 1.1rem; color: var(--ink); letter-spacing: -.01em; }
.card p { font-size: .98rem; margin-top: .4rem; }
.card-actions { display: flex; gap: .5rem; margin-top: var(--s-2); }

.peptide-card .vial-art {
  height: 160px; border-radius: var(--r-md); background:
    radial-gradient(circle at 30% 25%, #fff 0%, transparent 38%),
    linear-gradient(180deg, var(--brand-softer) 0%, var(--brand-soft) 100%);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--s-2);
  border: 1px solid var(--brand-softer);
}

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: var(--r-pill); font-size: .82rem; font-weight: 600; letter-spacing: -.005em; }
.badge.brand   { background: var(--brand-soft); color: var(--brand-ink); }
.badge.ok      { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn    { background: var(--caution-bg); color: #8a5a18; border: 1px solid var(--caution-border); }
.badge.caution { background: var(--caution-bg); color: #8a5a18; border: 1px solid var(--caution-border); }
.badge.block   { background: var(--warn-bg); color: #8b2820; border: 1px solid var(--warn-border); }

.tag {
  display: inline-block; padding: .25rem .7rem; border-radius: var(--r-pill);
  background: var(--brand-soft); border: 1px solid var(--brand-softer);
  font-size: .82rem; color: var(--brand-ink); font-weight: 500;
}

/* ============================================================
   8. Buttons / forms
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .95rem 1.5rem;
  border-radius: var(--r-pill); font-weight: 600;
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--line);
  min-height: 48px; min-width: 48px;
  transition: transform .12s, background .18s, color .18s, border-color .18s, box-shadow .18s;
  letter-spacing: -.005em;
}
.btn:hover { background: var(--brand-soft); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand); color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 0 rgba(11,31,51,.04), 0 4px 12px rgba(0,150,199,.18);
}
.btn-primary:hover { background: var(--brand-ink); color: #fff; border-color: var(--brand-ink); }

.btn-secondary { background: #fff; color: var(--brand-ink); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.btn-ghost:hover { background: var(--brand-soft); }

.btn-block { width: 100%; }
.btn-lg { padding: 1.1rem 1.85rem; font-size: 1.05rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

label { display: block; font-weight: 600; font-size: .95rem; color: var(--ink); margin-bottom: .4rem; }
.field { margin-bottom: var(--s-2); }
.input, .select, .textarea {
  width: 100%; padding: 1.1rem 1.2rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 1.02rem; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-softer); }
.input[aria-invalid="true"] { border-color: var(--warn-border); }
.field-help { color: var(--ink-mute); font-size: .9rem; margin-top: .35rem; }
.field-error { color: var(--warn-border); font-size: .9rem; margin-top: .35rem; }

.checkbox { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; border-radius: var(--r-sm); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.checkbox:hover { background: var(--brand-soft); }
.checkbox input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--brand); }
.checkbox span { font-size: .98rem; color: var(--ink-soft); line-height: 1.5; }
.checkbox span b { color: var(--ink); }

/* ============================================================
   9. Footer
   ============================================================ */
.site-footer { background: var(--ink); color: #fff; padding: var(--s-4) 0; margin-top: var(--s-5); }
.site-footer h4 { color: #fff; margin-bottom: var(--s-1); font-size: 1rem; }
.footer-mark { height: 36px; width: auto; max-width: 200px; display: block; filter: brightness(0) invert(1); opacity: .95; }
.site-footer a { color: #CBD5E1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--s-3); padding-top: var(--s-2); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; color: #94A3B8; font-size: .85rem; }
.footer-social { display: inline-flex; gap: .6rem; }
.footer-social a { display: inline-block; line-height: 0; transition: transform .15s ease; }
.footer-social a:hover { transform: translateY(-2px); }
.footer-social img { width: 32px; height: 32px; border-radius: 999px; display: block; }
.disclaimer { background: rgba(255,255,255,.05); border-radius: var(--r-md); padding: 1rem 1.25rem; margin-top: var(--s-2); color: #CBD5E1; font-size: .85rem; }

/* ============================================================
   10. Newsletter
   ============================================================ */
.newsletter { background: var(--brand-softer); border-top: 1px solid var(--line); padding: var(--s-4) 0; }
.newsletter form { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--s-2); }
.newsletter input[type="email"] { flex: 1 1 16rem; }

/* ============================================================
   11. Peptide page — five-section layout
   ============================================================ */
.peptide-hero { background: var(--brand-softer); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.peptide-hero .badge-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

.toc {
  position: sticky; top: 72px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2);
}
.toc ol { padding-left: 1.25rem; }
.toc a { color: var(--ink); }

.peptide-section { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.peptide-section:last-child { border-bottom: 0; }
.peptide-section h2 { color: var(--ink); }
.peptide-section h2::before { content: ""; display: inline-block; width: 6px; height: 22px; background: var(--brand); border-radius: 3px; vertical-align: -4px; margin-right: .65rem; }

/* Safety section emphasis — calm, not fear-based */
.safety-callout {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--brand);
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-sm);
  margin-top: var(--s-2);
}
.safety-callout p { color: var(--ink-soft); }

/* ============================================================
   12. Product module
   ============================================================ */
.product-module {
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  padding: var(--s-3); box-shadow: var(--shadow-md);
}
.product-module .price { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.product-module .size  { color: var(--ink-soft); }
.product-module .coa-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--brand-ink); font-weight: 600; }

/* ============================================================
   13. Cart
   ============================================================ */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s-2); align-items: center; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.cart-line .thumb { width: 64px; height: 64px; border-radius: var(--r-md); background: var(--brand-soft); }
.qty-controls { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.qty-controls button { width: 36px; height: 36px; }
.qty-controls input { width: 44px; text-align: center; border: 0; }

.cart-summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-2); }
.cart-summary .row { padding: .35rem 0; }
.cart-summary .total { font-weight: 700; font-size: 1.2rem; color: var(--ink); border-top: 1px solid var(--line); padding-top: .65rem; margin-top: .35rem; }

/* ============================================================
   14. Wizard + vial tray
   ============================================================ */
.wizard-step { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-3); box-shadow: var(--shadow-sm); }
.wizard-options { display: grid; gap: .5rem; }
@media (min-width: 600px) { .wizard-options { grid-template-columns: repeat(2, 1fr); } }
.wizard-option { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.wizard-option:hover { background: var(--brand-softer); border-color: var(--brand); }
.wizard-option[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }

.vial-tray { position: fixed; right: 1rem; bottom: 1rem; left: 1rem; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: .75rem; box-shadow: var(--shadow-lg); display: flex; gap: .5rem; overflow-x: auto; }
@media (min-width: 900px) { .vial-tray { left: auto; right: 1.5rem; bottom: 1.5rem; max-width: 320px; } }
.vial-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; font-size: .85rem; white-space: nowrap; }

/* ============================================================
   15. Track + status
   ============================================================ */
.progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.progress-step { padding: .65rem .75rem; border-radius: var(--r-md); background: var(--bg-soft); color: var(--ink-mute); font-size: .85rem; text-align: center; }
.progress-step.done { background: var(--brand-soft); color: var(--brand-ink); }
.progress-step.current { background: var(--brand); color: #fff; }

/* ============================================================
   16. Flash messages
   ============================================================ */
.flash { padding: .85rem 1rem; border-radius: var(--r-md); margin-bottom: var(--s-2); border: 1px solid; }
.flash.ok    { background: #E7F6EC; border-color: #B8E0C4; color: var(--ok); }
.flash.error { background: #FCE8E8; border-color: #F6BFBF; color: var(--block); }
.flash.warn  { background: #FBF1D9; border-color: #F1DDA5; color: var(--warn); }

/* ============================================================
   17. Compliance footer (research use)
   ============================================================ */
.compliance-strip {
  background: #fff; border-top: 1px solid var(--line); padding: var(--s-2) 0;
  text-align: center; color: var(--ink-mute); font-size: .85rem;
}

/* ============================================================
   17b. Entry modal (age + research-use attestation)
   ============================================================ */
.entry-modal { position: fixed; inset: 0; z-index: 200; visibility: hidden; pointer-events: none; }
.entry-modal[aria-hidden="false"] { visibility: visible; pointer-events: auto; }
.entry-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.7); }
.entry-modal-panel {
  position: relative; max-width: 520px; width: calc(100% - 2rem);
  margin: 8vh auto 0; background: #fff; border-radius: var(--r-lg);
  padding: 1.5rem; box-shadow: var(--shadow-lg);
}
.entry-modal-panel h2 { color: var(--brand-ink); }
.entry-modal-panel .checkbox { padding: .75rem; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: .75rem; }

/* ============================================================
   18. Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
