body {
  background: #f9fafb;
  font-family: "Inter", sans-serif;
}

/* Override hero-section for vehicle detail page */
.hero-section {
  position: relative;
  width: 100%;
  height: auto;
  min-height: auto;
  overflow: visible;
  display: block;
  align-items: unset;
  justify-content: unset;
  background-color: #f9fafb;
  padding-top: 80px;
  /* Space for fixed navbar */
}

.vehicle-main-section {
  width: 90%;
  margin: 24px auto;
  background-color: #F9FAFB;
  padding: 32px 24px;
  display: block;
}

.vehicle-content-row {
  display: flex;
  flex-direction: row;
  /* image left, details right on desktop */
  gap: 32px;
  width: 100%;
  align-items: flex-start;
}

.vehicle-image-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  flex: 0 0 65%;
  /* occupy ~65% of row to give larger image area */
  max-width: 65%;
  order: 1;
}

.vehicle-main-img {
  /* Enforce a consistent visual size while allowing scaling on very small viewports */
  width: 100%;
  aspect-ratio: 5 / 3;
  /* Keep main image in a stable 5:3 ratio (width:height = 5:3). */
  max-width: 100%;
  /* allows shrinking on small screens */
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  background: #fff;
  transition: transform 0.3s ease;
}

.vehicle-main-img:hover {
  transform: scale(1.02);
}

.vehicle-thumbnails {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  position: relative;
  padding-left: 4px;
}

.vehicle-thumbnails img {
  /* Keep thumbnails a uniform fixed size */
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.vehicle-thumbnails img.selected {
  border: 2px solid var(--primary-color);
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}

.slider-btn.prev {
  left: -40px;
}

.slider-btn.next {
  right: -40px;
}

.vehicle-image-block:hover .slider-btn {
  opacity: 1;
}

.vehicle-details-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex: 0 0 35%;
  /* occupy ~35% of row (reduced to allow larger image block) */
  max-width: 35%;
  order: 2;
}

.vehicle-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.2;
}

.vehicle-model {
  font-size: 1.2rem;
  color: #64748b;
  margin-bottom: 24px;
  font-weight: 500;
}

.vehicle-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.vehicle-detail-item {
  font-size: 0.95rem;
  color: #334155;
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 16px;
  align-items: center;
  background: #ffffff;
  border-radius: 50px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
}

.vehicle-detail-item .detail-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
}

.vehicle-detail-item .detail-value {
  font-size: 1rem;
  color: #0f172a;
  font-weight: 600;
}

.vehicle-detail-item i {
  color: var(--primary-color);
  font-size: 1.1em;
}

.vehicle-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-color);
  background: var(--primary-color);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vehicle-emi {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 24px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.add-to-cart-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, white 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-color);
}

.why-choose-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 0;
  padding: 32px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  order: 3;
}

.why-choose-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 1rem;
  font-weight: 500;
}

.why-choose-item i {
  font-size: 2rem;
  color: var(--primary-color);
}

.vehicle-description {
  font-size: 1.05rem;
  color: #334155;
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-top: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.other-cars-section {
  margin: 40px auto;
  max-width: 1400px;
  width: calc(100% - 48px);
  padding: 40px 24px;
  background: #F9FAFB;
  order: 3;
}

/* (mobile rules consolidated later) */

/* Mid-size laptops: shrink a few values for screens between 901px and 1280px */
@media (min-width: 901px) and (max-width: 1280px) {

  /* Subtle reductions for smaller laptops — avoid large visual shifts */
  .vehicle-main-section {
    padding: 24px 20px;
    margin: 20px auto;
  }

  .vehicle-content-row {
    gap: 24px;
  }

  .vehicle-image-block {
    flex: 0 0 66%;
    max-width: 66%;
    padding: 18px;
  }

  .vehicle-details-block {
    flex: 0 0 34%;
    max-width: 34%;
    padding: 20px;
  }

  .vehicle-main-img {
    max-height: 600px;
    /* gentle reduction only */
  }

  .vehicle-thumbnails img {
    width: 104px;
    height: 78px;
  }

  .vehicle-title {
    font-size: 2.15rem;
  }

  .vehicle-model {
    font-size: 1.12rem;
  }

  .vehicle-price {
    font-size: 1.9rem;
  }

  .other-car-card {
    min-width: 310px;
    max-width: 310px;
  }

  .slider-btn.prev {
    left: -35px;
  }

  .slider-btn.next {
    right: -35px;
  }
}

.other-cars-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
}

