/* PeptologyRx — design tokens from client-approved Lovable reference */
/* The hidden attribute must beat layout classes (e.g. .checkout-wrap{display:grid})
   so JS-toggled sections like the checkout order panel stay hidden until shown. */
[hidden] { display: none !important; }

:root {
  /* Exact tokens from the Lovable source (src/styles.css) */
  --bg: oklch(0.985 0.008 95);          /* background / cream page */
  --ink: oklch(0.29 0.045 158);         /* foreground — text + headings */
  --green: oklch(0.31 0.045 158);       /* primary (forest) — buttons, links */
  --green-dark: oklch(0.26 0.045 158);  /* button hover */
  --green-soft: oklch(0.93 0.03 150);   /* light mint tint — icon hover */
  --sage: oklch(0.84 0.072 150);        /* mint — nav active pill, band button */
  --forest: oklch(0.31 0.045 158);      /* dark band + announcement bar */
  --sand: oklch(0.93 0.014 84);         /* shop section background */
  --cream: oklch(0.97 0.012 95);        /* forest-foreground — text on dark */
  --card: oklch(0.99 0.006 95);
  --fill: oklch(0.93 0.014 84);
  --muted: oklch(0.52 0.03 155);        /* muted-foreground — green-gray */
  --border: oklch(0.88 0.014 120);
  --ring: oklch(0.31 0.045 158);
  --red: oklch(0.577 0.245 27.325);
  --radius: 1rem;
  --radius-lg: 1.75rem;
  --radius-xl: 2.5rem;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 0.5em; }
.eyebrow { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--muted); margin: 0 0 1.25rem; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
a { color: var(--green); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  padding: 0.8rem 1.6rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.btn-primary { background: var(--green); color: var(--cream); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green); background: var(--green-soft);
  border-radius: 999px; padding: 0.35rem 0.9rem;
}

/* ---------- Announcement bar ---------- */
.announce-bar {
  background: var(--forest); color: var(--cream);
  text-align: center; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.6rem 1rem;
}
.announce-bar .dot { color: var(--sage); margin: 0 0.45rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 250, 241, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--ink); }
.main-nav { display: flex; gap: 0.4rem; align-items: center; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500; padding: 0.4rem 0.95rem; border-radius: 999px; }
.main-nav a:hover { color: var(--green); }
.main-nav a.active { background: var(--sage); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 0.35rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: none; background: none;
  color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--green-soft); color: var(--green); }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; background: none; border: none; border-radius: 999px;
  color: var(--ink); cursor: pointer;
}
.cart-btn:hover { background: var(--green-soft); color: var(--green); }
.cart-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--green); color: var(--cream); border-radius: 999px;
  font-size: 0.68rem; min-width: 1.25em; height: 1.25em; line-height: 1.25em;
  text-align: center; padding: 0 0.28em; font-weight: 700;
}
.cart-count:empty, .cart-count[data-empty="true"] { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
.hero-copy .badge { margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-ctas { display: flex; gap: 0.85rem; margin: 1.9rem 0 1.25rem; flex-wrap: wrap; }
.hero-note { color: var(--muted); font-size: 0.82rem; }
.hero-media { border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 25px 50px -12px color-mix(in oklch, var(--forest) 22%, transparent); }
/* Slow, subtle Ken Burns pan-zoom, contained by the frame's overflow:hidden. */
.hero-media img { width: 100%; aspect-ratio: 1; object-fit: cover; animation: heroKenBurns 24s ease-in-out infinite alternate; will-change: transform; transform-origin: 55% 45%; }
@keyframes heroKenBurns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.5%, -1%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; transform: none; }
}

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section--sand { background: var(--sand); }
.section--sand .catalog-head h2 { color: var(--ink); }
.section-head { max-width: 38rem; margin-bottom: 2.5rem; }
.section-head .badge { margin-bottom: 1rem; }
.section-head p { color: var(--muted); }

