/* Listing Image Carousel Styles */

.listing-carousel {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  background-color: #f5f5f5;
}

.carousel-track {
  display: flex;
  transition: transform 0.3s ease-in-out;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navigation Arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 24, 39, 0.7);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
  backdrop-filter: blur(4px);
}

.carousel-nav:hover {
  background: rgba(17, 24, 39, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
}

/* Hide arrows if only one image */
.carousel-single .carousel-nav {
  display: none;
}

/* Image Counter */
.carousel-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(17, 24, 39, 0.8);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(4px);
  z-index: 10;
}

/* Dot Indicators */
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.carousel-dot.active {
  background: var(--color-accent-gold);
  width: 24px;
  border-radius: var(--radius-full);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Hide dots if counter is shown or only one image */
.listing-carousel.show-counter .carousel-dots,
.carousel-single .carousel-dots {
  display: none;
}

/* Placeholder for no images */
.carousel-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1f2937 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-gold);
}

.carousel-placeholder svg {
  width: 80px;
  height: 80px;
}

/* Touch/Swipe Support */
.listing-carousel {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* Loading State */
.carousel-image {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.carousel-image.loaded {
  opacity: 1;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .listing-carousel {
    height: 200px;
  }

  .carousel-nav {
    width: 36px;
    height: 36px;
  }

  .carousel-nav svg {
    width: 18px;
    height: 18px;
  }

  .carousel-counter {
    font-size: 10px;
    padding: 3px 10px;
  }
}

/* Hover Effect on Card */
.listing-card:hover .carousel-nav {
  opacity: 1;
}

/* Smooth scrolling for better UX */
@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: none;
  }

  .carousel-nav,
  .carousel-dot {
    transition: none;
  }
}