.other-cars-title::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #e55a00 100%);
  border-radius: 2px;
}

.other-cars-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #f1f5f9;
}

.other-cars-row::-webkit-scrollbar {
  height: 8px;
}

.other-cars-row::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.other-cars-row::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.other-cars-row::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.vehicle-thumbnails,
.mobile-thumbnails,
.other-cars-row {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

.vehicle-thumbnails::-webkit-scrollbar,
.mobile-thumbnails::-webkit-scrollbar,
.other-cars-row::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
  width: 0;
  height: 0;
}

.vehicle-thumbnails:focus,
.mobile-thumbnails:focus,
.other-cars-row:focus {
  outline: none;
}

.other-car-card {
  min-width: 320px;
  max-width: 320px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 18px;
  transition: box-shadow 0.2s;
}

.other-car-card:hover {
  box-shadow: 0 8px 32px var(--primary-color);
}

.other-car-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #f3f4f6;
}

.card-content {
  width: 100%;
  gap: 12px;
}

.details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item {
  font-size: 0.9rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 1.2rem;
}

.button-group {
  display: flex;
  gap: 12px;
}

.contact-btn,
.view-details-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-btn:hover,
.view-details-btn:hover {
  background: #100f0f;
}

.disabled {
  background: #e0e0e0;
  color: #a0a0a0;
  cursor: not-allowed;
}


.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 90%;
  max-width: 360px;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 240ms ease-in-out;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu .close-btn {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-bottom: 8px;
}

.mobile-menu .mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.mobile-menu .mobile-nav a {
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  padding: 8px 0;
}


/* Consolidated mobile rules: stack columns and reduce sizes for smaller screens */
@media (max-width: 900px) {
  .vehicle-content-row {
    flex-direction: column;
    gap: 20px;
  }

  .vehicle-image-block,
  .vehicle-details-block {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  .vehicle-main-section {
    padding: 20px;
    margin: 16px;
  }

  /* Main image + thumbnails */
  .vehicle-main-img {
    width: 100%;
    aspect-ratio: 5/3;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
  }

  .vehicle-thumbnails {
    order: 2;
    margin-top: 12px;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    width: 100%;
    justify-content: flex-start;
  }

  .vehicle-thumbnails img {
    width: 96px;
    height: 72px;
  }

  .mobile-thumbnails img {
    width: 80px !important;
    height: 60px !important;
  }

  /* Detail column adjustments */
  .vehicle-details-grid {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

  .vehicle-details-block {
    padding: 18px;
  }

  /* Typography */
  .vehicle-title {
    font-size: 1.8rem;
    text-align: center;
  }

  .vehicle-model {
    font-size: 1rem;
    text-align: center;
  }

  .vehicle-price {
    font-size: 1.8rem;
    text-align: center;
  }

  /* Other cars slider */
  .other-cars-row {
    gap: 16px;
    padding: 12px 0;
  }

  .other-car-card {
    min-width: 260px;
    max-width: 260px;
    padding: 18px;
  }

  /* CTAs */
  .add-to-cart-btn,
  .contact-btn,
  .view-details-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .vehicle-main-section {
    gap: 12px;
    border-radius: 0px;
  }

  .vehicle-main-img {
    width: 100%;
    aspect-ratio: 5 / 3;
    max-height: 260px;
    object-fit: cover;
  }

  .vehicle-title {
    font-size: 1.35rem;
  }

  .vehicle-price {
    font-size: 1.25rem;
  }

  .vehicle-thumbnails img,
  .mobile-thumbnails img {
    width: 68px !important;
    height: 48px !important;
    margin-right: 0;
  }

  .mobile-thumbnails {
    gap: 8px !important;
    padding: 12px !important;
  }

  .other-car-card {
    min-width: 220px;
    max-width: 220px;
    padding: 18px;
  }

  /* Make CTA buttons easier to tap on mobile */
  .add-to-cart-btn,
  .contact-btn,
  .view-details-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
  }

  /* Make other-cars slider show one full card per swipe on small screens */
  .other-cars-row {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }

  .other-car-card {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
  }

  .why-choose-item i {
    font-size: 1.4rem;
  }

  .why-choose-item {
    font-size: 0.95rem;
  }

  .vehicle-content-row {
    flex-direction: column;
  }

  .vehicle-details-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-detail-item {
    color: #334155;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
  }

  .vehicle-detail-item .detail-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .vehicle-detail-item .detail-value {
    font-size: 1.2rem;
    color: #0f172a;
    font-weight: 600;
  }

  .vehicle-detail-item i {
    color: var(--primary-color);
    font-size: 1.1em;
  }
}

/* Mobile slider styles */
.mobile-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.mobile-slider .slides {
  display: flex;
  transition: transform 300ms ease;
  width: 100%;
}

.mobile-slider .slide {
  min-width: 100%;
  height: 220px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-slider .slide img {
  width: 90%;
  height: 240px !important;
  border-radius: 12px;
  object-fit: contain;
}

.mobile-slider .slide-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 8px 0;
  margin-top: 50px;
}

.mobile-slider .slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
}

