/**
 * DEVAL.LT © 2016 - 2025
 *
 * NOTICE OF LICENSE
 *
 * This file is the intellectual property of DEVAL.LT. 
 * Any form of redistribution or reproduction of this code is strictly forbidden. 
 * The license provided grants permission to use this module on only one (1) store, domain, or website. 
 * For use on multiple stores, domains, or websites, additional licenses must be acquired.
 *
 * @author    DEVAL® <arnas@deval.lt>
 * @copyright DEVAL.LT © 2016 - 2025
 * @license   Commercial License
 */

/* Video thumbnail */
.deval-video-thumb {
    position: relative;
}

/* Add play icon overlay to video thumbnail */
.deval-video-thumb::after {
    content: "\f04b"; /* Font Awesome play icon */
    font-family: "FontAwesome";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Video container in large carousel */
.deval-video-container {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important; /* 1:1 aspect ratio */
    overflow: hidden !important;
}

/* Product video */
.deval-product-video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: cover !important;
}

/* Video slide in large carousel */
.deval-video-slide {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Ensure video slide is same height and dimensions as product images */
.swiper-slide.deval-video-slide {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Warehouse theme hover video */
.deval-product-hover-video {
    object-fit: cover !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2 !important; /* Higher z-index to ensure it's above the second image */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show video on hover */
.product-miniature:hover .deval-product-hover-video,
.js-product-miniature:hover .deval-product-hover-video {
    opacity: 1 !important;
}

/* Mobile styles */
@media (max-width: 768px) {
    .deval-video-thumb::after {
        font-size: 18px;
        width: 30px;
        height: 30px;
    }
}

/* Hide the second image only for products with videos */
.has-product-video img.product-thumbnail-second {
    display: none !important;
}

/* Warehouse theme specific styles */
body.warehouse-theme .deval-video-container,
.warehouse-theme .deval-video-container,
.theme-warehouse .deval-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    overflow: hidden;
}

body.warehouse-theme .deval-product-video,
.warehouse-theme .deval-product-video,
.theme-warehouse .deval-product-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
}

/* Specific fixes for Aukselis.com theme */
#product-images-large .deval-video-slide,
.js-product-images-modal .deval-video-slide {
    height: 0 !important;
    padding-bottom: 100% !important;
    display: block !important;
    overflow: hidden !important;
}

#product-images-large .deval-video-container,
.js-product-images-modal .deval-video-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
}

#product-images-large .swiper-slide-active .deval-video-container,
.js-product-images-modal .swiper-slide-active .deval-video-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Fix for video loading causing layout shifts */
#product-images-large .swiper-wrapper,
.js-product-images-modal .swiper-wrapper {
    align-items: center !important;
}

.deval-video-slide.swiper-slide {
    height: auto !important;
    min-height: 100% !important;
}

/* Ultra-specific fixed dimensions for videos */
body #main #content #product-images-large .swiper-wrapper .deval-video-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    aspect-ratio: 1/1 !important;
}

body #main #content #product-images-large .swiper-wrapper .deval-video-slide .deval-video-container {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body #main #content #product-images-large .swiper-wrapper .deval-video-slide .deval-video-container video {
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Additional styles for Aukselis.com theme to ensure proper video display */
#product #content .product-images .swiper-container .swiper-slide .deval-video-container {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    padding-bottom: 100% !important;
    height: 0 !important;
}

#product #content .product-images .swiper-container .swiper-slide .deval-video-container video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: cover !important;
} 
