/* ═══════════════════════════════════════════════════════════
   DreamBMW — Global CSS
   Baseline: Chassis Library page (contact.php) styling standard
   DO NOT override nav/footer dimensions in per-page CSS
   ═══════════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  /* BMW M Colors (locked — do not change) */
  --m-blue: #0066B1;
  --m-purple: #6B1F7C;
  --m-red: #E31837;
  --glow-blue: rgba(0,102,177,0.4);
  --glow-purple: rgba(107,31,124,0.4);

  /* Typography */
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Bebas Neue', sans-serif;

  /* Locked Nav Dimensions */
  --stripe-height: 6px;
  --nav-top: 6px;
  --nav-pad-y: 18px;
  --nav-pad-x: 50px;
  --nav-pad-y-scrolled: 14px;
  --logo-height: 28px;
  --nav-font-size: .65rem;
  --nav-letter-spacing: 2px;
  --nav-gap: 32px;
}

/* ── THEME: DARK ── */
[data-theme="dark"] {
  --bg-primary: #000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111;
  --bg-input: #000;
  --border-color: #1a1a1a;
  --border-hover: #333;
  --text-primary: #fff;
  --text-secondary: #999;
  --text-muted: #555;
  --btn-bg: #fff;
  --btn-text: #000;
}

/* ── THEME: LIGHT ── */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f2f2f3;
  --bg-card: #fff;
  --bg-input: #fff;
  --border-color: #e0e0e0;
  --border-hover: #c8c8c8;
  --text-primary: #2a2a2a;
  --text-secondary: #5a5a5a;
  --text-muted: #8a8a8a;
  --btn-bg: #2a2a2a;
  --btn-text: #fff;
}

/* ── BASE RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .4s, color .4s;
  overflow-x: hidden;
}

/* ── SCROLLBAR (dark themed) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-hover); }
::-webkit-scrollbar-thumb:hover { background: var(--m-blue); }

/* ═══════════════════════════════════════
   M-STRIPE — LOCKED
   ═══════════════════════════════════════ */
.m-stripe {
  height: var(--stripe-height);
  background: linear-gradient(90deg, var(--m-blue) 33.33%, var(--m-purple) 33.33% 66.66%, var(--m-red) 66.66%);
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1001; overflow: hidden;
}
.m-stripe::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), rgba(255,255,255,.25), rgba(255,255,255,.15), transparent);
  animation: barShimmer 6s linear infinite;
}
@keyframes barShimmer { 0% { left: -40% } 100% { left: 100% } }

/* ═══════════════════════════════════════
   NAVIGATION — LOCKED DIMENSIONS
   These values MUST NOT be overridden by
   per-page CSS. This ensures pixel-identical
   header positioning on every page.
   ═══════════════════════════════════════ */
.nav {
  position: fixed;
  top: var(--nav-top);
  left: 0; right: 0;
  z-index: 1000;
  padding: var(--nav-pad-y) var(--nav-pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transition: all .4s;
}
.nav.scrolled {
  padding: var(--nav-pad-y-scrolled) var(--nav-pad-x);
}

/* Logo — locked height */
.logo { display: flex; align-items: center; text-decoration: none; }
.logo-svg { height: var(--logo-height); width: auto; }
.logo-dark { display: block; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }

/* Nav Center — locked centering */
.nav-center {
  display: flex;
  gap: var(--nav-gap);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

/* Nav Links — locked typography */
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--nav-font-size);
  font-weight: 500;
  letter-spacing: var(--nav-letter-spacing);
  text-transform: uppercase;
  transition: all .3s;
  position: relative;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--text-primary); }
.nav-link::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--m-blue), var(--m-purple), var(--m-red));
  transition: width .3s;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ── Tools Dropdown ── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  color: var(--text-secondary);
  font-size: var(--nav-font-size);
  font-weight: 500;
  letter-spacing: var(--nav-letter-spacing);
  text-transform: uppercase;
  cursor: pointer; background: none; border: none;
  font-family: var(--font-body);
  display: flex; align-items: center; gap: 5px;
  transition: all .3s; padding: 0; position: relative;
}
.nav-dropdown-trigger:hover { color: var(--text-primary); }
.nav-dropdown-trigger.active { color: var(--text-primary); }
.nav-dropdown-trigger svg { width: 8px; height: 8px; transition: transform .3s; fill: currentColor; }
.nav-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-trigger::after {
  content: ''; position: absolute; bottom: -6px; left: 0; width: 0;
  height: 2px; background: linear-gradient(90deg, var(--m-blue), var(--m-purple), var(--m-red));
  transition: width .3s;
}
.nav-dropdown-trigger.active::after,
.nav-dropdown:hover .nav-dropdown-trigger::after { width: 100%; }

