/**
 * Alecie Product Gallery Mobile Carousel Styles
 * 
 * @package Alecie_Product_Gallery_Mobile
 * @version 1.0.0
 */

/* ============================================
   MOBILE: HORIZONTAL CAROUSEL
   ============================================ */

@media (max-width: 767px) {
  
  /* Hide thumbnails */
  .product-gallery .flex-control-thumbs {
    display: none !important;
  }
  
  /* Hide zoom button */
  .product-gallery .woocommerce-product-gallery__trigger {
    display: none !important;
  }
  
  /* Main container - Full width */
  .product-gallery .woocommerce-product-gallery {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
  }
  
  /* Flexslider viewport - Enable horizontal scroll */
  .product-gallery .flex-viewport {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    height: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  /* Image wrapper - Flex row layout */
  .product-gallery .woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Each image - Full viewport width */
  .product-gallery .woocommerce-product-gallery__image {
    flex: 0 0 100vw !important;
    width: 100vw !important;
    min-width: 100vw !important;
    scroll-snap-align: start;
    margin: 0 !important;
  }
  
  .product-gallery .woocommerce-product-gallery__image a,
  .product-gallery .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Hide scrollbar but keep functionality */
  .product-gallery .flex-viewport::-webkit-scrollbar {
    display: none;
  }
  
  .product-gallery .flex-viewport {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  
  /* ============================================
     PROGRESS BAR
     ============================================ */
  
  .gallery-progress-bar {
    display: flex;
    padding: var(--space-xs);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  .progress-segment {
    height: 2px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0;
    transition: background-color 0.3s ease;
	   flex: 1; /* Esto hace que cada segmento ocupe todo el espacio disponible equitativamente */
  height: 2px; /* O el alto que prefieras */
  }
  
  .progress-segment.active {
    background-color: rgba(0, 0, 0, 0.9);
  }
	
	/* Reforzar scroll snap para suavizar en Android */
.product-gallery .flex-viewport {
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
}

.product-gallery .woocommerce-product-gallery__image {
    scroll-snap-align: start !important;
    scroll-snap-stop: always !important;
}
}
	
/* ============================================
   DESKTOP: HIDE PROGRESS BAR
   ============================================ */

@media (min-width: 768px) {
		
  .gallery-progress-bar {
    display: none;
  }

}
