/* =============================================
   APEX MOTORS — Custom Styles
   Colors: #0a0a0a | #dc2626 | #c0c0c0
   ============================================= */

html { scroll-behavior: smooth; }

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: #dc2626;
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* Navbar scroll effect */
#navbar.scrolled {
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(220,38,38,0.2);
}
#navbar { background: transparent; }

/* Buttons */
.btn-primary {
  background: #dc2626;
  color: #ffffff;
  border: 2px solid #dc2626;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  display: inline-block;
  text-align: center;
}
.btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 2px solid #c0c0c0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  display: inline-block;
  text-align: center;
}
.btn-outline:hover {
  border-color: #dc2626;
  color: #dc2626;
  transform: translateY(-1px);
}

/* Mobile Menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.mobile-menu.open {
  max-height: 500px;
}

/* Hero Animations */
.hero-tagline { animation: heroFadeUp 0.7s ease forwards 0.3s; }
.hero-title   { animation: heroFadeUp 0.7s ease forwards 0.6s; }
.hero-subtitle{ animation: heroFadeUp 0.7s ease forwards 0.9s; }
.hero-cta     { animation: heroFadeUp 0.7s ease forwards 1.1s; }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll Reveal */
.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Carousel */
.carousel-container { position: relative; }
.carousel-slide {
  display: none;
}
.carousel-slide.active {
  display: block;
  animation: carouselFade 0.5s ease;
}
@keyframes carouselFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.carousel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #374151;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.carousel-dot.active {
  background: #dc2626;
  transform: scale(1.3);
}

/* FAQ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}
.faq-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.faq-item.open .faq-icon {
  transform: rotate(180deg);
}
.faq-item { cursor: pointer; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 2rem 0;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  transform: scale(0.9);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 500;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}
.back-to-top:hover { transform: translateY(-3px); }

/* Lazy image loading */
.lazy-img {
  filter: blur(8px);
  transition: filter 0.5s ease;
}
.lazy-img.loaded {
  filter: blur(0);
}

/* Form error */
.form-error { display: block; }
.form-error.hidden { display: none; }

/* Car card */
.car-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(220,38,38,0.15);
}
