@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Oswald:wght@400;500;600;700&display=swap');

:root {
  --color-dark: #0a0a0a;
  --color-dark-surface: #141414;
  --color-dark-card: #1a1a1a;
  --color-accent: #f97316;
  --color-accent-hover: #ea580c;
  --color-light: #ffffff;
  --color-muted: #a3a3a3;
  --color-border: #2a2a2a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-dark);
  color: var(--color-light);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-scrolled {
  background-color: rgba(10, 10, 10, 0.95) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.6) 50%, rgba(10,10,10,0.8) 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(249,115,22,0.05) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
}

.hero-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,10,0.7) 0%, rgba(10,10,10,0.35) 50%, rgba(10,10,10,0.6) 100%);
  z-index: 1;
}

[data-theme="light"] .hero-video-overlay {
  background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0.8) 100%);
}

.product-card {
  background: var(--color-dark-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: var(--color-accent);
}

.product-card-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #222;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-img {
  transform: scale(1.05);
}

.product-card .product-card-img-wrap {
  overflow: hidden;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-polaris {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-canam {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-category {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--color-accent);
  color: var(--color-light);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--color-light);
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--color-accent);
  background: rgba(249,115,22,0.1);
}

.section-dark {
  background: var(--color-dark);
}

.section-darker {
  background: var(--color-dark-surface);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding {
  padding: 96px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--color-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.accent-line {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 16px auto;
}

.stat-number {
  font-family: 'Oswald', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-accent);
}

.vehicle-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: border-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.vehicle-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.vehicle-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.3) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--color-dark-card);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-light);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--color-accent);
}

.input-field::placeholder {
  color: #555;
}

textarea.input-field {
  resize: vertical;
  min-height: 120px;
}

.footer-section {
  background: var(--color-dark-surface);
  border-top: 1px solid var(--color-border);
  padding: 64px 0 32px;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  margin-top: 48px;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10,10,10,0.98);
  z-index: 60;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  color: var(--color-light);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

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

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ========== GALLERY GRID ========== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(249,115,22,0.9);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 3px;
  margin-bottom: 8px;
  width: fit-content;
}

.gallery-item-overlay p {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gallery-item-wide {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
  }
  .gallery-item-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .gallery-item-wide {
    grid-column: span 1;
  }
  .gallery-item-overlay {
    opacity: 1;
  }
}

/* Filter bar */
.filter-btn {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(249,115,22,0.1);
}

