/* ============================================
   PREMIUM ENHANCEMENTS
   ============================================ */

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-gold);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-gold);
  color: #0a0a0f;
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

/* Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-rgb), 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(var(--brand-rgb), 0.03) 0%, transparent 70%);
}

/* Flat premium card — hover lift only. (Retired the 3D tilt: preserve-3d + translateZ
   rendered the card body ~2% larger and subpixel-blurred its text on the flagship component.) */
.car-card:hover {
  transform: translateY(-8px);
}

/* Gradient Mesh Hero Background */
.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: meshFloat 20s ease-in-out infinite;
}

.mesh-blob-1 {
  width: 500px;
  height: 500px;
  background: rgba(var(--brand-rgb), 0.08);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.mesh-blob-2 {
  width: 400px;
  height: 400px;
  background: rgba(var(--brand-rgb), 0.05);
  bottom: -10%;
  left: -5%;
  animation-delay: -7s;
}

.mesh-blob-3 {
  width: 300px;
  height: 300px;
  background: rgba(var(--brand-rgb), 0.06);
  top: 40%;
  left: 30%;
  animation-delay: -14s;
}

@keyframes meshFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 20px) scale(1.02); }
}

[data-theme="light"] .mesh-blob-1 { background: rgba(var(--brand-rgb), 0.06); }
[data-theme="light"] .mesh-blob-2 { background: rgba(var(--brand-rgb), 0.04); }
[data-theme="light"] .mesh-blob-3 { background: rgba(var(--brand-rgb), 0.05); }

/* Testimonials */
.testimonials {
  background: var(--bg-secondary);
  overflow: hidden;
}

.testimonials-wrapper {
  position: relative;
}

.testimonials-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-card {
  min-width: calc(33.333% - 16px);
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-gold);
  stroke: none;
}

.testimonial-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #0a0a0f;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.testimonials-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.testimonials-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.testimonials-nav button:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.testimonials-dots {
  display: flex;
  gap: 8px;
}

.testimonials-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: all 0.3s;
  cursor: pointer;
}

.testimonials-dots .dot.active {
  background: var(--accent-gold);
  width: 24px;
  border-radius: 4px;
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.faq-item:hover,
.faq-item.active {
  border-color: rgba(var(--brand-rgb), 0.3);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--bg-card-hover);
}

.faq-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(var(--brand-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, background 0.3s;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-icon svg {
  width: 12px;
  height: 12px;
  stroke: var(--accent-gold);
  transition: transform 0.3s;
}

.faq-item.active .faq-icon {
  background: var(--accent-gold);
}

.faq-item.active .faq-icon svg {
  stroke: #0a0a0f;
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

/* Mobile Menu Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Improved mobile nav (collapsed range now ≤1400px — see style.css nav block) */
@media (max-width: 1480px) {
  /* Full-width panel dropping below the bar. Uses position:absolute (relative
     to the positioned .navbar) on purpose: the navbar's backdrop-filter makes
     it the containing block for position:fixed, which collapsed the old side
     panel to a clipped sliver. Absolute anchors cleanly under the bar. */
  .nav-links.active {
    position: absolute;
    top: var(--nav-height);
    left: auto;
    right: 0;
    bottom: auto;
    width: min(420px, 100%);          /* full-width on phones, tidy right panel on tablet/small-desktop */
    max-height: calc(100vh - var(--nav-height));
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-bottom-left-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
    z-index: 999;
    transform: none;
    animation: dropInMenu 0.22s ease forwards;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links .nav-link {
    font-size: 1.0625rem;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
  }

  /* Inside the open (solid) panel, links must be dark — beat the
     over-video white-text rule regardless of navbar scroll state. */
  .navbar .nav-links.active .nav-link { color: var(--text-primary); }
  .navbar .nav-links.active .nav-apply { color: var(--brand); }
  [data-theme="dark"] .navbar .nav-links.active .nav-apply { color: var(--brand-bright); }

  .nav-links .nav-link:hover,
  .nav-links .nav-link.active {
    background: rgba(var(--brand-rgb), 0.08);
  }
  
  .testimonial-card {
    min-width: calc(100% - 0px);
  }
}

@keyframes slideInMenu {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes dropInMenu {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Nav toggle animation */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Smooth image loading */
.car-card-image img {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.car-card-image img.loaded {
  opacity: 1;
}

/* Button press effect */
.btn:active {
  transform: scale(0.97) !important;
}

/* Input focus glow */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

/* Glassmorphism cards on hover */
.step-card:hover,
.advantage-card:hover,
.service-card:hover {
  background: var(--gradient-card);
  box-shadow: var(--shadow-md);
}

/* Smooth link transitions */
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a::before {
  content: '';
  width: 0;
  height: 1px;
  background: var(--accent-gold);
  transition: width 0.3s;
}

.footer-links a:hover::before {
  width: 12px;
}

/* Stats counter animation pulse */
.stat-number {
  position: relative;
}

/* Car card MSRP strikethrough */
.car-card-msrp {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

/* Responsive testimonials */
@media (max-width: 1024px) {
  .testimonial-card {
    min-width: calc(50% - 12px);
  }
}

@media (max-width: 768px) {
  .testimonial-card {
    min-width: 100%;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}
