/* Catalog: the video becomes a full-card overlay only while it is active. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.products .product {
    position: relative;
}

.woocommerce ul.products li.product .nexticoatx-product-media,
.woocommerce-page ul.products li.product .nexticoatx-product-media,
.products .product .nexticoatx-product-media {
    position: relative;
}

.nexticoatx-loop-video {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: block;
    overflow: hidden;
    border-radius: inherit;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.nexticoatx-product-video {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: block;
    overflow: hidden;
    border-radius: inherit;
    background: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

.nexticoatx-loop-video.is-active {
    opacity: 1;
    visibility: visible;
}

.nexticoatx-product-video.is-active {
    opacity: 1;
    visibility: visible;
}

.nexticoatx-loop-video__media {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    background: #fff;
}

.nexticoatx-product-video__media {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    background: #fff;
}

.nexticoatx-loop-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .58);
    transform: translate(-50%, -50%);
    transition: opacity .15s ease;
}

.nexticoatx-loop-video__play svg {
    width: 25px;
    height: 25px;
    margin-left: 3px;
    fill: currentColor;
}

.nexticoatx-loop-video.is-playing .nexticoatx-loop-video__play {
    opacity: 0;
}

.nexticoatx-product-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .58);
    transform: translate(-50%, -50%);
    transition: opacity .15s ease;
}

.nexticoatx-product-video__play svg {
    width: 25px;
    height: 25px;
    margin-left: 3px;
    fill: currentColor;
}

/* Single product: keep the native WooCommerce gallery and add one video slide. */
.woocommerce-product-gallery .nexticoatx-single-video-slide {
    width: 100%;
}

.nexticoatx-single-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.nexticoatx-single-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.woocommerce-product-gallery .flex-control-thumbs img[src=""] {
    background: #f2f2f2;
}

@media (hover: none), (pointer: coarse) {
    .woocommerce ul.products li.product .nexticoatx-product-media,
    .woocommerce-page ul.products li.product .nexticoatx-product-media,
    .products .product .nexticoatx-product-media {
        touch-action: manipulation;
    }

    .nexticoatx-loop-video,
    .nexticoatx-product-video {
        inset: 0;
        width: auto;
        height: auto;
        aspect-ratio: auto;
        border-radius: inherit;
        pointer-events: auto;
    }

    .nexticoatx-loop-video.is-touch-hold,
    .nexticoatx-product-video.is-touch-hold {
        inset: 0;
        width: auto;
        height: auto;
        aspect-ratio: auto;
        border-radius: inherit;
    }
}

@media (max-width: 1024px) {
    .woocommerce ul.products li.product .nexticoatx-product-media,
    .woocommerce-page ul.products li.product .nexticoatx-product-media,
    .products .product .nexticoatx-product-media {
        touch-action: manipulation;
    }

    .nexticoatx-loop-video,
    .nexticoatx-product-video {
        inset: 0;
        width: auto;
        height: auto;
        aspect-ratio: auto;
        border-radius: inherit;
    }

    .nexticoatx-loop-video.is-touch-hold,
    .nexticoatx-product-video.is-touch-hold {
        inset: 0;
        width: auto;
        height: auto;
        aspect-ratio: auto;
        border-radius: inherit;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nexticoatx-loop-video {
        transition: none;
    }
}
