/* ===========================
   Hero
=========================== */

.hero {
  width: 100%;
  min-height: 420px;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end; /* text at bottom */
  color: #ffffff;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.15)
  );
}

.hero-content {
  position: relative;
  padding: 40px 0 36px;
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 6px;
}

.hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 10px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  max-width: 520px;
  font-size: 16px;
  margin: 0 0 18px;
  opacity: 0.95;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===========================
   Why section
=========================== */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.why-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
}

.why-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.why-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===========================
   Footer
=========================== */

.site-footer {
  background: #111827;
  color: #ffffff;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.4fr;
  gap: 24px;
}

.site-footer h3,
.site-footer h4 {
  margin-top: 0;
}

.site-footer a {
  color: #e5e7eb;
}

.footer-bottom {
  border-top: 1px solid rgba(156, 163, 175, 0.4);
  margin-top: 20px;
  padding-top: 14px;
  font-size: 13px;
  color: #9ca3af;
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 900px) {
  .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero h1 {
    font-size: 32px;
  }
}

@media (max-width: 700px) {
  .why-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 360px;
  }

  .hero-content {
    padding-bottom: 28px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

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

/* ==== New Vehicles Section ==== */

.new-vehicles {
  padding: 3rem 0 4rem;
}

.new-vehicles .section-header {
  text-align: left;
  margin-bottom: 1.5rem;
}

.new-vehicles .section-header h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

/* Filters */

.vehicle-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  border: 1px solid #ddd;
  background: #f7f7f7;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
  background: #eaeaea;
}

.filter-btn.is-active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Grid – number of columns controlled by CSS variable */

:root {
  --vehicle-columns: 3; /* Default; JS can override */
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(var(--vehicle-columns), minmax(0, 1fr));
  gap: 1.25rem;
}

/* Responsive tweaks */

@media (max-width: 960px) {
  :root {
    --vehicle-columns: 2;
  }
}

@media (max-width: 640px) {
  :root {
    --vehicle-columns: 1;
  }
}

/* Card container */
.vehicle-card {
  position: relative;
  perspective: 1000px; /* subtle 3D depth */
}

/* Inner wrapper */
.vehicle-card-inner {
  position: relative;
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* Faces (front + back) share base styles */

.vehicle-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition:
    opacity 0.35s ease,
    transform 0.45s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* FRONT */

.vehicle-card-front {
  z-index: 2;
  opacity: 1;
  transform-origin: center left;
  transform: rotateY(0deg);
}

.vehicle-image-wrapper {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f2f2;
}

.vehicle-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vehicle-card-body {
  padding: 0.9rem 1rem 1rem;
}

.vehicle-meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  margin-bottom: 0.25rem;
}

.vehicle-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.vehicle-tagline {
  font-size: 0.85rem;
  color: #555;
}

/* BACK */

.vehicle-card-back {
  z-index: 1;
  opacity: 0;
  padding: 1rem;
  background: #3366cc;
  color: #fff;
  justify-content: space-between;
  transform-origin: center right;
  transform: rotateY(90deg); /* start turned away */
}

.vehicle-back-content {
  flex: 1;
}

.vehicle-card-back h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.vehicle-features {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.vehicle-features li {
  margin-bottom: 0.25rem;
}

.vehicle-category-pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  color: #111;
}

.vehicle-cta {
  margin-top: 0.6rem;
}

.vehicle-cta a {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #fff;
  text-decoration: none;
  color: #fff;
}

/* Hover: front rotates out, back rotates in */

@media (hover: hover) and (pointer: fine) {
  .vehicle-card:hover .vehicle-card-front {
    opacity: 0;
    transform: rotateY(-90deg);
  }

  .vehicle-card:hover .vehicle-card-back {
    opacity: 1;
    transform: rotateY(0deg);
    z-index: 3;
  }
}

/* Filter bar: types left, brands right */

.vehicle-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.vehicle-brand-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Brand buttons reuse .filter-btn styles, with disabled look */
.brand-filter-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* On smaller screens, stack filters vertically */
@media (max-width: 768px) {
  .vehicle-filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .vehicle-brand-filters {
    width: 100%;
  }
}