/* Dropdown Menu */
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 300px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  opacity: 0; visibility: hidden;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  pointer-events: none; z-index: 100;
  overflow: hidden; padding-top: 15px;
}
.nav-dropdown::after {
  content: ''; position: absolute; top: 100%;
  left: 0; right: 0; height: 20px;
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--m-blue), var(--m-purple), var(--m-red));
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Dropdown Items — FIXED HOVER CONTRAST */
.nav-dropdown-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; text-decoration: none;
  color: var(--text-secondary);
  transition: all .25s;
  border-bottom: 1px solid var(--border-color);
  position: relative; overflow: hidden;
}
.nav-dropdown-item:last-child { border-bottom: none; }
.nav-dropdown-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(0,102,177,.12), rgba(107,31,124,.08), transparent);
  transition: width .3s;
}
.nav-dropdown-item:hover::before { width: 100%; }
.nav-dropdown-item:hover { color: var(--text-primary); }
.nav-dropdown-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .6; transition: opacity .3s; }
.nav-dropdown-item:hover svg { opacity: 1; }
.nav-dropdown-label { display: flex; flex-direction: column; }
.nav-dropdown-label span:first-child {
  font-size: var(--nav-font-size); font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.nav-dropdown-label span:last-child {
  font-size: .6rem; color: var(--text-muted); margin-top: 2px;
}

/* ── Nav Right ── */
.nav-right { display: flex; align-items: center; gap: 20px; }
.admin-login-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--text-muted); transition: all .3s; text-decoration: none;
}
.admin-login-icon:hover { border-color: var(--text-secondary); color: var(--text-primary); }

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1rem; transition: all .3s;
}
.theme-toggle:hover { border-color: var(--text-primary); color: var(--text-primary); transform: rotate(15deg); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* CTA Button */
.nav-cta {
  background: linear-gradient(90deg, var(--m-blue), var(--m-purple));
  border: none; padding: 12px 24px; color: #fff;
  font-family: var(--font-body);
  font-size: var(--nav-font-size); font-weight: 600;
  letter-spacing: var(--nav-letter-spacing);
  text-transform: uppercase; text-decoration: none;
  cursor: pointer; transition: all .3s;
  position: relative; overflow: hidden;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px var(--glow-purple); }

/* ── Mobile Nav ── */
.mobile-menu-btn {
  display: none; background: none; border: none;
  cursor: pointer; padding: 10px; z-index: 1001;
}
.mobile-menu-btn span {
  display: block; width: 25px; height: 2px;
  background: var(--text-primary); margin: 5px 0; transition: all .3s;
}
.mobile-menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); padding: 80px 30px 30px;
  flex-direction: column; gap: 8px; z-index: 998; overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--text-primary); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 16px 0; border-bottom: 1px solid var(--border-color);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav-label {
  font-size: .55rem; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-muted); padding: 20px 0 5px;
}
.mobile-nav-label:first-child { padding-top: 0; }

/* ═══════════════════════════════════════
   FOOTER — LOCKED
   ═══════════════════════════════════════ */
.m-divider {
  height: 6px;
  background: linear-gradient(90deg, var(--m-blue) 33.33%, var(--m-purple) 33.33% 66.66%, var(--m-red) 66.66%);
  position: relative; overflow: hidden;
}
.m-divider::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), rgba(255,255,255,.25), rgba(255,255,255,.15), transparent);
  animation: barShimmer 6s linear infinite;
}
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 80px 50px 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 60px; max-width: 1400px; margin: 0 auto 60px;
}
.footer-brand p {
  font-size: .85rem; color: var(--text-secondary);
  line-height: 1.8; margin-top: 20px; max-width: 300px;
}
.footer-col h4 {
  font-size: .65rem; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 25px;
}
.footer-col a {
  display: block; font-size: .85rem;
  color: var(--text-secondary); text-decoration: none;
  margin-bottom: 12px; transition: color .3s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex; flex-direction: column; gap: 20px;
  padding-top: 40px; border-top: 1px solid var(--border-color);
  max-width: 1400px; margin: 0 auto;
}
.footer-bottom p {
  font-size: .7rem; color: var(--text-muted); letter-spacing: 1px;
}
.footer-disclaimer {
  font-size: 7.5px !important;
  color: rgba(150,150,150,.55) !important;
  letter-spacing: .3px !important;
  line-height: 1.6; max-width: 900px; font-weight: 300;
}
.footer-social { display: flex; gap: 20px; }
.footer-social a {
  width: 40px; height: 40px;
  border: 1px solid var(--border-color); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: all .3s;
  color: var(--text-secondary);
}
.footer-social a:hover { border-color: var(--m-blue); color: var(--m-blue); }
.footer-social svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════
   SHARED UTILITIES
   ═══════════════════════════════════════ */

/* Fade-up animation */
.fade-up {
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .1s; }
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; }

/* Gradient text helper */
.gradient {
  background: linear-gradient(90deg, var(--m-blue), var(--m-purple), var(--m-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Page hero (interior pages) */
.page-hero {
  padding: 120px 50px 60px;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% -10%, rgba(0,102,177,.07) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,102,177,.025) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(0,102,177,.025) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none;
}

/* ═══════════════════════════════════════
   PAGE CONTENT — GLOBAL STANDARDS
   Typography matches homepage (Inter 300-400)
   All non-homepage pages: LEFT justified
   ═══════════════════════════════════════ */

/* Standard page hero (non-homepage) */
.page-hero {
  padding: 140px 50px 60px;
  background: var(--bg-secondary);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: 4px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 15px;
  text-align: left;
}
.page-hero h1 .gradient {
  background: linear-gradient(90deg, var(--m-blue), var(--m-purple), var(--m-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.8;
  max-width: 600px;
  text-align: left;
}

/* Section typography — left justified, thin weights */
.section h2, .section-content h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 3px;
  font-weight: 400;
  text-align: left;
}
.section p, .section-content p {
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  font-weight: 300;
  text-align: left;
}
.section-eyebrow {
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}

/* Labels & small text — consistent across all pages */
label, .form-label {
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Card typography */
.card h3, .info-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════
   RESPONSIVE — NAV BREAKPOINTS
   ═══════════════════════════════════════ */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .nav { padding: 15px 25px; }
  .nav-center { display: none; }
  .mobile-menu-btn { display: block; }
  .nav-cta { display: none; }
  .page-hero { padding: 100px 25px 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