/* ---------- Products ---------- */
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.catalog-head h2 { margin: 0; }
.shop-all { color: var(--ink); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.shop-all:hover { color: var(--green); }
.shop-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2.25rem; }
.shop-filter {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  padding: 0.5rem 1.15rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.shop-filter:hover { border-color: var(--green); }
.shop-filter.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem 1.75rem; }
.product-card {
  background: transparent; border: none; display: flex; flex-direction: column;
}
/* Fixed-ratio box so every card (photo or placeholder, vial or pen) is uniform. */
.product-media { position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--fill); transition: transform 0.18s; }
.product-card:hover .product-media { transform: translateY(-3px); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--fill); }
.product-badge {
  position: absolute; top: 0.85rem; left: 0.85rem;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); background: rgba(253, 250, 241, 0.92);
  border-radius: 999px; padding: 0.3rem 0.7rem;
}
.product-body { padding-top: 1.1rem; display: flex; flex-direction: column; flex: 1; }
.product-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.product-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }
.product-price { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; white-space: nowrap; }
.product-dose { color: var(--muted); font-size: 0.78rem; margin-top: 0.25rem; }
.product-blurb {
  color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin: 0.6rem 0 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* In the product detail modal, show the FULL description (override the card clamp), comfortable to read. */
.pmodal-info .product-blurb {
  -webkit-line-clamp: unset; display: block; overflow: visible;
  line-height: 1.72; color: var(--ink); font-size: 1rem; margin-top: 0.9rem;
}
.product-details {
  margin-top: auto; align-self: flex-start; background: none; border: none; padding: 0.6rem 0 0.2rem;
  color: var(--green); font: inherit; font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.product-card:hover .product-details { text-decoration: underline; }
.product-add {
  width: 100%; margin-top: 1rem; background: transparent; color: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.65rem 1rem;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.product-add:hover { background: var(--ink); color: var(--cream); }

/* ---------- Value props ---------- */
.props-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem 1.75rem; }
.prop-card { background: transparent; border: none; padding: 0; }
.prop-icon {
  width: 28px; height: 28px; color: var(--ink);
  display: flex; align-items: center; justify-content: flex-start; margin-bottom: 1.1rem;
}
.prop-card h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; margin-bottom: 0.5rem; }
.prop-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---------- Science band ---------- */
.science-band {
  background: var(--forest); color: var(--cream); border-radius: var(--radius-xl); padding: 3.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.science-eyebrow { font-family: var(--serif); font-style: italic; font-size: 1rem; color: rgba(253, 250, 241, 0.7); display: block; margin-bottom: 1rem; }
.science-band h2 { color: var(--cream); margin-top: 0; }
.science-band p { color: rgba(253, 250, 241, 0.78); font-size: 1.02rem; max-width: 30rem; }
.science-band .btn-primary { background: var(--sage); color: var(--ink); }
.science-band .btn-primary:hover { background: #b4d0a6; }
.science-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.science-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-lg); }

/* ---------- FAQ ---------- */
.faq-section { max-width: 48rem; margin: 0 auto; }
.faq-head { text-align: center; margin-bottom: 3rem; }
.faq-head .eyebrow { margin-bottom: 0.5rem; }
.faq-head h2 { margin: 0; }
.faq-list { text-align: left; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 0; font-weight: 400; font-size: 1rem; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "\203A"; font-size: 1.3rem; color: var(--muted); flex-shrink: 0; transition: transform 0.18s; transform: rotate(90deg); }
.faq-item[open] summary::after { transform: rotate(270deg); }
.faq-item .faq-a { padding: 0 0 1.25rem; color: var(--muted); font-size: 0.92rem; }

/* ---------- Promo + footer ---------- */
.promo-line { text-align: center; font-weight: 600; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 0.85rem 1.5rem; display: inline-block; }
.site-footer { border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding: 4rem 0; }
.site-footer p { color: var(--muted); font-size: 0.85rem; }
.footer-grid .wordmark { display: inline-block; margin-bottom: 1rem; }
.footer-col-title { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.footer-bottom span { color: var(--muted); font-size: 0.78rem; }
@media (max-width: 680px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- Cart drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0, 33, 18, 0.35); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 100;
  background: var(--card); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.cart-head h3 { margin: 0; }
.cart-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0.25rem; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty { color: var(--muted); text-align: center; margin-top: 3rem; }
.cart-row { display: flex; gap: 0.9rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--fill); }
.cart-row-info { flex: 1; min-width: 0; }
.cart-row-name { font-weight: 600; font-size: 0.92rem; }
.cart-row-price { color: var(--muted); font-size: 0.85rem; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.qty-stepper button { background: none; border: none; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; color: var(--ink); }
.qty-stepper span { min-width: 1.6em; text-align: center; font-size: 0.88rem; font-weight: 600; }
.cart-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.78rem; text-decoration: underline; padding: 0; }
.cart-foot { border-top: 1px solid var(--border); padding: 1.25rem 1.5rem; }
.cart-estimate { padding-bottom: 0.75rem; margin-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.cart-subtotal { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 0.35rem; }
.cart-ship-note { color: var(--muted); font-size: 0.82rem; margin-bottom: 1rem; }

/* ---------- Checkout ---------- */
.checkout-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: start; padding: 3rem 0 4rem; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; }
.panel h2 { font-size: 1.45rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px);
  padding: 0.7rem 0.9rem;
}
.field-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.75rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.95rem; padding: 0.3rem 0; }
.summary-row.muted { color: var(--muted); }
.summary-row.discount { color: var(--green); font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--border); margin-top: 0.6rem; padding-top: 0.8rem; }
.code-row { display: flex; gap: 0.6rem; }
.code-row input { flex: 1; text-transform: uppercase; }
.note { font-size: 0.83rem; color: var(--muted); }
.alert { border-radius: var(--radius); padding: 0.85rem 1.1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-error { background: #fdecec; color: var(--red); border: 1px solid #f6c9c9; }
.alert-success { background: var(--green-soft); color: var(--green-dark); border: 1px solid #bfe0d2; }
.success-block { text-align: center; padding: 4rem 1rem; max-width: 34rem; margin: 0 auto; }
.success-block .order-id { font-family: var(--serif); font-size: 1.6rem; color: var(--green); margin: 0.5rem 0 1rem; }

/* ---------- Product detail modal ---------- */
.pmodal-overlay {
  position: fixed; inset: 0; background: rgba(0, 33, 18, 0.4); z-index: 150;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow-y: auto;
}
.pmodal {
  background: var(--card); border-radius: var(--radius-xl); width: 100%; max-width: 880px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem; position: relative;
  max-height: 90vh; overflow: hidden;
}
/* Two-column desktop: image fixed, info column scrolls so long copy stays reachable. */
.pmodal-info { max-height: calc(90vh - 4rem); overflow-y: auto; padding-right: 0.25rem; }
.pmodal-close {
  position: absolute; top: 1rem; right: 1.25rem; background: none; border: none;
  font-size: 1.7rem; color: var(--muted); cursor: pointer; line-height: 1; z-index: 1;
}
.pmodal-main-img { position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--fill); border: 1px solid var(--border); }
.pmodal-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pmodal-thumbs { display: flex; gap: 0.55rem; margin-top: 0.75rem; flex-wrap: wrap; }
.pmodal-thumb {
  width: 62px; height: 62px; border-radius: 12px; overflow: hidden; padding: 0;
  border: 2px solid var(--border); background: var(--fill); cursor: pointer;
}
.pmodal-thumb.active { border-color: var(--green); }
.pmodal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pmodal-info { display: flex; flex-direction: column; gap: 0.5rem; }
.pmodal-info .product-tag {
  align-self: flex-start; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green); background: var(--green-soft);
  border-radius: 999px; padding: 0.3rem 0.7rem;
}
.pmodal-info .product-price { font-weight: 500; }
.pmodal-info .product-price { font-size: 1.6rem; font-family: var(--serif); }
.pmodal-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 1rem; }
@media (max-width: 720px) {
  /* Single column: let the whole modal scroll as one, image included. */
  .pmodal { grid-template-columns: 1fr; padding: 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .pmodal-info { max-height: none; overflow: visible; padding-right: 0; }
}

/* ---------- Product detail page (PDP) ---------- */
.pdp { max-width: 1040px; margin: 0 auto; }
.pdp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 2rem; }
.pdp-crumbs a { color: var(--muted); text-decoration: none; }
.pdp-crumbs a:hover { color: var(--green); }
.pdp-crumbs span[aria-hidden] { color: var(--border); }

