/* Product Video Styling */

/* Control z-index of video element itself */
video.product-thumbnail-video {
    transform: none !important;
    position: relative !important;
    isolation: isolate;
    z-index: -1 !important; /* Lower value to ensure it stays below header elements */
}

/* For single product page video */
.product-video {
    position: relative;
    z-index: 5;
}

/* Override any theme styling that might be affecting z-index stacking */
.product-loop-video-container video,
.product-video-wrapper video {
    z-index: 5 !important;
}

/* Main product video styles */
.product-video-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.product-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
    cursor: pointer;
}

/* Product loop video styles */
.product-loop-video-container {
    position: relative;
    width: 100%;
z-index: 1;
    overflow: hidden;
}

.product-thumbnail-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Hide play indicators */
.video-indicator {
    display: none !important;
}

/* Mobile-specific fixes to ensure videos display above other elements */
@media (max-width: 767px) {
    .product-loop-video-container {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .product-thumbnail-video {
        z-index: 9999 !important;
    }
    
    /* Fix for Shoptimizer theme gallery images */
    .has-product-video .gallery-image,
    .has-product-video .woocommerce-image__wrapper .gallery-image {
        position: static !important;
        z-index: 1 !important;
    }
    
    /* Force our video to stay on top */
    .has-product-video .product-loop-video-container {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    /* Hide Shoptimizer's hover images */
    .has-product-video .loop-swap-image,
    .has-product-video .loop-image-hover {
        display: none !important;
    }
}