/*
Theme Name: Rexa Research
Theme URI: https://rexharesearch.com/
Author: Rexa Research
Description: Fast, lightweight instrument-grade storefront theme for research peptides. White & yellow lab aesthetic, zero frameworks, no jQuery, catalogue + cart + checkout built in.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: rexa-research
Tags: one-column, custom-colors, e-commerce
*/

:root {
  --bg: #fff;
  --fg: #14161c;
  --muted: rgba(20, 22, 28, 0.62);
  --surface: #f7f7f4;
  --border: rgba(20, 22, 28, 0.14);
  --accent: #f2d302;
  --accent-ink: #8a7202;
  --accent-fg: #14161c;
  --radius: 2px;
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; margin: 0; }
::selection { background: var(--accent); color: var(--accent-fg); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.ink { color: var(--accent-ink); }
.skip-link { position: absolute; left: -9999px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}
.nav-in { display: flex; height: 56px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.04em; }
.nav-links { display: none; gap: 16px; }
.nav-links a:hover { color: var(--accent-ink); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.stock { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 4px 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.cart-btn { border: 1px solid var(--border); background: transparent; padding: 7px 10px; }
.cart-btn:hover { border-color: var(--accent); background: var(--surface); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* Hero */
.hero { display: flex; flex-direction: column; gap: 20px; padding: 48px 0 32px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.tag { display: inline-block; border: 1px solid rgba(242, 211, 2, 0.5); padding: 2px 8px; color: var(--accent-ink); align-self: flex-start; }
.hero h1 { font-size: clamp(38px, 8vw, 72px); line-height: 0.92; max-width: 22ch; }
.hero p { max-width: 46ch; color: var(--muted); margin: 0; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-fg);
  padding: 12px 28px; font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: -0.02em; border: 0;
}
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }

/* Trust bar */
.trust { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(247, 247, 244, 0.5); }
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.trust-grid > div { padding: 14px 20px; border-left: 1px solid var(--border); }
.trust-grid > div:first-child { border-left: 0; }
@media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }

/* Catalogue */
.section { padding: 56px 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-head h2 { font-size: 24px; text-transform: uppercase; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; }
.chip { border: 1px solid var(--border); background: transparent; padding: 6px 12px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card:hover { background: var(--surface); }
.card .thumb { border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.card .thumb img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.card h3 { font-size: 17px; text-transform: uppercase; line-height: 1.15; }
.card a:hover h3 { color: var(--accent-ink); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.price { font-family: var(--font-mono); font-size: 12px; display: block; text-align: right; }
.was { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-decoration: line-through; display: block; text-align: right; }
.sizes { display: flex; flex-wrap: wrap; gap: 4px; }
.size { border: 1px solid var(--border); background: transparent; padding: 4px 8px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--muted); }
.size:hover { border-color: var(--accent); }
.size[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.add { margin-top: auto; width: 100%; border: 1px solid var(--border); background: transparent; padding: 9px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.add:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }

/* Bundle band */
.band { background: var(--accent); color: var(--accent-fg); padding: 28px 0; }
.band-in { display: flex; flex-direction: column; gap: 20px; align-items: center; justify-content: space-between; }
.band h3 { font-size: 28px; text-transform: uppercase; }
.band img { width: 92px; height: 92px; object-fit: cover; display: none; }
@media (min-width: 640px) { .band img { display: block; } }
@media (min-width: 768px) { .band-in { flex-direction: row; } }

/* Batches */
.batches { border-bottom: 1px solid var(--border); background: rgba(247, 247, 244, 0.35); padding: 12px 0; }
.batches-in { display: flex; gap: 40px; overflow-x: auto; white-space: nowrap; }

/* FAQ + notice */
.narrow { max-width: 760px; margin: 0 auto; }
details { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 14px; }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-weight: 500; font-size: 14px; }
summary::-webkit-details-marker { display: none; }
details p { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.notice { border: 1px solid var(--border); background: var(--surface); padding: 20px; }
.notice p { font-size: 10px; text-transform: uppercase; line-height: 1.7; color: var(--muted); margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-in { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: space-between; }
.footer-in nav { display: flex; gap: 20px; }
@media (min-width: 768px) { .footer-in { flex-direction: row; } }

/* Product page */
.pdp { display: grid; gap: 32px; padding: 32px 0 56px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pdp { grid-template-columns: 1fr 1fr; gap: 48px; } }
.pdp-media { border: 1px solid var(--border); background: var(--surface); }
.pdp h1 { font-size: clamp(30px, 5vw, 46px); text-transform: uppercase; line-height: 0.95; }
.pdp-price { font-family: var(--font-mono); font-size: 22px; }
.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.spec > div { background: var(--bg); padding: 14px; }
.crumbs { padding: 16px 0 0; }

/* Cart drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 22, 28, 0.45); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 400px;
  background: var(--bg); border-left: 1px solid var(--border); z-index: 61;
  display: flex; flex-direction: column;
}
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
.drawer-head, .drawer-foot { padding: 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-foot { border-bottom: 0; border-top: 1px solid var(--border); display: block; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { border: 1px solid var(--border); background: transparent; width: 24px; height: 24px; line-height: 1; }
.qty button:hover { border-color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--muted); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; }

/* Checkout */
.checkout { display: grid; gap: 32px; padding: 32px 0 56px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1.2fr 0.8fr; gap: 48px; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.field input, .field textarea, .field select {
  border: 1px solid var(--border); background: var(--bg); padding: 10px; font: inherit; font-size: 14px; border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; } }
.summary { border: 1px solid var(--border); background: var(--surface); padding: 18px; }
.summary .line { border-color: var(--border); }
.totals { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-mono); font-size: 12px; }
.err { color: #c02626; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; }
.attest { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 14px 0; }
.discount-row { display: flex; gap: 8px; margin: 12px 0; }
.discount-row input { flex: 1; }