.mobile-slider .slide-dot.active {
  background: var(--primary-color);
}

.vehicle-thumbnails {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  margin-left: 0;
  width: 100%;
  height: auto;
  justify-content: flex-start;
}

.vehicle-thumbnails img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.vehicle-thumbnails img.selected {
  border-color: var(--primary-color);
}

/* Desktop: clear two-column layout using flex to keep image and details aligned */
@media (min-width: 900px) {
  .vehicle-main-section {
    max-width: 100%;
    margin: 84px auto;
    display: block;
    background-color: #F9FAFB;
  }

  .vehicle-content-row {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
  }

  .vehicle-image-block {
    flex: 0 0 65%;
    max-width: 65%;
    padding: 24px 16px;
    position: relative;
    background: transparent;
  }

  .vehicle-main-img {
    width: 95%;
    aspect-ratio: 5 / 3;
    max-height: 720px;
    object-fit: cover;
    margin: 0;
  }

  .vehicle-thumbnails {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: flex-start;
    margin-top: 16px;
  }

  .vehicle-thumbnails img {
    width: 88px;
    height: 64px;
    object-fit: cover;
  }

  .vehicle-details-block {
    flex: 0 0 35%;
    max-width: 35%;
    align-self: flex-start;
  }

  .vehicle-price {
    font-size: 2rem;
  }
}

/* Thumbnail scrolling improvements */
.vehicle-thumbnails {
  scroll-snap-type: x mandatory;
}

.vehicle-thumbnails img {
  scroll-snap-align: center;
}

/* Arrow buttons for Other Cars slider */
.other-cars-section {
  position: relative;
}

/* Ensure the section doesn't clip absolutely positioned arrows */
.other-cars-section {
  overflow: visible !important;
}

.other-cars-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 99999 !important; /* very high z-index to avoid being hidden */
  box-shadow: 0 6px 18px rgba(2,6,23,0.18);
  transition: transform 160ms ease, opacity 160ms ease;
}

.other-cars-btn.prev {
  left: 12px;
}

.other-cars-btn.next {
  right: 12px;
}

.other-cars-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

@media (max-width: 480px) {
  /* Show touch-friendly slider arrow buttons on very small screens
     Make them slightly smaller and inset so they don't block card content. */
  .other-cars-btn {
    display: flex;
    width: 36px;
    height: 36px;
    opacity: 0.98;
  }

  .other-cars-btn.prev { left: 8px; }
  .other-cars-btn.next { right: 8px; }
}

/* Loading overlay for Other Cars */
.other-cars-overlay {
  /* Full viewport overlay so it covers entire screen rather than just the section */
  position: fixed;
  inset: 0;
  display: none; /* controlled by JS */
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  z-index: 100000;
  pointer-events: auto; /* block interactions while loading */
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.other-cars-overlay .loader {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(15,23,42,0.12);
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

.other-cars-overlay .loader-text {
  color: #0f172a;
  font-weight: 700;
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Global fixed loading overlay (fallback) */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  z-index: 100000 !important;
  pointer-events: none;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.global-loading-overlay .loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 5px solid rgba(15,23,42,0.08);
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

.global-loading-overlay .loader-text {
  color: #0f172a;
  font-weight: 700;
  font-size: 15px;
}