/* ============================================================
   main.css — Design Tokens, Reset, Typography
   LumiVeil B2B — Redesign V2
   ============================================================ */

/* === CSS Custom Properties (Design Tokens) === */
:root {
  /* Color Palette — Deeper black + Warm Gold accents */
  --color-gold-400: #E5A830;
  --color-gold-500: #D4942B;
  --color-gold-600: #C08026;
  --gold-gradient: linear-gradient(270deg, #E5A830 0%, #D4942B 55%, #C08026 100%);

  --color-bg-primary: #080808;
  --color-bg-secondary: #111111;
  --color-bg-tertiary: #151515;
  --color-bg-elevated: #1A1A1A;
  --color-bg-nav: rgba(8, 8, 8, 0.92);

  --color-text-primary: #F5F0E8;
  --color-text-secondary: rgba(245, 240, 232, 0.65);
  --color-text-muted: rgba(245, 240, 232, 0.40);

  --color-success: #2D8B4E;
  --color-error: #C0392B;
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-light: rgba(255, 255, 255, 0.10);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-h1: clamp(2.5rem, 5vw, 5rem);
  --text-h2: clamp(1.8rem, 3.5vw, 3.2rem);
  --text-h3: clamp(1.15rem, 1.8vw, 1.5rem);
  --text-h4: clamp(1.05rem, 1.5vw, 1.25rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.75rem;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-section: clamp(4rem, 8vw, 7.5rem);

  /* Layout */
  --max-width: 1280px;
  --max-width-narrow: 720px;
  --max-width-wide: 1440px;
  --header-h: 80px;
  --header-h-scrolled: 64px;

  /* Borders & Radii */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 24px rgba(229, 168, 48, 0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);

  /* z-index Layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-header: 1000;
  --z-search: 2000;
  --z-sidemenu: 1150;
}

/* === Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

svg { display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-h1); letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p + p { margin-top: var(--space-sm); }

::selection {
  background-color: var(--color-gold-400);
  color: var(--color-bg-primary);
}

:focus-visible {
  outline: 2px solid var(--color-gold-400);
  outline-offset: 2px;
}

/* === Utility Classes === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container--narrow { max-width: var(--max-width-narrow); }

.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--lg { padding-block: var(--space-section); }
.section--sm { padding-block: var(--space-xl); }
.section--alt { background-color: var(--color-bg-secondary); }

.page-top { padding-top: calc(var(--header-h) + var(--space-sm)); }

.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-gold { color: var(--color-gold-400); }
.text-muted { color: var(--color-text-secondary); }
.text-center { text-align: center; }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* === Section Headers === */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 { margin-bottom: 0.8rem; }

.section-header p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 540px;
  margin-inline: auto;
  line-height: 1.6;
}

.section-header--left { text-align: left; margin-bottom: 2.5rem; }

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-400);
  margin-bottom: 0.6rem;
  padding: 5px 20px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* === Grid System === */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === Page Header (inner pages) === */
.page-hero {
  position: relative;
  padding-block: calc(var(--header-h) + var(--space-xl)) var(--space-xl);
  background-color: var(--color-bg-secondary);
  text-align: center;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(229, 168, 48, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.page-hero h1 { margin-bottom: var(--space-sm); }

.page-hero p {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-inline: auto;
}

/* === Ambient hero variants (non-product pages) — editorial, distinct from category heroes === */
.page-hero--ambient {
  position: relative;
  overflow: hidden;
}
.page-hero--ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--ambient-tint, rgba(229, 168, 48, 0.10)) 0%, transparent 55%),
    radial-gradient(70% 55% at 88% 4%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.page-hero--ambient .container {
  position: relative;
  z-index: 1;
}
.page-hero--products { --ambient-tint: rgba(229, 168, 48, 0.13); }
.page-hero--solutions { --ambient-tint: rgba(130, 155, 195, 0.16); }
.page-hero--resources { --ambient-tint: rgba(185, 155, 120, 0.14); }
.page-hero--about { --ambient-tint: rgba(198, 140, 80, 0.15); }
.page-hero--contact { --ambient-tint: rgba(226, 130, 70, 0.15); }

/* === Overview Hero — shared dramatic gold background (products/solutions/about/resources/contact) === */
.page-hero--overview {
  position: relative;
  overflow: hidden;
  padding-top: clamp(5rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
  min-height: 520px;
  display: flex;
  align-items: center;
  text-align: center;
}

.page-hero--overview::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(50% 80% at 50% 100%, rgba(229, 168, 48, 0.28) 0%, transparent 60%),
    radial-gradient(40% 60% at 30% 90%, rgba(219, 177, 113, 0.15) 0%, transparent 50%),
    radial-gradient(40% 60% at 70% 90%, rgba(219, 177, 113, 0.12) 0%, transparent 50%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(229, 168, 48, 0.05) 0deg 5deg, transparent 5deg 22deg);
  pointer-events: none;
  z-index: 0;
}

.page-hero--overview::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(50% 40% at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.page-hero--overview .container {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.page-hero--overview h1 {
  background: linear-gradient(180deg, #FFF 0%, #E8D5B4 45%, #CBA870 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.page-hero--overview p {
  color: var(--color-text-secondary);
  font-size: var(--text-body);
  max-width: 620px;
  margin: 0 auto;
  opacity: 0.8;
  line-height: 1.7;
}

@media (max-width: 1023px) {
  .page-hero--overview {
    min-height: 380px;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }
}

@media (max-width: 767px) {
  .page-hero--overview {
    min-height: 300px;
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }
}

/* === Breadcrumb === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-small);
  color: var(--color-text-muted);
  padding-block: var(--space-sm);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--color-gold-400); }
.breadcrumb .separator { user-select: none; }

/* === Error Pages === */
.error-page { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-page__code { font-size: 6rem; color: var(--color-gold-400); margin-bottom: 0; }

/* === Stats Bar (search page, about page) === */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); max-width: 900px; margin: 0 auto; }
.stat-block { text-align: center; padding: var(--space-md); }
.stat-block__number { font-size: 2rem; font-weight: 700; color: var(--color-gold-400); font-family: var(--font-heading); line-height: 1.1; }
.stat-block__label { font-size: 0.82rem; color: var(--color-text-secondary); margin-top: 0.3rem; }

/* === Product detail page-wide classes === */
.product-detail__breadcrumb { padding-top: calc(var(--header-h) + var(--space-sm)); }

/* === Responsive for new utilities === */
@media (max-width: 767px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); }
  .stat-block__number { font-size: 1.5rem; }
}
