/* Clean Peptides — main styles
   Design tokens carried over from the original storefront. */

:root {
	--radius: 1rem;
	--bg: oklch(94.5% .003 247);
	--fg: oklch(25.5% .012 255);
	--card: oklch(98.3% .002 247);
	--muted: oklch(91.8% .004 247);
	--muted-fg: oklch(51.5% .011 255);
	--secondary: oklch(91.5% .004 247);
	--border: oklch(87.5% .005 247);
	--primary: oklch(25.5% .012 255);
	--primary-fg: oklch(98.3% .002 247);
	--accent: oklch(62% .075 155);
	--sale: oklch(52% .14 150);
	--danger: oklch(54.5% .19 27.5);
	--shadow-soft: 0 1px 2px oklch(25.5% .012 255 / .04), 0 8px 24px -12px oklch(25.5% .012 255 / .16);
	--shadow-lift: 0 2px 4px oklch(25.5% .012 255 / .05), 0 18px 40px -18px oklch(25.5% .012 255 / .28);
	--font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
	--font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
	--container: 72rem;
	--gutter: clamp(1rem, 3vw, 1.5rem);
	--ease: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--primary); color: var(--primary-fg); padding: .6rem 1rem; border-radius: 0 0 .75rem 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(48rem + var(--gutter) * 2); }

.eyebrow {
	font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	color: var(--muted-fg); margin: 0 0 .9rem; font-family: var(--font-body);
}
.display { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; max-width: 13ch; }
.display--md { font-size: clamp(2.1rem, 4.6vw, 3.5rem); max-width: 22ch; }
.lead { margin-top: 1rem; color: var(--muted-fg); font-size: 1.05rem; max-width: 44rem; }
.lead--wide p { margin: 0; }
.fineprint { margin-top: 1.25rem; font-size: .8rem; color: var(--muted-fg); }

/* ---------- Buttons & pills ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	min-height: 2.75rem; padding: .6rem 1.4rem; border-radius: 999px;
	font-weight: 600; font-size: .9rem; line-height: 1.2; cursor: pointer;
	border: 1px solid transparent; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
	white-space: nowrap;
}
.btn--dark { background: var(--primary); color: var(--primary-fg); }
.btn--dark:hover:not(:disabled) { background: oklch(32% .012 255); box-shadow: var(--shadow-soft); }
.btn--ghost { background: var(--card); border-color: var(--border); color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); }
.btn--block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; }
.btn.is-loading { opacity: .7; pointer-events: none; }

.pill {
	display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
	height: 2.4rem; padding: 0 1rem; border-radius: 999px; font-size: .88rem; font-weight: 500;
	border: 1px solid transparent; cursor: pointer; background: none;
	transition: background .2s var(--ease), border-color .2s var(--ease);
}
.pill--outline { border-color: var(--border); background: var(--card); }
.pill--outline:hover { border-color: var(--fg); }
.pill--dark { background: var(--primary); color: var(--primary-fg); font-weight: 600; }
.pill--sm { height: 2rem; padding: 0 .8rem; font-size: .78rem; gap: .3rem; }
.pill.is-disabled { opacity: .55; cursor: default; }
.pill.is-disabled:hover { border-color: var(--border); }

.icon { display: inline-flex; width: 1em; height: 1em; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill .icon { font-size: 1rem; }

.badge {
	position: absolute; top: .75rem; right: .75rem; z-index: 1;
	padding: .25rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 700;
}
.badge--sale { background: var(--sale); color: #fff; }
.badge[hidden] { display: none; }

/* ---------- Top bar & header ---------- */
.topbar {
	background: var(--primary); color: var(--primary-fg);
	text-align: center; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	padding: .55rem 1rem;
}
.header { position: sticky; top: 0; z-index: 50; padding: .75rem 0; }
.admin-bar .header { top: 32px; }
@media (max-width: 782px) { .admin-bar .header { top: 0; } }
.nav {
	display: flex; align-items: center; gap: 1rem;
	background: oklch(98.3% .002 247 / .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-soft);
	padding: .5rem .6rem .5rem 1.5rem; max-width: calc(var(--container) + .5rem);
	position: relative;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand__img { height: 2.1rem; width: auto; mix-blend-mode: multiply; }
.nav__links { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav__links a { display: inline-flex; align-items: center; height: 2.4rem; padding: 0 1rem; border-radius: 999px; font-size: .9rem; color: var(--muted-fg); transition: background .2s, color .2s; }
.nav__links a:hover { color: var(--fg); }
.nav__links .is-active > a, .nav__links .current-menu-item > a { background: var(--secondary); color: var(--fg); }
.nav__actions { display: flex; align-items: center; gap: .5rem; }
.nav__account { color: var(--muted-fg); }
.cart-pill { min-width: 3.4rem; }
.burger { display: none; width: 2.4rem; padding: 0; }

@media (max-width: 820px) {
	.nav { padding-left: 1.1rem; flex-wrap: wrap; border-radius: 1.6rem; }
	.burger { display: inline-flex; }
	.nav__actions { margin-left: auto; }
	.nav__account > span:not(.icon) { display: none; }
	.nav__account { width: 2.4rem; padding: 0; }
	.nav__links { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; margin: .25rem 0 .25rem; }
	.nav.is-open .nav__links { display: flex; }
	.nav__links a { width: 100%; }
}

/* ---------- Sections ---------- */
.site-main { min-height: 50vh; }
.section { padding: 3rem 0; }
.section--tight { padding-top: 1.5rem; }
.page-head { padding: 3.5rem 0 1rem; }
.page-head--center { text-align: center; padding-bottom: 5rem; }
.page-head--center .display, .page-head--center .lead { margin-inline: auto; }
.page-head--center .btn { margin-top: 2rem; }
.section-title { font-size: 1.35rem; margin-bottom: 1.25rem; }

.panel, .notice-box { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.5); padding: 1.5rem; box-shadow: var(--shadow-soft); }
.prose-list { display: grid; gap: 1rem; }

/* ---------- Catalog ---------- */
.catalog-hero { padding: 3.25rem 0 2.25rem; }
.catalog-hero__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }

.toolbar {
	display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 1.15fr) auto; align-items: center; gap: 1rem;
	background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.75);
	padding: 1.25rem; box-shadow: var(--shadow-soft);
}
.toolbar input[type="search"], .toolbar select {
	width: 100%; height: 2.9rem; border-radius: 999px; border: 1px solid var(--border);
	background: var(--muted); padding: 0 1.1rem; font-size: .9rem; outline: none; transition: border-color .2s, background .2s;
}
.toolbar input[type="search"]:focus, .toolbar select:focus { border-color: var(--fg); background: var(--card); }
.toolbar select { background: var(--card); min-width: 10rem; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
	height: 2rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--border);
	background: var(--secondary); font-size: .78rem; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--fg); }
.chip.is-active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
@media (max-width: 900px) {
	.toolbar { grid-template-columns: 1fr; }
	.toolbar select { width: 100%; }
}

.catalog { padding-bottom: 5rem; }
.catalog__count { font-size: 1.2rem; margin: 2.75rem 0 1.25rem; }
.catalog__count > span { color: var(--muted-fg); }
.catalog__empty { padding: 3rem 0; text-align: center; color: var(--muted-fg); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.75);
	box-shadow: var(--shadow-soft); transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card[hidden] { display: none; }
.card__media { position: relative; display: flex; align-items: center; justify-content: center; background: var(--secondary); aspect-ratio: 16 / 9.4; padding: 1.25rem; }
.card__media img { max-height: 92%; max-width: 62%; width: auto; object-fit: contain; transition: transform .35s var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { display: flex; flex-direction: column; gap: .2rem; padding: 1.25rem 1.25rem 1.25rem; flex: 1; }
.card__title { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.card__dose { font-size: .85rem; color: var(--muted-fg); }
.card__price { margin: .65rem 0 .2rem; }
.card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: auto; padding-top: 1rem; }
.card__actions .btn { padding-inline: .75rem; }

.price { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price__now { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.price__now--muted { font-size: 1rem; font-weight: 600; color: var(--muted-fg); }
.price__was { color: var(--muted-fg); font-size: .95rem; }

.doses { display: flex; flex-wrap: wrap; gap: .4rem; }
.doses--card { display: grid; grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr)); margin-top: .5rem; }
.dose {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	height: 1.9rem; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--border);
	background: var(--secondary); font-size: .78rem; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.dose:hover { border-color: var(--fg); }
.dose.is-active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.dose.is-out:not(.is-active) { color: var(--muted-fg); text-decoration: line-through; }
.dose input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.dose:has(input:focus-visible) { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- Product page ---------- */
.section--product { padding-top: 1.75rem; }
.crumbs { display: flex; gap: .5rem; font-size: .82rem; color: var(--muted-fg); margin-bottom: 1.5rem; flex-wrap: wrap; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg); }

.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail__media {
	position: relative; display: flex; align-items: center; justify-content: center;
	background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.75);
	box-shadow: var(--shadow-soft); aspect-ratio: 1; padding: 2rem; overflow: hidden;
}
@media (min-width: 861px) { .product-detail__media { position: sticky; top: 6.5rem; } }
.product-detail__media img { max-height: 100%; width: auto; object-fit: contain; }
.product-detail__media .badge { top: 1.25rem; right: 1.25rem; font-size: .8rem; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.tags li { font-size: .72rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted-fg); }
.product-detail__title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; letter-spacing: -.03em; }
.product-detail__blurb { margin-top: .9rem; color: var(--muted-fg); max-width: 34rem; }
.product-detail__blurb p { margin: 0; }
.product-detail__price { margin: 1.5rem 0 1.25rem; }
.product-detail__price .price__now { font-size: 1.85rem; }
.product-detail__price .price__was { font-size: 1.1rem; }

.buy__sizes { border: 0; padding: 0; margin: 0 0 1.5rem; }
.buy__sizes .eyebrow { margin-bottom: .6rem; padding: 0; }
.buy__sizes .dose { height: 2.4rem; padding: 0 1.1rem; font-size: .85rem; background: var(--card); }
.buy__sizes .dose.is-active { background: var(--primary); }
.buy__row { display: flex; gap: .75rem; align-items: center; }
.buy__row .btn { min-height: 3rem; flex: 1; }

