.carousel-container {
  width: 100%;
  max-width: 1400px;
  margin: auto;
}

.carousel-wrapper {
  position: relative;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  align-items: stretch;
}

.carousel-card {
  flex: 0 0 calc(33.333% - 1rem);
  background-color: var(--background-color);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.carousel-card:hover {
  transform: translateY(-1px);
  cursor: pointer;
}

.carousel-card img {
  width: 100%;
  height: 280px;
  border-radius: 1rem;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.25rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 1rem 0;
  /* Set a min-height to align titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.carousel-navigation {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.nav-btn {
  display: flex;
  width: 56px;
  height: 56px;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-lg, 12px);
  border-radius: var(--radius-full, 9999px);
  background-color: var(--background-color);
  cursor: pointer;
  border: 1px solid var(--Colors-Border-border-secondary, #E9EAEB);
}

.nav-btn:hover:not(:disabled) {
  background-color: #f0f0f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background-color: #f5f5f5;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-color);
  stroke-width: 2;
}

@media (max-width: 1400px) {
  .carousel-container {
    padding: 1rem;
  }
}

@media (max-width: 1024px) {
  .carousel-card {
    flex: 0 0 calc(50% - 0.75rem);
    /* 2 items visible */
  }
}

@media (max-width: 768px) {
  .carousel-viewport {
    overflow: visible;
    /* Allow vertical stacking */
  }

  .carousel-track {
    display: block;
    /* Change to vertical layout */
    transform: none !important;
    /* Disable JS sliding */
  }

  .carousel-card {
    width: 100%;
    margin-bottom: 1.5rem;
    display: none;
    /* Hide all cards by default on mobile */
  }

  .carousel-card:nth-child(-n+3) {
    display: block;
  }

  .carousel-navigation {
    display: none;
    /* Hide navigation on mobile */
  }
}