:root {
  --primary: #E85D04;
  --primary-hover: #D05303;
  --secondary: #1B4965;
  --text-dark: #1F2937;
  --light-gray: #F8F9FA;
  --white: #FFFFFF;
}

html {
  scroll-behavior: smooth;
  font-family: 'Noto Sans Thai', sans-serif;
}

body {
  color: var(--text-dark);
  background-color: var(--white);
  overflow-x: hidden;
}

/* Navbar Transition */
.navbar {
  transition: all 0.3s ease-in-out;
}
.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Logo Pill Badge in Navbar */
.nav-logo-badge {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar.scrolled .nav-logo-badge {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.navbar.scrolled .nav-link {
  color: var(--text-dark);
}
.navbar:not(.scrolled) .nav-link {
  color: var(--white);
}

.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
.navbar:not(.scrolled) .nav-link::after {
  background-color: var(--white);
}

/* Hero Section - Authentic Automotive Atmosphere */
.hero-gradient {
  position: relative;
  background-color: #0b141f;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(232, 93, 4, 0.32) 0%, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(27, 73, 101, 0.45) 0%, transparent 60%),
    linear-gradient(180deg, rgba(11, 20, 31, 0.85) 0%, rgba(11, 20, 31, 0.95) 100%),
    url('https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?auto=format&fit=crop&q=80&w=1920');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Category Cards */
.category-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.category-card:hover {
  transform: translateY(-4px);
}

/* Category Horizontal Scroll on Mobile */
.category-scroll-container {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.category-scroll-container::-webkit-scrollbar {
  height: 5px;
}
.category-scroll-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 9999px;
}
.category-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.category-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
@media (min-width: 640px) {
  .category-scroll-container::-webkit-scrollbar {
    display: none;
  }
}

/* Card Effects */
.hover-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}


/* Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Loading animation */
.loader {
  border: 3px solid rgba(232, 93, 4, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--light-gray);
}
::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Mobile Floating Action Bar */
@media (max-width: 767px) {
  body {
    padding-bottom: 74px; /* Ensure content is not obscured by floating bar */
  }
}

.mobile-floating-bar {
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

/* FAQ Accordion */
.faq-item {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-item.active {
  border-color: rgba(232, 93, 4, 0.3);
  box-shadow: 0 4px 15px -3px rgba(232, 93, 4, 0.08);
}
.faq-icon-wrapper {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}
.faq-answer-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}
.faq-answer-container.open {
  max-height: 500px;
  opacity: 1;
}

@keyframes faqFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.faq-fade-in {
  animation: faqFadeIn 0.25s ease-out forwards;
}

/* Infinite Brand Logo Slider (Marquee) */
@keyframes marquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
  will-change: transform;
}

.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}

.brand-marquee-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 4.5rem;
  width: 12.5rem;
  flex-shrink: 0;
}

.brand-marquee-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(232, 93, 4, 0.15);
}

.brand-marquee-card img {
  max-height: 2.25rem;
  max-width: 9.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.brand-marquee-card:hover img {
  transform: scale(1.06);
}

/* Bento Card Micro-interactions */
.bento-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bento-card:hover {
  transform: translateY(-3px);
}


/* Accessibility: Support prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track {
    animation: none !important;
    overflow-x: auto;
  }
  .reveal, .reveal-left, .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


