/* ==========================================================================
   META PEPTIDES — Base styles
   Design tokens, reset, typography, header, drawer, bottom nav, footer.
   Change brand colours in :root below — every page reads these tokens.
   ========================================================================== */

/* ---------- Self-hosted fonts (SIL OFL, see assets/fonts/) ---------- */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-display: swap; src: url("../fonts/inter-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("../fonts/montserrat-latin-800-normal.woff2") format("woff2"); }

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --navy-950: #030b17;
  --navy-900: #07182c;
  --navy-850: #0a1f3a;
  --navy-800: #0d2747;
  --navy-700: #163a66;
  --blue-700: #0546b8;
  --blue-600: #0754d8;
  --blue-500: #1684f8;
  --cyan-400: #00b8ff;
  --green-600: #13a65c;
  --green-50: #e8f7ef;
  --purple-600: #7438c9;
  --purple-50: #f2ebfc;
  --blue-50: #e8f0fe;
  --amber-600: #e07b00;
  --amber-50: #fff6e8;
  --red-600: #d6334a;

  /* Neutrals */
  --white: #ffffff;
  --grey-50: #f5f7fa;
  --grey-100: #eef2f7;
  --border: #e5eaf1;
  --border-strong: #d3dbe6;
  --text: #0b1628;
  --text-muted: #5b6b82;
  --text-faint: #8a98ad;
  --on-dark: #ffffff;
  --on-dark-muted: #a9b6c9;
  --dark-border: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Montserrat", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Shape & depth */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(7, 24, 44, 0.06);
  --shadow-md: 0 6px 20px rgba(7, 24, 44, 0.08);
  --shadow-lg: 0 18px 50px rgba(3, 11, 23, 0.25);

  /* Layout */
  --container: 1240px;
  --gutter: 16px;
  --header-h: 60px;
  --bottom-nav-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}
body.theme-dark { background: var(--navy-950); color: var(--on-dark); }
body.is-locked { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; border-radius: 4px; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--blue-600); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- Typography ---------- */
.h-display, .h1, .h2, .h3, .page-title, .section-title {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.1;
}
.page-title { font-size: 20px; }
.section-title { font-size: 15px; }
.text-muted { color: var(--text-muted); }
.text-blue { color: var(--blue-600); }
.text-purple { color: var(--purple-600); }
.text-cyan { color: var(--cyan-400); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: 760px; }
.section { padding-block: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head .link-more { font-size: 12px; font-weight: 600; color: var(--blue-600); }
.theme-dark .section-head .link-more { color: var(--cyan-400); }
.stack > * + * { margin-top: 12px; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy-950);
  color: var(--on-dark);
  border-bottom: 1px solid var(--dark-border);
}
.theme-light .site-header { background: var(--white); color: var(--text); border-bottom-color: var(--border); }

.header-bar {
  height: var(--header-h);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}
.logo { display: inline-flex; align-items: center; justify-self: center; }
.logo img { height: 34px; width: auto; }
.logo .logo-dark { display: none; }
.theme-light .logo .logo-light { display: none; }
.theme-light .logo .logo-dark { display: block; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  color: inherit; position: relative;
}
.icon-btn:hover { background: rgba(127, 150, 180, 0.12); }

.header-search { display: none; position: relative; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.header-action {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; gap: 2px;
  font-size: 10px; font-weight: 500; color: inherit;
}
.header-action .label { display: none; }
.header-action.account-link { display: none; }
.cart-count {
  position: absolute; top: 4px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--blue-500); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.cart-count[data-count="0"] { display: none; }

.main-nav { display: none; }

/* search suggestions */
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 120;
}
.search-suggest a { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px; }
.search-suggest a:hover, .search-suggest a.is-active { background: var(--grey-50); }
.search-suggest img { width: 40px; height: 40px; object-fit: contain; }
.search-suggest .s-price { font-weight: 700; }
.search-suggest .s-empty, .search-suggest .s-all { padding: 10px 12px; font-size: 13px; color: var(--text-muted); display: block; }
.search-suggest .s-all { border-top: 1px solid var(--border); color: var(--blue-600); font-weight: 600; }

