/* woocommerce single product template */
.woocommerce-product-gallery-video {
    display: block;
    width: 100%;
    height: 0;
    /* Square unless scripts.js found the photos' proportions (--mpvw-ratio-pad). */
    padding: 0 0 var(--mpvw-ratio-pad, 100%);
    margin: 0;
    position: relative;
}

/*  when flexslider disabled */
.woocommerce-product-gallery__video {
    width: 25%;
    display: inline-block;
}

.woocommerce-product-gallery-video__player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.woocommerce-product-gallery-video__player > video {
    display: block;
    width: 100%;
    height: 100%;
}

/* popup for video */
.mpvw-thumbnail {
    position: relative;
    cursor: pointer;
}

/* Source for the WooCommerce lightbox only. Themes often set `video { display: block }`,
   which beats the [hidden] attribute, so hide it explicitly. */
.mpvw-lightbox-source {
    display: none !important;
}

/* The poster slide takes the photos' proportions, so the gallery keeps its height. */
.woocommerce-product-gallery__image--mpvw .mpvw-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--mpvw-ratio, auto);
    object-fit: cover;
}

/* play badge on the video thumbnail in flexslider nav (class set by JS,
   so it follows the video wherever it sits — start or end) */
.flex-control-thumbs li.mpvw-video-thumb {
    position: relative;
}

.flex-control-thumbs li.mpvw-video-thumb:before,
.mpvw-thumbnail:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 1.3rem solid #fff;
    border-top: 1rem solid transparent;
    border-bottom: 1rem solid transparent;
    z-index: 1;
    pointer-events: none;
}

.mpvw-video-container {
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1);
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.mpvw-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.mpvw-video-container button.mpvw-video-container__button {
    background-color: transparent;
    background-position: 0 -2.75rem;
    background-repeat: no-repeat;
    background-size: 16.5rem 5.5rem;
    width: 2.75rem;
    height: 2.75rem;
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    border: none;
    cursor: pointer;
    z-index: 10000;
}

.video-js {
    background: transparent;
}


/* Product loop (shop / archive): a square aspect box (matching the default
   WooCommerce product thumbnail) holding the original image with the video
   overlaid on top. Self-contained so it doesn't depend on theme/block
   container heights. */
.mpvw-loop-video {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.mpvw-loop-video img,
.mpvw-loop-video__el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