.qty { display: inline-flex; align-items: center; height: 3rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); padding: 0 .3rem; flex-shrink: 0; }
.qty button { width: 2.2rem; height: 2.2rem; border: 0; background: none; border-radius: 999px; cursor: pointer; font-size: 1rem; }
.qty button:hover { background: var(--secondary); }
.qty input { width: 2.2rem; border: 0; background: none; text-align: center; font-size: .9rem; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.specs { margin: 2rem 0 0; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.25); overflow: hidden; }
.specs > div { display: flex; justify-content: space-between; gap: 1.5rem; padding: .95rem 1.1rem; border-top: 1px solid var(--border); font-size: .85rem; }
.specs > div:first-child { border-top: 0; }
.specs dt { color: var(--muted-fg); }
.specs dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: break-word; min-width: 0; }

.research { margin-top: 2rem; }
.research .eyebrow { margin-bottom: .5rem; }
.research p { color: var(--fg); }
.ruo-note { display: flex; gap: .5rem; align-items: center; margin-top: 1.5rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--secondary); font-size: .82rem; color: var(--muted-fg); }
.ruo-note .icon { font-size: 1rem; flex-shrink: 0; color: var(--fg); }
.section--related { padding-bottom: 5rem; }

/* ---------- Lab results ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.25); padding: 1.25rem; box-shadow: var(--shadow-soft); }
.stat .eyebrow { margin-bottom: .4rem; }
.stat__value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }

.table-card { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow-soft); overflow: hidden; }
.coa-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.coa-table th, .coa-table td { text-align: left; padding: .95rem 1.25rem; border-top: 1px solid var(--border); vertical-align: middle; }
.coa-table thead th { border-top: 0; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-fg); font-weight: 600; background: var(--muted); }
.coa-table tbody th { font-weight: 600; }
.coa-table tbody th a:hover { text-decoration: underline; }
.coa-table__report { text-align: right !important; }
@media (max-width: 720px) {
	.coa-table thead { display: none; }
	.coa-table, .coa-table tbody, .coa-table tr, .coa-table th, .coa-table td { display: block; width: 100%; }
	.coa-table tr { padding: .9rem 1.1rem; border-top: 1px solid var(--border); }
	.coa-table tr:first-child { border-top: 0; }
	.coa-table th, .coa-table td { border: 0; padding: .2rem 0; }
	.coa-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted-fg); }
	.coa-table__report { text-align: left !important; padding-top: .6rem !important; }
}

/* ---------- Long-form text ---------- */
.policy .display { margin-bottom: 1.5rem; }
.prose { font-size: 1rem; line-height: 1.7; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2.5rem; }
.prose h3 { font-size: 1.1rem; margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .5rem; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose .policy-updated { color: var(--muted-fg); font-size: .9rem; }
.prose strong { font-weight: 600; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 3.5rem 0 2.5rem; margin-top: 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 2rem; }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
.footer__brand p { margin-top: 1rem; color: var(--muted-fg); font-size: .9rem; max-width: 18rem; }
.brand--footer .brand__img { height: 2.6rem; }
.footer__col .eyebrow { margin-bottom: 1rem; font-size: .7rem; }
.footer__menu { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .9rem; }
.footer__menu a:hover { text-decoration: underline; text-underline-offset: 2px; }
.footer__menu span { color: var(--fg); }
.footer__base { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.footer__base p { font-size: .78rem; color: var(--muted-fg); max-width: 72rem; }

/* ---------- Age gate ---------- */
.age-gate {
	position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
	padding: 1rem; background: oklch(25.5% .012 255 / .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.age-ok .age-gate, .age-gate[hidden] { display: none; }
.age-locked body { overflow: hidden; }
.age-gate__card {
	width: 100%; max-width: 28rem; text-align: center; background: var(--card); border: 1px solid var(--border);
	border-radius: calc(var(--radius) * 1.75); box-shadow: var(--shadow-lift); padding: 2.25rem 2rem;
}
.brand--gate { justify-content: center; margin-bottom: 1.5rem; }
.brand--gate .brand__img { height: 2.6rem; }
.age-gate__card h2 { font-size: 1.6rem; }
.age-gate__card p { margin-top: .9rem; color: var(--muted-fg); font-size: .92rem; }
.age-gate__actions { display: grid; gap: .6rem; margin-top: 1.75rem; }

/* ---------- Toast ---------- */
.toast {
	position: fixed; left: 50%; bottom: 1.5rem; z-index: 900; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
	display: flex; align-items: center; gap: .9rem; background: var(--primary); color: var(--primary-fg);
	padding: .75rem .9rem .75rem 1.25rem; border-radius: 999px; box-shadow: var(--shadow-lift); font-size: .9rem;
	transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: calc(100vw - 2rem);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { background: var(--primary-fg); color: var(--primary); border-radius: 999px; padding: .35rem .85rem; font-weight: 600; font-size: .8rem; white-space: nowrap; }
.toast.is-error { background: var(--danger); }

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