.pdp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: start; }

.pdp-media-sticky { position: sticky; top: 92px; }
.pdp-main-img { position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--fill); border: 1px solid var(--border); }
.pdp-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumbs { display: flex; gap: 0.6rem; margin-top: 0.85rem; flex-wrap: wrap; }
.pdp-thumb { width: 68px; height: 68px; padding: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--fill); cursor: pointer; transition: border-color 0.15s ease; }
.pdp-thumb:hover { border-color: var(--green); }
.pdp-thumb.active { border-color: var(--green); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pdp-info { display: flex; flex-direction: column; }
.pdp-info .product-tag {
  align-self: flex-start; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green); background: var(--green-soft);
  border-radius: 999px; padding: 0.3rem 0.7rem; margin-bottom: 1rem;
}
.pdp-title { font-family: var(--serif); font-size: 2.4rem; font-weight: 500; line-height: 1.1; margin: 0; }
.pdp-dose { color: var(--muted); font-size: 0.92rem; margin: 0.6rem 0 0; }
.pdp-dose-sep { color: var(--border); margin: 0 0.15rem; }
.pdp-desc { color: var(--ink); font-size: 1rem; line-height: 1.7; margin: 1.6rem 0 0; }

.pdp-specs { width: 100%; border-collapse: collapse; margin: 1.75rem 0 0; font-size: 0.9rem; }
.pdp-specs th, .pdp-specs td { text-align: left; padding: 0.55rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.pdp-specs tr:last-child th, .pdp-specs tr:last-child td { border-bottom: 0; }
.pdp-specs th { font-weight: 500; color: var(--muted); width: 40%; white-space: nowrap; }
.pdp-specs td { color: var(--ink); }

.pdp-price-note { margin: 1.5rem 0 0; }
.pdp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin: 1.25rem 0 0; }
.pdp-add { min-width: 200px; }
.pdp-coa-link { color: var(--green); }
.pdp-disclaimer { margin: 1.1rem 0 0; }

