/* ==========================================================================
   Redesign pass — dark, high-tech, electric-blue performance aesthetic.
   Loaded after site.css and pharmacy.css: retunes the shared design tokens
   toward a bold black-and-electric-blue look (dark by default), with glowing
   borders, bordered pill chips, a faint circuit/grid backdrop and bold
   uppercase display type. Every component still reads the same CSS
   variables, so this cascades everywhere, light mode included.
   ========================================================================== */

:root {
  --blue: #1958E8;
  --blue-light: #4FB3FF;
  --cobalt: #0B2E86;
  --glow: #4FB3FF;
  --pop: var(--glow);
  --pop-ink: var(--blue);

  --chrome: var(--line-strong);
  --chrome-soft: var(--line);
  --blue-grad: linear-gradient(120deg, var(--blue) 0%, var(--cobalt) 100%);
  --stat-fill: var(--blue);
  --headline-hl: var(--blue);

  --radius-card: 18px;
  --radius-btn: 999px;
  --shadow-glow: 0 0 0 1px rgba(79, 179, 255, .3), 0 0 28px -4px rgba(79, 179, 255, .45);

  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-wide: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --font-stat: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --mesh-opacity: 0;
}

/* ── Faint grain texture over the whole page — tactile, premium feel ── */
body { position: relative; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: .03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Dark-mode circuit grid + blue glow ambience ──────────────────────── */
[data-bs-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(79, 179, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 179, 255, .06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000, transparent 75%);
}

/* ── Typography: bold uppercase display, electric-blue glow on accents ── */
h1, h2, h3, .display-hero, .section-title {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.04;
}

h4, h5, h6 {
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.display-hero {
  letter-spacing: -.02em;
  font-weight: 700;
}

.display-hero .is-blue,
.product-summary strong {
  position: relative;
  color: var(--accent);
}

[data-bs-theme="dark"] .display-hero .is-blue {
  text-shadow: 0 0 28px rgba(79, 179, 255, .55);
}

/* ── Eyebrows: mono precision label with a blue tick ──────────────────── */
.eyebrow,
.section-eyebrow {
  font-family: var(--font-wide);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--pop-ink);
}

[data-bs-theme="dark"] .eyebrow,
[data-bs-theme="dark"] .section-eyebrow { color: var(--pop); }

.eyebrow::before,
.section-eyebrow::before {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--pop);
  transform: none;
  box-shadow: 0 0 10px rgba(79, 179, 255, .7);
}

/* ── Retire chrome hairline mask (now a flat 1px blue-tinted line) ────── */
.chrome-ring::before,
.btn-ghost::before,
.btn-outline-accent::before,
.theme-toggle::before {
  background: var(--line-strong);
}

.chrome-rule { background: var(--line-strong); opacity: 1; }

/* ── Motifs retired: diagonal slashes, hex mesh, skew flashes ─────────── */
.slashes,
.section-lab::before,
.section-stage.has-mesh::before,
.category-tile::after {
  display: none;
}

/* ── Section stage: deep blue glow blobs instead of flat grey ─────────── */
.section-stage {
  background:
    radial-gradient(ellipse 55% 50% at 12% 0%, rgba(79, 179, 255, .09), transparent 60%),
    radial-gradient(ellipse 50% 60% at 92% 15%, rgba(25, 88, 232, .12), transparent 65%),
    var(--stage-base);
}

[data-bs-theme="dark"] .section-stage {
  background:
    radial-gradient(ellipse 60% 55% at 15% -5%, rgba(79, 179, 255, .18), transparent 60%),
    radial-gradient(ellipse 55% 65% at 95% 10%, rgba(25, 88, 232, .22), transparent 65%),
    var(--stage-base);
}

/* ── Buttons: bold glowing pill, arrow on primary CTAs ─────────────────── */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
}

.btn-lg { padding: .95rem 2rem; }

.btn-accent,
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-glow);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn-accent:hover,
.btn-accent:focus-visible,
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--blue-light);
  border-color: var(--blue-light);
  box-shadow: 0 0 0 1px rgba(79, 179, 255, .5), 0 0 40px -2px rgba(79, 179, 255, .65);
  transform: translateY(-2px);
  color: #fff;
}

.btn-accent:active,
.btn-primary:active { background: var(--cobalt) !important; border-color: var(--cobalt) !important; }

.btn-lg.btn-accent::after,
.btn-lg.btn-primary::after {
  content: "\2192";
  margin-left: .6rem;
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}

.btn-lg.btn-accent:hover::after,
.btn-lg.btn-primary:hover::after { transform: translateX(3px); }

.btn-ghost,
.btn-outline-accent {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn);
}

.btn-ghost:hover,
.btn-outline-accent:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 179, 255, .5);
}

/* ── Pills / trust chips: bordered glow chip, mono label ──────────────── */
.pill {
  font-family: var(--font-wide);
  font-weight: 500;
  letter-spacing: .08em;
}

.pill-primary {
  box-shadow: 0 0 16px -2px rgba(79, 179, 255, .5);
}

.pill-chrome {
  background: rgba(79, 179, 255, .06);
  color: var(--pop-ink);
  border: 1px solid rgba(79, 179, 255, .35);
  box-shadow: none;
}

[data-bs-theme="dark"] .pill-chrome { color: var(--pop); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.hero-meta .pill {
  background: rgba(79, 179, 255, .06);
  border: 1px solid rgba(79, 179, 255, .3);
  color: var(--text);
}

.hero-meta .pill.pill-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Hex badge → circle with blue glow ring, no hexagon outline ───────── */
.hex-badge-shape {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(79, 179, 255, .08);
  border: 1px solid rgba(79, 179, 255, .4);
  color: var(--pop-ink);
  box-shadow: 0 0 18px -4px rgba(79, 179, 255, .4);
}

[data-bs-theme="dark"] .hex-badge-shape { color: var(--pop); }

.hex-badge-shape svg.hex-outline { display: none; }

.hex-badge-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 1rem;
}

