/* Product video in the product galleries (see js/product-video.js). */

.ahura-product-video {
    position: relative;
    display: block;
    overflow: hidden;
    background-color: #000;
    cursor: pointer;
}

.ahura-product-video::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(17, 24, 39, 0.18);
    pointer-events: none;
    transition: background-color 0.2s ease;
}

.ahura-product-video:hover::before {
    background-color: rgba(17, 24, 39, 0.26);
}

.ahura-product-video .ahura-product-video__poster {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    pointer-events: none;
}

.ahura-product-video .ahura-product-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(44px, 18%, 72px);
    height: auto;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;
    color: #fff;
    background-color: rgba(17, 24, 39, 0.72);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.ahura-product-video:hover .ahura-product-video__play {
    background-color: rgba(17, 24, 39, 0.86);
    transform: translate(-50%, -50%) scale(1.06);
}

.ahura-product-video .ahura-product-video__play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.ahura-product-video .ahura-product-video__play svg {
    display: block;
    width: 42%;
    height: 42%;
}

.ahura-product-video.is-playing {
    cursor: auto;
}

.ahura-product-video.is-playing::before,
.ahura-product-video.is-playing .ahura-product-video__play {
    display: none;
}

/* The poster keeps the slide height while the player covers it. */
.ahura-product-video.is-playing .ahura-product-video__poster {
    visibility: hidden;
}

.ahura-product-video .ahura-product-video__player {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    background-color: #000;
    object-fit: contain;
}

/* No magnifier / full-screen button while the video slide is showing: the video has its own controls. */
.woocommerce-product-gallery:has(.ahura-product-video-slide.flex-active-slide) > .woocommerce-product-gallery__trigger,
.product-images-gallery .large-slider:has(.ahura-product-video-slide.swiper-slide-active) .ah-gallery-zoom {
    display: none;
}

/* Thumbnails: theme Swiper gallery, Product Gallery widget and WooCommerce flexslider list. */
.ahura-product-video-thumb {
    position: relative;
}

.ahura-product-video-thumb .ahura-product-video-thumb__icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ahura-product-video-thumb .ahura-product-video-thumb__icon svg {
    display: block;
    box-sizing: content-box;
    width: 14px;
    height: 14px;
    padding: 7px;
    color: #fff;
    background-color: rgba(17, 24, 39, 0.72);
    border-radius: 50%;
}

/* Lightbox slide. */
.ahura-product-video-lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 44px 0;
}

.ahura-product-video.ahura-product-video--lightbox {
    width: min(92vw, calc((100vh - 120px) * 16 / 9));
    aspect-ratio: 16 / 9;
}

.ahura-product-video--lightbox .ahura-product-video__poster {
    height: 100%;
    object-fit: contain;
}
