/* Main media overlay stays exactly within the product image area. */
.product-main-image {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.product-main-video {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}
.product-main-video[hidden] { display: none !important; }
.product-main-video iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
}
.nova-video-thumbnail .thumbnail-video-button {
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 80px;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #f1f1f1;
}
.nova-video-thumb-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 80px;
    width: 100%;
    color: #111;
    font-size: 11px;
    font-weight: 600;
}
.nova-video-brand-icon {
    display: block;
    width: 44px;
    max-width: 75%;
    height: auto;
}
.nova-video-label { font-size: 10px; text-transform: uppercase; }
.nova-video-thumbnail.active { outline: 1px solid #111; outline-offset: -1px; }
@media (max-width: 767px) {
    .product-main-video,
    .product-main-video iframe { width: 100%; max-width: 100%; }
}


/* Make video tiles immediately recognizable as playable videos. */
.nova-video-thumbnail .thumbnail-video-button {
    position: relative;
    overflow: hidden;
    min-height: 80px;
    background: #171717;
}
.nova-video-preview {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 80px;
    background: #171717;
}
.nova-video-preview-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 80px;
    object-fit: cover;
    transition: transform .2s ease;
}
.nova-video-thumbnail .thumbnail-video-button:hover .nova-video-preview-image {
    transform: scale(1.05);
}
.nova-video-preview-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #161616, #333);
}
.nova-video-preview-no-image > .nova-video-brand-icon {
    width: 54%;
    max-width: 72px;
    opacity: .95;
}
.nova-video-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 25px;
    transform: translate(-50%, -50%);
    border-radius: 7px;
    background: #ff0033;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding-left: 2px;
    box-shadow: 0 1px 6px rgba(0,0,0,.45);
}
.nova-video-provider-badge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 5px 6px;
    background: rgba(0,0,0,.82);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .35px;
    line-height: 1;
}
.nova-video-provider-badge .nova-video-brand-icon {
    width: 18px;
    height: 13px;
    max-width: 18px;
}
.nova-video-thumbnail.active .nova-video-play-badge {
    background: #cc0029;
}
.nova-video-thumbnail.active {
    outline: 2px solid #111;
    outline-offset: -2px;
}


/* v1.3.7: neutral video thumbnail — no YouTube/Vimeo name or provider logo. */
.nova-video-provider-badge {
    display: none !important;
}
.nova-video-thumbnail .nova-video-play-badge {
    width: 36px;
    height: 27px;
    border-radius: 7px;
    background: rgba(0, 0, 0, .88);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.nova-video-preview {
    background: #222;
}
.nova-video-preview-image {
    object-fit: cover;
}


/* v1.3.8: use the supplied generic play icon image for both video providers. */
.nova-video-thumbnail .nova-video-play-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none;
    overflow: visible;
}
.nova-video-thumbnail .nova-video-play-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: .96;
}
.nova-video-thumbnail .nova-video-play-badge::before,
.nova-video-thumbnail .nova-video-play-badge::after {
    content: none !important;
}


/* v1.3.9: supplied icon has a transparent background and sits over either provider's preview. */
.nova-video-thumbnail .nova-video-play-badge {
    z-index: 3;
    width: 42px;
    height: 42px;
    background: transparent !important;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    pointer-events: none;
}
.nova-video-thumbnail .nova-video-play-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: transparent !important;
    opacity: 1;
}
.nova-video-thumbnail .nova-video-preview-no-image > .nova-video-brand-icon {
    display: none !important;
}
.nova-video-thumbnail .nova-video-provider-badge {
    display: none !important;
}


/* v1.4.0: ensure the remotely hosted supplied play icon is visible over video previews. */
.nova-video-thumbnail .nova-video-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: none;
}
.nova-video-thumbnail .nova-video-play-image {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: transparent !important;
}
.nova-video-provider-badge { display: none !important; }


/* v1.4.3: reliable full-frame video fit inside the main product media area. */
.product-main-image,
#main-product-image {
    position: relative;
}
.product-main-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    aspect-ratio: auto !important;
    z-index: 20 !important;
    background: #000 !important;
}
.product-main-video iframe {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border: 0 !important;
    object-fit: contain !important;
}


/* v1.4.4: keep theme gallery arrows visible and clickable above the video iframe. */
.product-main-image,
.product-main-image .woocommerce-product-gallery,
.product-main-image .woocommerce-product-gallery__wrapper,
#main-product-image {
    position: relative;
}
.product-main-video {
    z-index: 2 !important;
    pointer-events: auto !important;
}
.product-main-image .slick-arrow,
.product-main-image .slick-prev,
.product-main-image .slick-next,
.product-main-image .swiper-button-prev,
.product-main-image .swiper-button-next,
.product-main-image .flex-prev,
.product-main-image .flex-next,
.product-main-image .owl-prev,
.product-main-image .owl-next,
.product-main-image [aria-label*="previous" i],
.product-main-image [aria-label*="prev" i],
.product-main-image [aria-label*="next" i],
#main-product-image .slick-arrow,
#main-product-image .slick-prev,
#main-product-image .slick-next,
#main-product-image .swiper-button-prev,
#main-product-image .swiper-button-next,
#main-product-image .flex-prev,
#main-product-image .flex-next,
#main-product-image .owl-prev,
#main-product-image .owl-next {
    position: relative;
    z-index: 30 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
.product-main-video iframe {
    z-index: 1 !important;
}


/* v1.4.5: unified media layer. Keep native gallery arrows visible above video. */
.product-main-video {
    z-index: 10 !important;
}
.product-main-video iframe {
    z-index: 1 !important;
}
.product-main-image > button,
.product-main-image > a,
.product-main-image .gallery-arrow,
.product-main-image .gallery-nav,
.product-main-image .slick-arrow,
.product-main-image .swiper-button-prev,
.product-main-image .swiper-button-next,
.woocommerce-product-gallery .slick-arrow,
.woocommerce-product-gallery .swiper-button-prev,
.woocommerce-product-gallery .swiper-button-next {
    z-index: 50 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}


/* v1.4.6: selected thumbnail and main media navigation stay synchronized. */
#product-main-video {
    pointer-events: auto !important;
    z-index: 10 !important;
}
#product-main-video iframe {
    pointer-events: auto !important;
    z-index: 1 !important;
}
.product-main-image .slick-arrow,
.product-main-image .slick-prev,
.product-main-image .slick-next,
.product-main-image .swiper-button-prev,
.product-main-image .swiper-button-next,
.product-main-image .flex-prev,
.product-main-image .flex-next,
.product-main-image .owl-prev,
.product-main-image .owl-next,
.woocommerce-product-gallery .slick-arrow,
.woocommerce-product-gallery .slick-prev,
.woocommerce-product-gallery .slick-next,
.woocommerce-product-gallery .swiper-button-prev,
.woocommerce-product-gallery .swiper-button-next,
.woocommerce-product-gallery .flex-prev,
.woocommerce-product-gallery .flex-next {
    position: absolute !important;
    z-index: 60 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}


/* v1.4.7: keep the active thumbnail visibly in sync with the main gallery. */
#product-thumbnails {
    scroll-behavior: smooth;
}
#product-thumbnails .thumbnail-item.active {
    outline: 0px solid #111 !important;
    outline-offset: -1px;
}
#product-thumbnails .nova-video-thumbnail.active {
    outline: 2px solid #111 !important;
    outline-offset: -2px;
}
