.carousel-container {
  position: relative;
  padding: 0 40px;
  max-width: 100vw;
  overflow: hidden;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 2rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  position: relative;
  max-width: calc(100vw - 80px);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.carousel-slide {
  flex: 0 0 100%;
  max-width: calc(100% - 2rem);
  scroll-snap-align: start;
  scroll-snap-stop: always; /* Force stopping at each slide */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}

/* Overlay for off-screen items when show-fade is enabled */
.carousel-container.show-fade .carousel-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

/* Remove overlay from visible items */
.carousel-container.show-fade .carousel-slide.is-visible::before {
  opacity: 0;
}

/* Process specific styles */
.process-slide {
  width: 100%;
  min-width: 0; /* Prevent flex item from overflowing */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.process-slide .process-image {
  margin-bottom: 1rem;
  max-width: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
}

.process-slide .process-image img {
  width: 100%;
  max-width: 500px; /* Limit image width */
  height: auto;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Reviews specific styles */
.reviews-slide {
  padding: 1rem;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: all 0.2s;
  padding: 0;
}

.nav-arrow:hover:not(:disabled) {
  background: #f3f4f6;
}

.nav-arrow:disabled {
  cursor: not-allowed;
}

.nav-arrow.prev {
  left: 0;
}

.nav-arrow.next {
  right: 0;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .carousel-slide {
    flex: 0 0 calc(50% - 1rem);
    max-width: calc(50% - 1rem);
  }
}

@media (min-width: 1024px) {
  .carousel-slide {
    flex: 0 0 calc(33.333% - 1.334rem);
    max-width: calc(33.333% - 1.334rem);
  }
}

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

  .carousel {
    max-width: 100%;
    gap: 0;
  }

  .carousel-slide {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 0 1rem;
  }

  /* Adjust process slides for mobile */
  .process-slide {
    width: 100%;
  }

  .process-slide .process-image {
    margin: 0 auto 1rem auto;
    width: 100%;
  }

  .process-slide .process-image img {
    max-width: 100%;
    height: auto;
  }

  /* Adjust review slides for mobile */
  .reviews-slide {
    width: 100%;
  }

  .nav-arrow {
    width: 32px;
    height: 32px;
  }
}
