/* Product Video Gallery for WooCommerce — pvg-gallery.css */

/* ===== WRAPPER ===== */
.pvg-gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    width: 100%;
    position: relative;
}

/* ===== VERTICAL LAYOUT (thumbs on left) ===== */
.pvg-vertical {
    flex-direction: row;
    align-items: flex-start;
}

.pvg-vertical .pvg-thumb-slider {
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
    order: -1;
    height: 450px;
    max-height: 450px;
}

.pvg-vertical .pvg-main-slider {
    flex: 1;
}

/* ===== MAIN SLIDER ===== */
.pvg-main-slider {
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
    position: relative;
}

.pvg-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
}

.pvg-figure {
    margin: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

.pvg-figure > a,
.pvg-figure > a.pvg-glightbox {
    display: block;
    width: 100%;
    height: 100%;
}

.pvg-figure .pvg-video-link {
    position: relative;
    display: block;
    line-height: 0;
}

.pvg-figure .pvg-video-link .pvg-main-image {
    display: block;
    width: 100%;
    height: auto;
}

.pvg-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    color: var(--pvg-icon-color, #fff);
}

.pvg-play-overlay .pvg-play-icon {
    width: 70px;
    height: 70px;
    display: block;
}

.pvg-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.pvg-zoom:hover {
    transform: scale(1.05);
}

/* ===== VIDEO SLIDE ===== */
.pvg-video-slide {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.pvg-video-thumb-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pvg-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--pvg-icon-color, #fff);
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 3;
}

.pvg-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.9;
}

.pvg-play-icon {
    width: 70px;
    height: 70px;
    color: var(--pvg-icon-color, #fff);
    drop-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* ===== VIDEO IFRAME ===== */
.pvg-video-iframe-wrapper {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #000;
}

.pvg-video-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pvg-hidden {
    display: none !important;
}

/* ===== ARROWS ===== */
.pvg-arrow {
    --swiper-navigation-color: var(--pvg-arrow-color, #fff);
}

.pvg-main-slider .swiper-button-prev,
.pvg-main-slider .swiper-button-next,
.pvg-gallery-wrapper .swiper-button-prev,
.pvg-gallery-wrapper .swiper-button-next {
    display: none !important;
}

/* ===== THUMBNAIL SLIDER ===== */
.pvg-thumb-slider {
    width: 100%;
    overflow: hidden;
    padding: 4px 0;
}

.pvg-thumb-slide {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    opacity: 0.65;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    aspect-ratio: 1 / 1;
}

.pvg-thumb-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pvg-thumb-slide.swiper-slide-thumb-active {
    border-color: #2271b1;
    opacity: 1;
}

.pvg-thumb-slide:hover {
    opacity: 1;
}

/* ===== THUMB VIDEO WRAPPER ===== */
.pvg-thumb-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.pvg-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvg-play-icon-sm {
    width: 24px;
    height: 24px;
}

/* ===== LOCAL VIDEO SLIDE ===== */
.pvg-local-video-wrapper {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvg-local-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pvg-thumb-no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.pvg-video-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ===== HIDE THUMBS ===== */
.pvg-hide-thumbs .pvg-thumb-slider {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .pvg-vertical {
        flex-direction: column;
    }

    .pvg-vertical .pvg-thumb-slider {
        width: 100%;
        height: auto;
        max-height: none;
        order: 1;
    }

    .pvg-play-icon {
        width: 52px;
        height: 52px;
    }
}

/* ===== VIDEO THUMB WRAP ===== */
.pvg-video-thumb-wrap {
    position: relative;
    width: 100%;
    display: block;
    line-height: 0;
}

.pvg-video-thumb-wrap .pvg-video-thumb-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pvg-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    color: var(--pvg-icon-color, #fff);
}

.pvg-play-overlay .pvg-play-icon {
    width: 70px;
    height: 70px;
    display: block;
}

/* ===== FLATSOME THEME COMPATIBILITY ===== */

/* Reset Flatsome's image column constraints */
.single-product .product-image-wrap .pvg-gallery-wrapper,
.single-product .woocommerce-product-gallery.pvg-gallery-wrapper {
    max-width: 100%;
    width: 100%;
    float: none;
}

/* Flatsome local video wrapper */
.pvg-local-video-wrap {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pvg-local-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Video no-thumb placeholder */
.pvg-video-no-thumb,
.pvg-thumb-no-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ===== VIDEO THUMB LAYER ===== */
.pvg-video-thumb-layer {
    position: relative;
    width: 100%;
    height: 100%;
}


/* ===== VIDEO THUMBNAIL LIGHTBOX TRIGGER ===== */
.pvg-thumb-lightbox-trigger {
    cursor: zoom-in;
}
