/**
 * Stockie Video Gallery Styles
 */

.woocommerce-product-gallery .video-enabled {
    position: relative;
    cursor: pointer;
}

.woocommerce-product-gallery .video-enabled .gimg {
    transition: opacity 0.3s ease;
}

.woocommerce-product-gallery .video-enabled:hover .gimg {
    opacity: 0.8;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: transform 0.3s ease;
}

.video-wrap:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.video-iframe-container iframe,
.video-iframe-container video {
    width: 100%;
    height: 100%;
    border: none;
}

.woocommerce-product-gallery .video-slide {
    height: 100%;
}

.woocommerce-product-gallery .video-slide .image-wrap {
    height: 100%;
}

.woocommerce-product-gallery__trigger {
    z-index: 10;
}

@media (max-width: 768px) {
    .woocommerce-product-gallery .video-wrap::before {
        padding-top: 133.33%;
    }
    
    .video-play-button svg {
        width: 50px;
        height: 50px;
    }
}

.woo_c-product-image-slider .video-slide {
    margin: 0;
}

.woo_c-product-image-slider .owl-nav {
    z-index: 10;
}

body.single-product .video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-lightbox.active {
    display: flex;
}

.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    aspect-ratio: 16/9;
}

.video-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-lightbox iframe,
.video-lightbox video {
    width: 100%;
    height: 100%;
}

/* Block theme's hover effect for products with checkbox */
.product-content.show-last-on-hover.product-hover-2:hover .slider-images a:nth-child(1) img,
.product-content.show-last-on-hover.product-hover-2:hover .slider a:nth-child(1) img {
    opacity: 1 !important; /* Keep first image visible, don't fade it */
}

.product-content.show-last-on-hover.product-hover-2 .slider-images a:nth-child(2) img,
.product-content.show-last-on-hover.product-hover-2 .slider a:nth-child(2) img {
    opacity: 0 !important; /* Keep second image hidden always */
    z-index: -1 !important;
}

/* Ensure injected image is always on top */
.product-content.show-last-on-hover .injected-last-image {
    z-index: 15 !important;
}