.pdp-related { margin-top: 4.5rem; padding-top: 3rem; border-top: 1px solid var(--border); }

.pdp-missing { text-align: center; padding: 3rem 0 4rem; max-width: 34rem; margin: 0 auto; }
.pdp-missing h1 { font-family: var(--serif); font-size: 2rem; }
.pdp-missing .btn { margin-top: 1.5rem; }

@media (max-width: 820px) {
  .pdp-grid { grid-template-columns: 1fr; gap: 2rem; }
  /* Single column stacked on mobile: image on top, sticky disabled. */
  .pdp-media-sticky { position: static; top: auto; }
  .pdp-title { font-size: 2rem; }
  .pdp-related { margin-top: 3rem; padding-top: 2.25rem; }
}

/* ---------- COA page ---------- */
.coa-toolbar { max-width: 50rem; margin-bottom: 1.25rem; }
.coa-search-wrap { position: relative; }
.coa-search-wrap svg { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.coa-search {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.85rem 1.25rem 0.85rem 2.9rem;
}
.coa-search:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-color: var(--green); }
.coa-count { max-width: 50rem; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.85rem; }
.coa-list { display: grid; gap: 0.85rem; max-width: 50rem; }
.coa-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--fill); flex-shrink: 0; }
.coa-row {
  display: flex; align-items: center; gap: 1.1rem; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.4rem; flex-wrap: wrap;
}
.coa-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.coa-meta { flex: 1; min-width: 200px; }
.coa-title { font-weight: 600; }
.coa-sub { color: var(--muted); font-size: 0.85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .checkout-wrap, .science-band { grid-template-columns: 1fr; }
  .props-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
  .science-band { padding: 2.25rem 1.5rem; gap: 2rem; }
  .science-band p { max-width: none; }
}
@media (max-width: 480px) {
  .props-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile navigation (hamburger + drawer) ---------- */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; margin-left: 0.15rem; padding: 0 9px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(0, 33, 18, 0.35); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.mobile-nav-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-nav {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw); z-index: 100;
  background: var(--card); border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0, 33, 18, 0.12);
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 5.5rem 1.25rem 2rem; overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-links { display: flex; flex-direction: column; gap: 0.2rem; }
.mobile-nav-links a {
  color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 500;
  padding: 0.85rem 0.85rem; border-radius: 0.7rem; transition: background 0.15s, color 0.15s;
}
.mobile-nav-links a:hover { background: var(--green-soft); color: var(--green); }
.mobile-nav-links a.active { background: var(--sage); color: var(--ink); }