/* Page header for inner pages */
.page-header {
  padding: 160px 0 80px;
  background: var(--color-dark-surface);
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* Logo triangle */
.logo-triangle {
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 32px solid var(--color-accent);
  display: inline-block;
  margin-right: 10px;
  position: relative;
  top: -2px;
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .related-products {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 8px;
  }

  .related-products > * {
    flex: 0 0 80vw;
    max-width: 80vw;
    scroll-snap-align: center;
  }

  .related-products::-webkit-scrollbar {
    height: 4px;
  }

  .related-products::-webkit-scrollbar-track {
    background: var(--color-border);
    border-radius: 2px;
  }

  .related-products::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 2px;
  }

  .section-padding {
    padding: 48px 0;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
  }

  .nav-fixed .theme-toggle {
    display: flex;
  }

  .custom-fab-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  /* Vehicle cards — single column stack */
  .vehicle-grid {
    grid-template-columns: 1fr !important;
  }

  .vehicle-card {
    height: 200px !important;
  }

  /* Stats bar — 2x2 grid on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  /* Footer — single column on mobile */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Page header smaller on mobile */
  .page-header {
    padding: 120px 0 48px;
  }

  .page-header h1 {
    font-size: 2rem !important;
  }

  /* About page process grid */
  .process-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Why D-FAB grid */
  .why-grid {
    grid-template-columns: 1fr !important;
  }

  /* Contact / Custom form layout */
  .form-layout {
    flex-direction: column !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .product-card-img {
    height: 220px;
  }

  /* Product detail page */
  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

@media (max-width: 480px) {
  .process-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-section h1 {
    font-size: 2rem !important;
  }

  .btn-primary, .btn-outline {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (min-width: 769px) {
  .mobile-toggle {
    display: none !important;
  }
}

/* ========== LOGO THEME SWAP ========== */

.site-logo .logo-dark { display: none; }
.site-logo .logo-light { display: block; }

[data-theme="light"] .site-logo .logo-dark { display: block; }
[data-theme="light"] .site-logo .logo-light { display: none; }

/* ========== THEME TOGGLE ========== */

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--color-accent);
  background: rgba(249,115,22,0.1);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { transition: opacity 0.3s ease; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ========== LIGHT THEME ========== */

[data-theme="light"] {
  --color-dark: #f8f8f8;
  --color-dark-surface: #eeeeee;
  --color-dark-card: #ffffff;
  --color-accent: #ea580c;
  --color-accent-hover: #c2410c;
  --color-light: #1a1a1a;
  --color-muted: #555555;
  --color-border: #d4d4d4;
}

[data-theme="light"] .nav-scrolled {
  background-color: rgba(248, 248, 248, 0.95) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .hero-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(234,88,12,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(234,88,12,0.04) 0%, transparent 50%),
    linear-gradient(180deg, #f0f0f0 0%, #e8e8e8 100%);
}

[data-theme="light"] .hero-overlay {
  background: linear-gradient(135deg, rgba(248,248,248,0.92) 0%, rgba(248,248,248,0.7) 50%, rgba(248,248,248,0.85) 100%);
}

[data-theme="light"] .hero-grid-pattern {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

[data-theme="light"] .product-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .product-card-img {
  background: #e5e5e5;
}

[data-theme="light"] .vehicle-card-overlay {
  background: linear-gradient(to top, rgba(248,248,248,0.95) 0%, rgba(248,248,248,0.4) 60%, transparent 100%);
}

[data-theme="light"] .mobile-menu {
  background: rgba(248,248,248,0.98);
}

[data-theme="light"] .input-field::placeholder {
  color: #999;
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
}

[data-theme="light"] .btn-outline {
  color: #1a1a1a;
  border-color: rgba(0,0,0,0.2);
}

[data-theme="light"] .btn-outline:hover {
  border-color: var(--color-accent);
}

[data-theme="light"] .badge-polaris {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .badge-canam {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.2);
}

[data-theme="light"] .badge-category {
  background: rgba(234, 88, 12, 0.1);
  border-color: rgba(234, 88, 12, 0.2);
}

/* Override inline white colors in light mode */
[data-theme="light"] .nav-fixed a,
[data-theme="light"] .nav-fixed span,
[data-theme="light"] .mobile-menu a,
[data-theme="light"] .hero-section h1,
[data-theme="light"] .hero-section p,
[data-theme="light"] .footer-section,
[data-theme="light"] .footer-section a,
[data-theme="light"] .footer-section h4,
[data-theme="light"] .footer-section p,
[data-theme="light"] .footer-section span,
[data-theme="light"] .vehicle-card-overlay h3,
[data-theme="light"] .vehicle-card-overlay p,
[data-theme="light"] .vehicle-card-overlay a,
[data-theme="light"] .vehicle-card-overlay span,
[data-theme="light"] .page-header h1,
[data-theme="light"] .page-header p,
[data-theme="light"] .page-header a {
  color: #1a1a1a !important;
}

[data-theme="light"] .nav-fixed svg text,
[data-theme="light"] .footer-section svg text {
  fill: #fff;
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary span {
  color: #ffffff !important;
}

[data-theme="light"] .stat-number {
  color: var(--color-accent);
}

/* Smooth transition for theme switch */
body, .nav-fixed, .product-card, .input-field, .footer-section,
.page-header, .section-dark, .section-darker, .vehicle-card,
.filter-btn, .badge, .btn-outline {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}