.carousel {
  position: relative;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.5s ease;
  will-change: transform;
  width: 100%;
}
.carousel-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  height: 16rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Mobile: show 1⅓ cards (aligned with gap:1rem). */
  flex: 0 0 calc((100% - 3rem) * 4 / 12.5);
}
.carousel-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.carousel-card:hover img {
  transform: scale(1.05);
}
.carousel-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.4) 40%,
    transparent
  );
}
.carousel-card .text {
  position: relative;
  z-index: 1;
  color: white;
  padding: 1rem 1.3rem
}
.carousel-card .text h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.carousel-card .text p {
  color: #d1d5db;
  font-weight: 400;
}

/* ===== Pagination dots ===== */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.carousel-dots span {
  cursor: pointer;
  transition:
    width 0.3s ease,
    background 0.3s ease;
}
.carousel-dots .active {
  width: 2rem;
  height: 0.25rem;
  background: #9ca3af;
  border-radius: 9999px;
}
.carousel-dots .inactive {
  width: 0.5rem;
  height: 0.5rem;
  background: #d1d5db;
  border-radius: 9999px;
}
/* ===== Carousel navigation arrows ===== */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}


.carousel-nav--prev {
  left: 1rem;
}

.carousel-nav--next {
  right: 1rem;
}

.carousel-nav .icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: white;
  stroke-width: 2;
}

@media (max-width:899px) {
  .carousel-card {
    flex: 0 0 calc((100% - 3rem) * 1.2);
  }
}