@media (max-width: 860px) { .nav-toggle { display: flex; } }
@media (min-width: 861px) { .mobile-nav, .mobile-nav-overlay { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Referral-code gate (checkout) ---------- */
.gate-items { margin: 0.5rem 0; }
.gate-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.gate-item:last-child { border-bottom: 0; }
.gate-or { display: flex; align-items: center; text-align: center; color: var(--muted); margin: 1.25rem 0; font-size: 0.85rem; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.gate-or span { padding: 0 0.85rem; }

/* ---------- Consultation questionnaire ---------- */
.q-main { max-width: 720px; }
.q-intro { text-align: center; margin: 1.5rem auto 1.75rem; max-width: 620px; }
.q-intro h1 { font-size: 1.9rem; }
.q-progress { height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; margin-bottom: 0.6rem; }
.q-progress-bar { height: 100%; background: var(--green); border-radius: 999px; transition: width 0.3s ease; width: 0; }
.q-step-label { font-size: 0.85rem; margin: 0 0 1rem; }
.q-panel { padding: 1.5rem; }
.q-field { margin-bottom: 1.25rem; }
.q-field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; }
.q-field input, .q-field textarea { width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 0.7rem; font: inherit; color: var(--ink); background: var(--card); }
.q-field input:focus, .q-field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.q-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.q-chip { padding: 0.5rem 0.95rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; transition: all 0.15s ease; }
.q-chip:hover { border-color: var(--green); }
.q-chip.on { background: var(--green); color: var(--cream); border-color: var(--green); }
.q-nav { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.q-disclaimer { text-align: center; margin: 1rem auto 0; max-width: 560px; }
@media (prefers-reduced-motion: reduce) { .q-progress-bar, .q-chip { transition: none; } }

/* questionnaire: required marker + consent */
.q-req { color: var(--red); font-weight: 700; }
.q-consent { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.92rem; line-height: 1.5; cursor: pointer; }
.q-consent input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--green); }

/* ---------- Shop: category tiles (click to reveal a category's medications) ---------- */
/* Equal-height grid cells + a tile that fills its cell, so a 2-line title
   ("Mental Health and Focus") and a 1-line title ("Metabolic") produce the
   same card height. */
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
@media (max-width: 860px) { .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .category-grid { grid-template-columns: 1fr; } }
/* Image-forward overlay card: the whole card is the image, with the name +
   count laid over a bottom-up scrim, so there is no dead white space. */
.category-tile { position: relative; display: block; height: 100%; text-align: left; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--green); cursor: pointer; overflow: hidden; font: inherit; color: var(--cream); transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.category-tile:hover { border-color: var(--green); transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 33, 18, 0.16); }
.category-tile:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.category-tile-media { position: relative; aspect-ratio: 1 / 1; width: 100%; height: 100%; background: var(--sand); overflow: hidden; }
.category-tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.category-tile:hover .category-tile-media img { transform: scale(1.05); }
/* Bottom-up dark scrim so overlaid text stays legible over any photo. */
.category-tile-scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 24, 13, 0.72) 0%, rgba(0, 24, 13, 0.34) 34%, rgba(0, 24, 13, 0) 62%); pointer-events: none; }
.category-tile-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.1rem 1.05rem; display: flex; flex-direction: column; gap: 0.15rem; }
.category-tile-name { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; color: var(--cream); }
.category-tile-count { font-size: 0.85rem; color: color-mix(in oklch, var(--cream) 82%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .category-tile { transition: none; }
  .category-tile:hover { transform: none; }
  .category-tile-media img { transition: none; }
  .category-tile:hover .category-tile-media img { transform: none; }
}

/* ---------- Shop: category filter pills ---------- */
.filter-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2rem; }
.filter-pill { font: inherit; font-size: 0.9rem; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; }
.filter-pill:hover { border-color: var(--green); }
.filter-pill.active { background: var(--green); border-color: var(--green); color: var(--sand); }
@media (prefers-reduced-motion: reduce) { .filter-pill { transition: none; } }

.category-tile-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 3rem; color: var(--sage); background: var(--green); }

/* Placeholder for products without a photo yet (keeps cards/modal from showing a broken image) */
.product-ph { display: flex; align-items: center; justify-content: center; background: var(--green); color: var(--cream); font-family: var(--serif); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.01em; }
/* Placeholder fills its fixed-ratio parent box (product card + modal main image). */
.product-media .product-ph, .pmodal-main-img .product-ph { position: absolute; inset: 0; width: 100%; height: 100%; }
.product-ph span { color: var(--sage); }

/* FAQ answer: structured lists (medical-grade comparison) */
.faq-a .faq-subhead { font-weight: 700; color: var(--ink); margin: 0.9rem 0 0.4rem; }
.faq-a ul { margin: 0 0 0.6rem; padding-left: 1.2rem; }
.faq-a li { margin-bottom: 0.4rem; }

/* ---------- Provider Portal ---------- */
.prov-cat-group { margin-bottom: 2.5rem; }
.prov-cat-title { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 1.25rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.prov-card { cursor: default; }
.prov-price { display: flex; align-items: baseline; gap: 0.4rem; margin: 0.6rem 0 0.9rem; }
.prov-price-amt { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--green); }
.prov-add-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.prov-line-total { font-weight: 700; font-size: 0.9rem; margin-top: 0.4rem; }