/* ==========================================================================
   DRAWER (mobile slide-out menu)
   ========================================================================== */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(3, 11, 23, 0.6);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.drawer-overlay.is-visible { opacity: 1; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 150;
  width: min(88vw, 360px);
  background: var(--navy-950);
  color: var(--on-dark);
  display: flex; flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.35s var(--ease), visibility 0s linear 0.35s;
  visibility: hidden;
  box-shadow: var(--shadow-lg);
}
.drawer.is-open { transform: none; visibility: visible; transition: transform 0.35s var(--ease); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 8px 0 18px; border-bottom: 1px solid var(--dark-border); flex: none; }
.drawer-head img { height: 32px; width: auto; }
.drawer-body { overflow-y: auto; overscroll-behavior: contain; padding: 14px 0 calc(var(--bottom-nav-h) + 24px + var(--safe-bottom)); flex: 1; }
.menu-page .drawer-body { padding-bottom: 24px; }
.drawer-title { padding: 14px 20px 6px; font-family: var(--font-head); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.drawer-group + .drawer-group { border-top: 1px solid var(--dark-border); margin-top: 8px; padding-top: 4px; }
.drawer-link, .drawer-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 8px 20px; min-height: 38px; font-size: 14px; font-weight: 500; color: #dfe7f2; text-align: left;
}
.drawer-link:hover, .drawer-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.drawer-link[aria-current="page"] { color: var(--cyan-400); }
.drawer-row { display: flex; align-items: center; }
.drawer-row .drawer-link { flex: 1; padding-right: 4px; }
.drawer-toggle { width: 48px; justify-content: center; padding: 8px 14px; color: var(--on-dark-muted); }
.drawer-toggle .icon { transition: transform 0.25s var(--ease); }
.drawer-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); color: var(--cyan-400); }
.drawer-sub { overflow: hidden; max-height: 0; transition: max-height 0.3s var(--ease); background: rgba(255, 255, 255, 0.03); }
.drawer-sub.is-open { max-height: 260px; }
.drawer-sub a { display: block; padding: 7px 20px 7px 36px; font-size: 13px; color: var(--on-dark-muted); }
.drawer-sub a:hover { color: #fff; }

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 160;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--navy-950);
  border-top: 1px solid var(--dark-border);
}
.theme-light .bottom-nav { background: var(--white); border-top-color: var(--border); }
body.drawer-open .bottom-nav { background: var(--navy-950); border-top-color: var(--dark-border); }
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; font-weight: 500; color: var(--on-dark-muted);
}
.theme-light .bottom-nav a, .theme-light .bottom-nav button { color: #5d6b80; }
body.drawer-open .bottom-nav a, body.drawer-open .bottom-nav button { color: var(--on-dark-muted); }
.bottom-nav .icon { width: 22px; height: 22px; }
.bottom-nav .is-active, .theme-light .bottom-nav .is-active { color: var(--blue-500); }
.bottom-nav .is-active .icon { stroke-width: 2.2; }
body.drawer-open .bottom-nav [data-drawer-open] { color: var(--cyan-400); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-features { background: var(--white); border-top: 1px solid var(--border); color: var(--text); }
.footer-features ul { display: grid; grid-template-columns: 1fr; gap: 18px; padding-block: 26px; }
.footer-features li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.footer-features .ff-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.footer-features strong { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.footer-features span { font-size: 12.5px; color: var(--text-muted); }

.site-footer { background: var(--navy-950); color: var(--on-dark-muted); font-size: 13px; }
.footer-main { display: grid; grid-template-columns: 1fr; gap: 6px; padding-block: 30px 18px; }
.footer-brand img { height: 40px; width: auto; margin-bottom: 12px; }
.footer-brand p { max-width: 300px; line-height: 1.6; margin-bottom: 18px; }
.footer-col { border-top: 1px solid var(--dark-border); }
.footer-col h2 { margin: 0; }
.footer-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; font-family: var(--font-head); font-size: 12px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
}
.footer-toggle .icon { transition: transform 0.25s var(--ease); }
.footer-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.footer-col ul { display: none; padding-bottom: 14px; }
.footer-col.is-open ul { display: block; }
.footer-col li a { display: inline-block; padding: 5px 0; }
.footer-col li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--dark-border); }
.footer-bottom .container { display: flex; flex-direction: column; gap: 10px; padding-block: 16px; font-size: 12px; }
.payment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-list li { padding: 3px 9px; border: 1px solid var(--dark-border); border-radius: var(--radius-xs); font-size: 11px; font-weight: 700; color: #dfe7f2; letter-spacing: 0.02em; }

/* scroll to top */
.to-top {
  position: fixed; right: 14px; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px); z-index: 90;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-600); color: #fff; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
