/**
 * Product Card Carousel Styles
 * Modern, clean carousel implementation for product cards
 */

/* Carousel container with positioning context */
.rd-product-carousel-container {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 30px 0;
  margin: auto;
  padding: 0 40px; /* Space for navigation arrows */
}

/* The actual carousel with horizontal scrolling */
.rd-product-carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  gap: 20px;
  padding: 10px 0; /* Space for box-shadow overflow */
  width: 100%;
  /* Center cards when there are too few to fill the container */
  justify-content: flex-start; /* Default to left alignment */
}

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

/* Make each card snap to grid */
.rd-product-carousel .shop-product-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 300px;
  margin: 0; /* Remove margin as we're using gap */
  height: auto; /* Let height be determined by content */
}

/* Navigation arrows */
.rd-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgb(82, 197, 255);
  color: white;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: all 0.3s ease;
}

.rd-carousel-nav:hover {
  background-color: #f8f9fa;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background-color: rgb(245, 152, 125);
}

.rd-carousel-prev {
  left: 0;
}

.rd-carousel-next {
  right: 0;
}

/* Arrow icons */
.rd-carousel-nav-icon {
  width: 12px;
  height: 12px;
  border-style: solid;
  border-width: 0 2px 2px 0;
  display: inline-block;
}

.rd-carousel-prev .rd-carousel-nav-icon {
  transform: rotate(135deg);
  margin-left: 4px;
}

.rd-carousel-next .rd-carousel-nav-icon {
  transform: rotate(-45deg);
  margin-right: 4px;
}

/* Dot indicators for mobile */
.rd-carousel-dots {
  display: none; /* Hidden by default, shown on mobile */
  justify-content: center;
  margin-top: 15px;
  gap: 8px;
}

.rd-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.rd-carousel-dot.active {
  background-color: #0073aa;
  transform: scale(1.2);
}

/* Mobile styles */
@media (max-width: 768px) {
  .rd-product-carousel-container {
    padding: 0; /* Remove padding for arrows */
  }

  .rd-product-carousel {
    gap: 10px;
    padding: 10px 20px; /* Add side padding to show peek of next card */
  }

  .rd-product-carousel .shop-product-card {
    width: 85vw; /* Take most of the viewport width */
    max-width: 300px;
  }

  .rd-carousel-nav {
    display: none; /* Hide arrows on mobile */
  }

  .rd-carousel-dots {
    display: flex; /* Show dots on mobile */
  }
}