/* ── Nav: dark bar, thin blue glow underline ───────────────────────────── */
.site-navbar::after {
  background: linear-gradient(90deg, transparent, rgba(79, 179, 255, .6), transparent);
  opacity: .7;
}

.site-navbar .nav-link {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}

.site-navbar .nav-link.active::after,
.site-navbar .nav-link:hover::after {
  background: var(--pop);
  box-shadow: 0 0 10px rgba(79, 179, 255, .8);
}

/* ── Stats band: bold display numerals, blue glow icon chips ──────────── */
.stats-panel { box-shadow: var(--card-shadow); border-color: rgba(79, 179, 255, .18); }
.stats-panel::before { background: linear-gradient(90deg, transparent, var(--blue-light), transparent); box-shadow: 0 0 14px rgba(79, 179, 255, .6); }
.stats-icon {
  box-shadow: 0 0 16px -4px rgba(79, 179, 255, .5);
  background: rgba(79, 179, 255, .1);
  color: var(--pop-ink);
  border-color: rgba(79, 179, 255, .3);
}
[data-bs-theme="dark"] .stats-icon { color: var(--pop); }
.stats-item:hover .stats-icon { transform: translateY(-2px); box-shadow: 0 0 22px -2px rgba(79, 179, 255, .7); }

.stats-value {
  font-weight: 700;
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--text);
}

.stats-label {
  font-family: var(--font-wide);
  font-weight: 500;
  letter-spacing: .1em;
}

/* ── Category tiles: bold display title, blue glow hover border ───────── */
.category-tile {
  border-radius: var(--radius-card);
}

.category-tile h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
}

.category-tile-index,
.category-tile-cta,
.stats-label {
  font-family: var(--font-wide);
}

.category-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(79, 179, 255, .35), 0 24px 50px -24px rgba(79, 179, 255, .5);
  border-color: rgba(79, 179, 255, .4);
}

.category-tile-icon { color: var(--pop-ink); }
[data-bs-theme="dark"] .category-tile-icon { color: var(--pop); }

/* ── Icon rows ─────────────────────────────────────────────────────────── */
.icon-row-item h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0;
}

.icon-row-item .line-icon { color: var(--pop-ink); }
[data-bs-theme="dark"] .icon-row-item .line-icon { color: var(--pop); }

/* ── Product stage / cards: glow border, lift on hover ─────────────────── */
.product-card {
  border-radius: var(--radius-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

[data-bs-theme="dark"] .product-card { border-color: rgba(79, 179, 255, .14); }

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(79, 179, 255, .3), 0 28px 56px -28px rgba(79, 179, 255, .5);
}

.product-stage,
.product-image-wrap { border-radius: var(--radius-card); }

[data-bs-theme="dark"] .product-stage { box-shadow: 0 0 0 1px rgba(79, 179, 255, .18), var(--card-shadow); }

.product-detail-main-img,
.product-image-wrap img {
  filter: drop-shadow(0 18px 30px rgba(14, 16, 20, .16));
}

[data-bs-theme="dark"] .product-detail-main-img,
[data-bs-theme="dark"] .product-image-wrap img {
  filter: drop-shadow(0 0 36px rgba(79, 179, 255, .18)) drop-shadow(0 18px 30px rgba(0, 0, 0, .5));
}

.product-stage::after,
.product-image-wrap::after {
  opacity: .5;
}

/* ── Product title: display font, bold, uppercase ──────────────────────── */
.product-title,
.product-card-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0;
}

/* ── Nutrition stat tiles (Product Detail) — built from the facts table ── */
.detail-stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin: 1.25rem 0;
}

.detail-stat-tile {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 1rem .5rem;
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(79, 179, 255, .16), rgba(79, 179, 255, .02) 65%);
  border: 1px solid rgba(79, 179, 255, .45);
  box-shadow:
    0 0 0 1px rgba(79, 179, 255, .12),
    0 14px 32px -16px rgba(79, 179, 255, .55),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.detail-stat-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, .14) 0%, transparent 35%);
  pointer-events: none;
}

.detail-stat-tile-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.detail-stat-tile-label {
  font-family: var(--font-wide);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── Footer giant wordmark: calmer, with a hint of glow ────────────────── */
.footer-giant { opacity: .7; }
[data-bs-theme="dark"] .footer-giant { text-shadow: 0 0 60px rgba(79, 179, 255, .15); }

/* ── Theme toggle & search: blue focus ring ────────────────────────────── */
.theme-toggle:hover { border-color: var(--pop); }

/* ── Admin sign-in card: glossy glow to match the brand system ────────── */
.auth-card {
  box-shadow:
    0 0 0 1px rgba(79, 179, 255, .18),
    0 40px 80px -30px rgba(0, 0, 0, .8),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 179, 255, .1) 0%, transparent 40%);
  pointer-events: none;
}

.auth-input-group .form-control {
  border-color: var(--line-strong);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.auth-input-group .form-control:focus {
  border-color: rgba(79, 179, 255, .6);
  box-shadow: 0 0 0 3px rgba(79, 179, 255, .18);
}

/* ── Accordion chevrons: glossy blue instead of Bootstrap's default ───── */
.product-accordion {
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%234FB3FF'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231958E8'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.product-accordion .accordion-button::after {
  filter: drop-shadow(0 0 4px rgba(79, 179, 255, .65));
}
