/*
Theme Name: Barrier Labs
Theme URI: https://barrierlabs.example/
Author: Barrier Labs
Author URI: https://barrierlabs.example/
Description: Clinical research-lab e-commerce theme for precision research peptides. Converted from a static HTML build into a WordPress theme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: barrier-labs
Tags: e-commerce, one-column, custom-menu, sticky-header, translation-ready
*/

/* ============================================================= */
/* BARRIER LABS — clinical research-lab e-commerce theme          */
/* Framework-agnostic. All tokens live in :root for easy porting. */
/* ============================================================= */

:root {
  /* palette — off-white bg, near-black ink, one clinical-blue accent */
  --bg: #f6f7f7;
  --surface: #ffffff;
  --ink: #0b0d0f;
  --ink-soft: #3a3f45;
  --muted: #7b828a;
  --line: #e7e9ea;
  --line-strong: #d7dade;
  --accent: #1a44ff;      /* clinical electric blue — used sparingly */
  --accent-ink: #ffffff;
  --low: #b3401f;         /* low-stock warning (neutral warm) */

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(11,13,15,.05);
  --shadow-md: 0 8px 30px rgba(11,13,15,.07);

  --wrap: 1200px;
  --gap: 24px;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --header-h: 66px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 120px; background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.eyebrow.light { color: rgba(255,255,255,.72); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .92rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #123ae0; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }

.section { max-width: var(--wrap); margin: 0 auto; padding: 72px 24px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 34px;
}
.section-head.center { justify-content: center; text-align: center; }
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); text-transform: lowercase; }
.section-lead { color: var(--ink-soft); max-width: 52ch; margin: 12px auto 0; }
.section-head .eyebrow { margin-bottom: 8px; }

/* ============================================================= */
/* PROMO TICKER                                                  */
/* ============================================================= */
.promo-bar {
  background: var(--ink);
  color: #fff;
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  position: relative;
}
.promo-track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  will-change: transform;
  animation: ticker 32s linear infinite;
  padding-left: 56px;
}
.promo-bar:hover .promo-track { animation-play-state: paused; }
.promo-item {
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.9);
}
.promo-item b { color: var(--accent-ink); font-weight: 600; }
.promo-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .promo-track { animation: none; } }

/* ============================================================= */
/* HEADER / NAV                                                  */
/* ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(246,247,247,.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}
.nav {
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -.02em;
  text-transform: lowercase;
}
.brand-accent { color: var(--accent); }

.nav-links { display: flex; gap: 26px; margin-left: 14px; }
.nav-links a {
  font-family: var(--font-head);
  font-size: .92rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color .15s ease;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--accent); transition: width .2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
  color: var(--ink); transition: background .15s ease, border-color .15s ease;
  position: relative;
}
.icon-btn:hover { background: #eef0f1; }
.icon-btn.round { border-radius: var(--radius-pill); border-color: var(--line-strong); }
.icon-btn.round:hover { border-color: var(--ink); background: transparent; }
.cart-count {
  position: absolute; top: 4px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; font-family: var(--font-head);
  font-size: .62rem; font-weight: 600; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.nav-toggle { display: none; width: 40px; height: 40px; background: transparent; border: none; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================= */
