/* =============================================
   Supplement Radar — main.css
   Core design system, layout, header, footer
   ============================================= */

/* --- Custom Properties --- */
:root {
  --color-bg: #05050d;
  --color-bg-alt: #0a0a18;
  --color-surface: #0a0a18;
  --color-border: rgba(0, 255, 255, 0.12);
  --color-text: #f0f0ff;
  --color-text-muted: #7777aa;
  --color-accent: #00ffff;
  --color-accent-hover: #00cccc;
  --color-accent-light: rgba(0, 255, 255, 0.08);
  --color-magenta: #ff00cc;
  --color-magenta-hover: #cc009f;
  --color-magenta-light: rgba(255, 0, 204, 0.1);
  --color-danger: #ff3366;
  --color-warning: #ffcc00;
  --color-link: #00ffff;
  --glow-cyan: 0 0 8px #00ffff, 0 0 20px rgba(0,255,255,0.6), 0 0 40px rgba(0,255,255,0.25);
  --glow-magenta: 0 0 8px #ff00cc, 0 0 20px rgba(255,0,204,0.6), 0 0 40px rgba(255,0,204,0.25);
  --glow-cyan-text: 0 0 10px #00ffff, 0 0 20px rgba(0,255,255,0.9), 0 0 50px rgba(0,255,255,0.4);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
  --spacing-2xl: 64px;

  --header-height: 64px;
  --max-width: 1200px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  background-image:
    linear-gradient(rgba(0,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

main {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* --- Typography --- */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: var(--spacing-md); }
p:last-child { margin-bottom: 0; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 13, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.08);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--spacing-lg);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.site-logo img {
  width: 32px;
  height: 32px;
}

.site-logo .logo-name {
  letter-spacing: -0.02em;
}

.site-logo .logo-name span {
  color: var(--color-accent);
  text-shadow: var(--glow-cyan-text);
}

.site-logo:hover .logo-name {
  animation: glitch 0.4s steps(2) forwards;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s, text-shadow 0.15s;
  text-decoration: none;
  letter-spacing: 0.03em;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--color-accent);
  box-shadow: var(--glow-cyan);
  transition: left 0.2s, right 0.2s;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  left: 8px;
  right: 8px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
  text-shadow: 0 0 8px rgba(0,255,255,0.5);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  color: var(--color-text);
  font-size: 1.25rem;
}

@media (max-width: 767px) {
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    padding: var(--spacing-sm);
    gap: var(--spacing-xs);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .nav-toggle {
    display: block;
  }
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-sans);
}

.lang-btn.active,
.lang-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: var(--spacing-sm) 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.breadcrumbs li + li::before {
  content: '/';
  color: var(--color-border);
  margin-right: var(--spacing-xs);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-accent);
}

.breadcrumbs li:last-child {
  color: var(--color-text);
  font-weight: 500;
}

/* --- Hero --- */
.hero {
  background: var(--color-bg);
  padding: var(--spacing-2xl) 0;
  border-bottom: 1px solid rgba(0,255,255,0.15);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at -10% 60%, rgba(0,255,255,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 110% 40%, rgba(255,0,204,0.18) 0%, transparent 55%);
  pointer-events: none;
  animation: hero-glow-pulse 4s ease-in-out infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(0,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  max-width: 640px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: var(--spacing-md);
  color: var(--color-accent);
  text-shadow: var(--glow-cyan-text);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.hero .subheadline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
  letter-spacing: 0.02em;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-magenta);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--glow-cyan);
  animation: neon-pulse-cyan 2.5s ease-in-out infinite;
}

.btn-primary:hover {
  background: #00ffff;
  color: var(--color-magenta);
  box-shadow: var(--glow-cyan), 0 0 60px rgba(0,255,255,0.5);
  transform: translateY(-2px) scale(1.03);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--color-magenta);
  border-color: var(--color-magenta);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--glow-magenta);
  animation: neon-pulse-magenta 2.5s ease-in-out infinite;
  animation-delay: 1.25s;
}

.btn-outline:hover {
  background: var(--color-magenta);
  color: var(--color-accent);
  box-shadow: var(--glow-magenta), 0 0 60px rgba(255,0,204,0.5);
  transform: translateY(-2px) scale(1.03);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* --- Category Cards --- */
.categories-section {
  padding: var(--spacing-2xl) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-md);
}

.section-title {
  font-size: 1.5rem;
}

.section-link {
  font-size: 0.9rem;
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  text-shadow: 0 0 8px rgba(0,255,255,0.4);
  letter-spacing: 0.03em;
  transition: text-shadow 0.2s;
}

.section-link:hover {
  text-shadow: var(--glow-cyan-text);
  text-decoration: none;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--spacing-lg);
  background: var(--color-bg-alt);
  border: 1px solid rgba(0,255,255,0.15);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
  gap: var(--spacing-sm);
}

.category-card:nth-child(even) {
  border-color: rgba(255,0,204,0.15);
}

.category-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(0,255,255,0.04);
  transform: translateY(-4px);
  background: rgba(0,255,255,0.04);
  text-decoration: none;
}

.category-card:nth-child(even):hover {
  border-color: var(--color-magenta);
  box-shadow: var(--glow-magenta), inset 0 0 20px rgba(255,0,204,0.04);
  background: rgba(255,0,204,0.04);
}

