/* Homepage listings carousel — scoped to .home-carousel */

.home-carousel {
  position: relative;
  z-index: 2;
  padding: 48px 0 56px;
}

.home-carousel__header {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.home-carousel__intro {
  max-width: 720px;
  margin: 0 auto clamp(20px, 3vw, 28px);
  text-align: center;
}

.home-carousel__intro.section-header {
  margin-top: 0;
  margin-bottom: clamp(20px, 3vw, 28px);
}

.home-carousel__headerRow {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 24px;
  margin-bottom: clamp(20px, 3vw, 28px);
}

.home-carousel__viewAll {
  color: #60a5fa;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.home-carousel__viewAll:hover {
  color: #93c5fd;
  text-decoration: none;
}

.home-carousel__wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-carousel__viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 6px 2px 12px;
}

.home-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.home-carousel__viewport:focus {
  outline: none;
}

.home-carousel__viewport:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.65);
  outline-offset: 4px;
  border-radius: 12px;
}

.home-carousel__track {
  display: flex;
  gap: 16px;
}

.home-carousel__nav {
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.home-carousel__nav:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(30, 41, 59, 0.95);
}

.home-carousel__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.home-carousel__nav:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.75);
  outline-offset: 2px;
}

.home-carousel__message {
  margin: 0;
  padding: 24px 0;
  color: rgba(148, 163, 184, 0.92);
  font-size: 0.95rem;
}

.home-carousel__message--error {
  color: #fca5a5;
}

/* Featured listing card */
.home-feature-card {
  flex: 0 0 calc((100% - 32px) / 3);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(10, 16, 36, 0.92);
  overflow: hidden;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  opacity: 0;
  transform: translateY(10px);
}

.home-feature-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.home-feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.home-feature-card:hover .home-feature-card__img img {
  transform: scale(1.025);
}

.home-feature-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
}

.home-feature-card__img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-feature-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-feature-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(148, 163, 184, 0.5);
  font-size: 2rem;
}

.home-feature-card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(2, 7, 24, 0.72);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.home-feature-card__fav:hover,
.home-feature-card__fav.is-active {
  border-color: rgba(236, 72, 153, 0.55);
  color: #f472b6;
  background: rgba(2, 7, 24, 0.88);
}

.home-feature-card__fav:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.75);
  outline-offset: 2px;
}

.home-feature-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}

.home-feature-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f1f5f9;
}

.home-feature-card__price {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f472b6;
}

.home-feature-card__mileage {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.92);
}

.home-feature-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.88);
}

.home-feature-card__specs li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.home-feature-card__location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.92);
}

.home-feature-card__link {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-feature-card__link:hover {
  color: #93c5fd;
}

.home-feature-card__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

@media (max-width: 1100px) {
  .home-feature-card {
    flex: 0 0 calc((100% - 32px) / 3);
  }
}

@media (max-width: 860px) {
  .home-feature-card {
    flex: 0 0 calc((100% - 16px) / 2);
  }
}

@media (max-width: 560px) {
  .home-carousel__headerRow {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .home-carousel {
    padding: 36px 0 44px;
  }

  .home-carousel__wrap {
    gap: 8px;
  }

  .home-carousel__nav {
    width: 38px;
    height: 38px;
  }

  .home-feature-card {
    flex: 0 0 82%;
  }

  .home-journey__car {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-feature-card,
  .home-feature-card.is-revealed,
  .home-feature-card:hover,
  .home-feature-card__img img {
    transition: none;
    transform: none;
  }

  .home-carousel__viewport {
    scroll-behavior: auto;
  }
}
