/* Product Gallery Improvements */
#imageGallery {
  position: relative;
}

#imageGallery.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #dc3545;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Slide Counter */
.slide-counter {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  margin-top: 10px;
}

/* Video Container Styles */
.lslide.contain-iframe,
.lslide.contain-video {
  position: relative;
}

.lslide.contain-iframe iframe,
.lslide.contain-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Thumbnail Navigation */
.thumbnail-item {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail-item.active {
  border-color: #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.thumbnail-item:hover {
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  #imageGallery .lSSlideOuter .lSPager.lSGallery {
    display: flex !important;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
  }
  
  #imageGallery .lSSlideOuter .lSPager.lSGallery li {
    width: 60px !important;
    height: 60px !important;
  }
  
  .slide-counter {
    font-size: 12px;
    padding: 3px 10px;
  }
}

@media (max-width: 480px) {
  #imageGallery .lSSlideOuter .lSPager.lSGallery li {
    width: 50px !important;
    height: 50px !important;
  }
}

/* Error Handling */
.lslide.error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* Loading States */
.lslide img.loading {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.lslide img.loaded {
  opacity: 1;
}

/* Keyboard Navigation Indicator */
#imageGallery:focus {
  outline: 2px solid #dc3545;
  outline-offset: 2px;
}

/* Accessibility */
.lslide img[alt] {
  font-size: 12px;
  color: #6c757d;
}

/* Performance Optimization */
.lslide img {
  will-change: transform;
  backface-visibility: hidden;
}

/* Touch Gestures */
@media (hover: none) and (pointer: coarse) {
  .lslide {
    touch-action: pan-y pinch-zoom;
  }
}

/* Product Image Container */
.product-image-container {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.product-slider-wrapper {
  position: relative;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.product-slider {
  margin: 0 !important;
}

.product-slide {
  position: relative;
  background: #fff;
}

.slide-content {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  cursor: zoom-in;
}

.slide-content.zoomed {
  cursor: zoom-out;
}

.slide-content.zoomed .slide-img {
  transform: scale(1.5);
}

.slide-img {
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.slide-img:hover {
  transform: scale(1.02);
}

/* Video Play Button */
.video-overlay {
  z-index: 10;
}

.btn-play-video {
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-play-video:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.btn-play-video i {
  color: white;
  font-size: 2rem;
}

/* Image Counter */
.image-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

.image-counter .badge {
  border-radius: 15px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Out of Stock Badge */
.out-of-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
}

/* Loading Animation */
.product-slider-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #dc3545;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-slider-wrapper.loading::before {
  opacity: 1;
}

/* Magnific Popup Video Modal */
.mfp-content.video-modal {
  max-width: 90vw;
  max-height: 90vh;
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .product-image-container {
    border-radius: 8px;
  }

  .product-slider-wrapper {
    border-radius: 8px 8px 0 0;
  }

  .btn-play-video {
    width: 60px;
    height: 60px;
  }

  .btn-play-video i {
    font-size: 1.5rem;
  }

  .out-of-stock-badge .badge {
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
  }

  .image-counter .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
} 