/* HERO                                                          */
/* ============================================================= */
.hero { max-width: var(--wrap); margin: 0 auto; padding: 56px 24px 24px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-transform: lowercase;
  text-wrap: balance;
  margin-bottom: 20px;
}
.hero-sub { font-size: 1.06rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

.trust-row {
  display: grid; grid-template-columns: repeat(4, auto); gap: 28px;
  padding-top: 26px; border-top: 1px solid var(--line);
  justify-content: start;
}
.trust-row li { display: flex; flex-direction: column; gap: 2px; }
.trust-num { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; text-transform: lowercase; }
.trust-label { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.hero-media { position: relative; }
.hero-media img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-md);
}
.hero-tag {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line);
  font-family: var(--font-head); font-size: .74rem; font-weight: 500;
  padding: 7px 12px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 8px; text-transform: lowercase;
}
.hero-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ============================================================= */
/* CAROUSEL / PRODUCT CARDS                                      */
/* ============================================================= */
.carousel-controls { display: flex; gap: 8px; }
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 1fr);
  gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 18px; margin: 0 -4px;
  scrollbar-width: thin;
}
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.product-card {
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.product-media { position: relative; aspect-ratio: 4/3; background: #fbfbfc; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .product-media img { transform: scale(1.04); }

.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--font-head); font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 9px; border-radius: var(--radius-pill);
}
.badge-accent { background: var(--accent); color: #fff; }
.badge-solid { background: var(--ink); color: #fff; }
.badge-low { background: #fff; color: var(--low); border: 1px solid var(--low); }

.product-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-name { font-size: 1.08rem; text-transform: lowercase; }
.product-desc { font-size: .84rem; color: var(--muted); margin-bottom: 12px; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; }
.btn-add {
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong);
  padding: 9px 14px; font-size: .82rem; border-radius: var(--radius-sm);
}
.btn-add:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-add.added { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================= */
/* CATEGORY GRID                                                 */
/* ============================================================= */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-tile {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 260px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.cat-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: #eef1ff; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.cat-tile img {
  width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-sm);
  margin: auto 0 14px; background: #fbfbfc;
}
.cat-name { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; text-transform: lowercase; }
.cat-count { font-size: .78rem; color: var(--muted); }

/* ============================================================= */
/* STAT BAR                                                      */
/* ============================================================= */
.stat-bar {
  background: var(--ink); color: #fff;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 40px 24px; text-align: center;
  border-right: 1px solid rgba(255,255,255,.1);
}
.stat:last-child { border-right: none; }
.stat-num { display: block; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.stat-label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }

/* ============================================================= */
/* QUALITY TABS                                                  */
/* ============================================================= */
.tabs { max-width: 860px; margin: 0 auto; }
.tab-list {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill); margin-bottom: 28px;
}
.tab {
  border: none; background: transparent; color: var(--ink-soft);
  font-family: var(--font-head); font-weight: 500; font-size: .9rem;
  text-transform: lowercase; padding: 10px 20px; border-radius: var(--radius-pill);
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }

.tab-panel {
  text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 44px 32px;
}
.tab-panel[hidden] { display: none; }
.panel-metric {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  color: var(--accent); background: #eef1ff; padding: 6px 14px;
  border-radius: var(--radius-pill); font-size: .82rem; margin-bottom: 16px;
}
.panel-title { font-size: clamp(1.4rem, 3vw, 1.9rem); text-transform: lowercase; margin-bottom: 12px; }
.panel-why { color: var(--ink-soft); max-width: 56ch; margin: 0 auto; }
.panel-why b { color: var(--ink); }

/* ============================================================= */
/* BANNER                                                        */
/* ============================================================= */
.banner { position: relative; min-height: 460px; display: flex; overflow: hidden; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-overlay {
  position: relative; width: 100%;
  background: linear-gradient(90deg, rgba(11,13,15,.82) 0%, rgba(11,13,15,.55) 45%, rgba(11,13,15,.1) 100%);
  display: flex; align-items: center;
}
.banner-inner { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 60px 24px; color: #fff; }
.banner-title { font-size: clamp(2rem, 4.4vw, 3rem); text-transform: lowercase; max-width: 16ch; margin-bottom: 24px; text-wrap: balance; }
.banner-stat { display: flex; flex-direction: column; margin-bottom: 26px; }
.banner-num { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); letter-spacing: -.03em; }
.banner-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* ============================================================= */
/* FOOTER                                                        */
/* ============================================================= */
.footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-grid {
  max-width: var(--wrap); margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-blurb { color: var(--ink-soft); font-size: .92rem; max-width: 40ch; margin: 0 0 20px; }
.pay-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-chip {
  font-family: var(--font-head); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--line-strong); color: var(--ink-soft);
  padding: 5px 10px; border-radius: var(--radius-sm);
}
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col h4 {
  font-family: var(--font-body); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.footer-col a { font-size: .9rem; color: var(--ink-soft); text-transform: lowercase; transition: color .15s ease; }
.footer-col a:hover { color: var(--accent); }

.disclaimer { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.disclaimer p {
  border: 1px solid var(--line); background: var(--bg);
  border-radius: var(--radius-sm); padding: 16px 18px;
  font-size: .78rem; color: var(--muted); line-height: 1.6;
}
.disclaimer b { color: var(--ink-soft); }

.footer-legal {
  max-width: var(--wrap); margin: 0 auto; padding: 24px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted); text-transform: lowercase; letter-spacing: .04em;
}

/* ============================================================= */
/* TOAST                                                         */
/* ============================================================= */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-family: var(--font-head); font-size: .88rem;
  padding: 12px 20px; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 100;
  text-transform: lowercase;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================= */
/* RESPONSIVE                                                    */
/* ============================================================= */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-media { order: -1; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface);
    border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
    margin-left: 0; display: none; box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid rgba(255,255,255,.1); }
  .section { padding: 56px 20px; }
  .trust-row { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; }
}