.category-card .icon {
  font-size: 2.2rem;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .icon {
  transform: scale(1.35) rotate(-8deg);
}

.category-card h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.category-card p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* --- Featured Products --- */
.featured-section {
  padding: var(--spacing-2xl) 0;
  background: var(--color-bg-alt);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.featured-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.featured-card .product-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  align-self: center;
}

.featured-card .product-img-placeholder {
  width: 80px;
  height: 80px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.featured-card .brand {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.featured-card .name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.featured-card .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
}

.featured-card .price-per-kg {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.featured-card .cta {
  margin-top: auto;
}

/* --- Footer --- */
.site-footer {
  background: #04040a;
  color: #fff;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: var(--spacing-sm);
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--spacing-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0;
}

.footer-bottom .disclosure {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  max-width: 600px;
}

/* --- Page title bar --- */
.page-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  padding: var(--spacing-lg) 0;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--spacing-xs);
}

.page-header p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Utilities --- */
.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;
}

.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.font-bold { font-weight: 700; }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* Loading spinner */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --- Keyframe Animations --- */

@keyframes neon-pulse-cyan {
  0%, 100% { box-shadow: 0 0 8px #00ffff, 0 0 16px rgba(0,255,255,0.5); }
  50%       { box-shadow: 0 0 16px #00ffff, 0 0 40px rgba(0,255,255,0.8), 0 0 60px rgba(0,255,255,0.3); }
}

@keyframes neon-pulse-magenta {
  0%, 100% { box-shadow: 0 0 8px #ff00cc, 0 0 16px rgba(255,0,204,0.5); }
  50%       { box-shadow: 0 0 16px #ff00cc, 0 0 40px rgba(255,0,204,0.8), 0 0 60px rgba(255,0,204,0.3); }
}

@keyframes hero-glow-pulse {
  0%   { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes glitch {
  0%   { transform: translate(0); clip-path: inset(0 0 0 0); }
  20%  { transform: translate(-3px, 1px); clip-path: inset(20% 0 50% 0); color: #ff00cc; }
  40%  { transform: translate(3px, -1px); clip-path: inset(55% 0 20% 0); color: #00ffff; }
  60%  { transform: translate(-2px, 2px); clip-path: inset(80% 0 5% 0); color: #ff00cc; }
  80%  { transform: translate(2px, -2px); clip-path: inset(10% 0 80% 0); color: #00ffff; }
  100% { transform: translate(0); clip-path: inset(0 0 0 0); color: inherit; }
}

@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  92%       { opacity: 1; }
  93%       { opacity: 0.4; }
  94%       { opacity: 1; }
  96%       { opacity: 0.6; }
  97%       { opacity: 1; }
}

/* Apply flicker to the logo accent text */
.site-logo .logo-name span {
  animation: neon-flicker 6s infinite;
}

/* --- Easter Egg Trigger Button --- */
#gainz-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,255,0.2);
  background: rgba(5,5,13,0.85);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
  line-height: 1;
  opacity: 0.5;
}

#gainz-trigger:hover {
  opacity: 1;
  border-color: var(--color-accent);
  box-shadow: var(--glow-cyan);
  transform: scale(1.15) rotate(-10deg);
}

/* --- Easter Egg Styles --- */
#gainz-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 5, 13, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  backdrop-filter: blur(8px);
  animation: gainz-in 0.3s ease-out;
}

@keyframes gainz-in {
  from { opacity: 0; transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}

#gainz-overlay .gainz-title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  text-shadow: var(--glow-cyan-text);
  text-align: center;
}

#gainz-overlay .gainz-sub {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
}

#gainz-overlay .gainz-timer {
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-magenta);
  text-shadow: var(--glow-magenta);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: center;
}

#gainz-overlay .gainz-dumbbell {
  font-size: clamp(5rem, 15vw, 9rem);
  cursor: pointer;
  user-select: none;
  transition: transform 0.05s;
  filter: drop-shadow(0 0 20px rgba(0,255,255,0.4));
  display: inline-block;
  line-height: 1;
}

#gainz-overlay .gainz-dumbbell:active {
  transform: scale(0.88) rotate(-10deg);
}

#gainz-overlay .gainz-count {
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-accent);
  text-shadow: 0 0 10px rgba(0,255,255,0.6);
}

#gainz-overlay .gainz-result {
  font-size: 1.1rem;
  color: var(--color-text);
  text-align: center;
  max-width: 380px;
  line-height: 1.6;
}

#gainz-overlay .gainz-result strong {
  color: var(--color-magenta);
  text-shadow: var(--glow-magenta);
}

#gainz-overlay .gainz-btn {
  padding: 12px 32px;
  background: var(--color-accent);
  color: #05050d;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  font-family: var(--font-sans);
  transition: transform 0.1s, box-shadow 0.1s;
}

#gainz-overlay .gainz-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan), 0 0 50px rgba(0,255,255,0.4);
}

#gainz-overlay .gainz-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* Screen flash on activation */
@keyframes gainz-flash {
  0%   { opacity: 0; }
  10%  { opacity: 0.6; }
  100% { opacity: 0; }
}

.gainz-flash-el {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: linear-gradient(135deg, rgba(0,255,255,0.4), rgba(255,0,204,0.4));
  pointer-events: none;
  animation: gainz-flash 0.4s ease-out forwards;
}