/* Provider wholesale catalog — clean list/table view (thumbnail, product, price, order). */
.prov-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.prov-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prov-table thead th {
  text-align: left; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border); background: var(--sand);
}
.prov-table tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.prov-table tbody tr:last-child td { border-bottom: 0; }
.prov-table tbody tr:hover { background: var(--fill); }
.prov-row-img { width: 60px; }
.prov-row-img img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; display: block; background: var(--sand); }
.prov-row-ph {
  width: 46px; height: 46px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--green); color: var(--cream); font-family: var(--serif); font-size: 0.95rem;
}
.prov-row-name { min-width: 180px; }
.prov-row-title { display: block; font-weight: 600; color: var(--ink); }
.prov-row-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.prov-row-price { white-space: nowrap; }
.prov-row-price .prov-price-amt { font-size: 1.05rem; }
.prov-row-retail { color: var(--muted); }
.prov-price-retail { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.prov-row-order { display: flex; gap: 0.5rem; align-items: center; white-space: nowrap; }
@media (max-width: 640px) {
  .prov-table thead th, .prov-table tbody td { padding: 0.5rem 0.6rem; }
  .prov-row-sub { display: none; }
  .prov-row-order { flex-wrap: wrap; }
}
/* Single-column modal for provider checkout (overrides the two-column product modal). */
.prov-co-modal { grid-template-columns: 1fr; max-width: 560px; overflow-y: auto; }
.prov-co-body { max-height: calc(90vh - 4rem); overflow-y: auto; }
.prov-co-summary { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---------- Unified login: role segmented control ---------- */
/* Pill track holding two roles, single active state (refero segmented-control pattern):
   rounded track, active segment filled with brand forest + cream text, inactive transparent. */
.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.3rem;
  margin: 0.35rem 0 1.5rem;
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.role-toggle button {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  padding: 0.6rem 0.5rem;
  line-height: 1;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.role-toggle button:hover { color: var(--ink); }
.role-toggle button[aria-selected="true"] {
  background: var(--green);
  color: var(--cream);
  box-shadow: 0 2px 8px -2px color-mix(in oklch, var(--forest) 45%, transparent);
}
.role-toggle button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
@media (max-width: 560px) { .prov-add-row { flex-wrap: wrap; } }

/* ---------- Unified login: frosted-glass panel (light glassmorphism) ---------- */
/* Fallback: a solid tinted card for browsers without backdrop-filter. */
#unifiedLogin .panel {
  background: color-mix(in oklch, var(--card) 88%, transparent);
  border: 1px solid color-mix(in oklch, #ffffff 60%, var(--border));
  box-shadow: 0 20px 45px -18px color-mix(in oklch, var(--forest) 30%, transparent),
              inset 0 1px 0 color-mix(in oklch, #ffffff 55%, transparent);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #unifiedLogin .panel {
    background: color-mix(in oklch, var(--card) 62%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.35);
    backdrop-filter: blur(16px) saturate(1.35);
  }
}

/* ---------- Micro-animations: viewport reveal + primary button lift ---------- */
/* Cards + sections fade-in-up as they enter the viewport. JS adds .in when
   visible; the base .reveal state is only applied when JS + motion are allowed
   (via html.reveal-ready) so server/JS-rendered grids never stay hidden. */
.reveal-ready .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; will-change: opacity, transform; }
.reveal-ready .reveal.in { opacity: 1; transform: none; }
/* Primary button hover lift */
.btn-primary { transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px color-mix(in oklch, var(--forest) 55%, transparent); }
.btn-primary:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  .btn-primary { transition: background 0.18s, border-color 0.18s, color 0.18s; }
  .btn-primary:hover { transform: none; box-shadow: none; }
}

/* Shop header: heading + search on one row (desktop); stacked full-width on phones. */
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.shop-search-wrap { position: relative; width: 340px; max-width: 100%; }
.shop-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.shop-search {
  width: 100%; padding: 0.7rem 1.1rem 0.7rem 2.7rem; border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.98rem; font-family: var(--sans); color: var(--ink);
  background: var(--card); box-sizing: border-box;
}
@media (max-width: 640px) {
  .shop-head { flex-direction: column; align-items: stretch; }
  .shop-head-title { text-align: left; }
  .shop-search-wrap { width: 100%; }
}
