.snpvg-enhanced-gallery,
.snpvg-porto-gallery {
    opacity: 1 !important;
}

.snpvg-video-slide,
.snpvg-porto-video-slide {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #12323f 0%, #0a1018 60%, #080d13 100%);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.35);
}

.snpvg-video-slide video,
.snpvg-porto-video-slide video,
.snpvg-youtube-iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.snpvg-fit-theme-size video,
.snpvg-fit-theme-size .snpvg-youtube-iframe {
    object-fit: contain;
}

.snpvg-responsive-embed {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.snpvg-responsive-embed::after,
.snpvg-video-slide::after,
.snpvg-porto-video-slide::after {
    content: "";
    position: absolute;
    inset: auto -40% -45% auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.28) 0%, rgba(245, 158, 11, 0) 70%);
    pointer-events: none;
}

.snpvg-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-shadow: 0 6px 12px rgba(0, 0, 0, 0.42);
}

.snpvg-play-icon i {
    font-size: var(--snpvg-play-button-size, 28px);
    color: var(--snpvg-play-icon-color, #2271b1);
    line-height: 1;
    transform: translateZ(0);
}

body.snpvg-preview-style-filled .snpvg-play-icon i {
    width: calc(var(--snpvg-play-button-size, 28px) + 14px);
    height: calc(var(--snpvg-play-button-size, 28px) + 14px);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--snpvg-play-button-bg, #0f766e) 78%, transparent);
}

body.snpvg-preview-style-outlined .snpvg-play-icon i {
    width: calc(var(--snpvg-play-button-size, 28px) + 14px);
    height: calc(var(--snpvg-play-button-size, 28px) + 14px);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--snpvg-play-button-bg, #0f766e);
    background: rgba(0, 0, 0, 0.2);
}

body.snpvg-preview-style-plain .snpvg-play-icon i {
    background: transparent;
    border: 0;
}

.snpvg-video-thumbnails-wrap {
    margin-top: 14px;
}

.snpvg-video-thumbnails {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 8px;
}

.snpvg-video-thumb {
    position: relative;
    cursor: pointer;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.snpvg-video-thumb:hover {
    transform: translateY(-2px);
    border-color: #0f766e;
    box-shadow: 0 14px 24px rgba(15, 118, 110, 0.2);
}

.snpvg-video-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.woocommerce-product-gallery .flex-control-thumbs li.snpvg-video-thumb-li {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Video slides in standard WooCommerce FlexSlider gallery */
.woocommerce-product-gallery__image.snpvg-video-slide {
    width: 100%;
}

.woocommerce-product-gallery__image.snpvg-video-slide .video-js {
    width: 100% !important;
    max-width: 100%;
    background: #000;
}

/* Keep video at the same aspect ratio as the gallery images to prevent height jumps */
.woocommerce-product-gallery__image.snpvg-video-slide .video-js .vjs-tech {
    object-fit: contain;
}

body.snpvg-modal-open {
    overflow: hidden;
}

.snpvg-fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    overflow: hidden;
}

.snpvg-fullscreen-modal .snpvg-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snpvg-fullscreen-modal .snpvg-modal-content img,
.snpvg-fullscreen-modal .snpvg-modal-content video,
.snpvg-fullscreen-modal .snpvg-modal-content iframe {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.snpvg-fullscreen-modal .snpvg-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--snpvg-fs-nav-bg, #0f766e);
    border: 2px solid var(--snpvg-fs-nav-border, #ffffff);
    color: var(--snpvg-fs-nav-color, #ffffff);
    opacity: 0.92;
    font-size: 32px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10001;
    border-radius: 10px;
    transition: all 0.3s ease;
    line-height: 1;
}

.snpvg-fullscreen-modal .snpvg-modal-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.03);
}

body.snpvg-fs-shape-circle .snpvg-fullscreen-modal .snpvg-modal-nav {
    border-radius: 999px;
}

body.snpvg-fs-shape-square .snpvg-fullscreen-modal .snpvg-modal-nav {
    border-radius: 0;
}

body.snpvg-fs-shape-rounded .snpvg-fullscreen-modal .snpvg-modal-nav {
    border-radius: 10px;
}

body.snpvg-fs-nav-shadow .snpvg-fullscreen-modal .snpvg-modal-nav {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.snpvg-fullscreen-modal .snpvg-modal-prev {
    left: 20px;
}

.snpvg-fullscreen-modal .snpvg-modal-next {
    right: 20px;
}

.snpvg-fullscreen-modal .snpvg-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
    line-height: 1;
}

.snpvg-fullscreen-modal .snpvg-modal-close:hover {
    color: #ccc;
}

.snpvg-fullscreen-modal .snpvg-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.snpvg-modal-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: snpvg-spin 0.7s linear infinite;
}

@keyframes snpvg-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .snpvg-fullscreen-modal .snpvg-modal-nav {
        padding: 8px 12px;
        font-size: 24px;
        min-width: 44px;
        min-height: 44px;
    }

    .snpvg-fullscreen-modal .snpvg-modal-prev {
        left: 10px;
    }

    .snpvg-fullscreen-modal .snpvg-modal-next {
        right: 10px;
    }

    .snpvg-fullscreen-modal .snpvg-modal-close {
        top: 10px;
        right: 10px;
        font-size: 32px;
    }
}

.ct-product-gallery .flexy-pills li .ct-media-container,
.ct-product-gallery-container .flexy-pills li .ct-media-container {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.ct-product-gallery .flexy-pills li .ct-media-container img,
.ct-product-gallery-container .flexy-pills li .ct-media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ct-product-gallery .flexy-pills li.snpvg-flexy-video-thumb .snpvg-play-icon,
.ct-product-gallery-container .flexy-pills li.snpvg-flexy-video-thumb .snpvg-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ct-product-gallery .flexy-items > .flexy-item .ct-media-container,
.woocommerce-product-gallery__image a {
    cursor: zoom-in;
}

/* Mobile: cap portrait/tall video height so the gallery doesn't expand beyond the
   viewport and push thumbnails/content off-screen. Uses dvh with vh fallback. */
@media (max-width: 767px) {
    body.snpvg-fit-mode-width_auto .snpvg-video-flexy-item .ct-media-container,
    body.snpvg-fit-mode-height_auto .snpvg-video-flexy-item .ct-media-container {
        max-height: 75vh !important;
        max-height: 75dvh !important;
    }

    body.snpvg-fit-mode-width_auto .snpvg-video-flexy-item .video-js,
    body.snpvg-fit-mode-width_auto .snpvg-video-flexy-item .vjs-tech,
    body.snpvg-fit-mode-width_auto .snpvg-video-flexy-item video,
    body.snpvg-fit-mode-height_auto .snpvg-video-flexy-item .video-js,
    body.snpvg-fit-mode-height_auto .snpvg-video-flexy-item .vjs-tech,
    body.snpvg-fit-mode-height_auto .snpvg-video-flexy-item video {
        max-height: 75vh !important;
        max-height: 75dvh !important;
    }
}


