/* WC Product Video Gallery - Frontend Styles */

.wcpvg-gallery {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
    user-select: none;
}

/* ---- Main slides container ---- */
.wcpvg-main-slides {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

/* ---- Slide transition animation ---- */
.wcpvg-slide {
    display: none;
    width: 100%;
    animation: wcpvg-fadein 0.3s ease;
}

.wcpvg-slide.wcpvg-active {
    display: block;
}

@keyframes wcpvg-fadein {
    from { opacity: 0; transform: translateX(18px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- Product image with zoom ---- */
.wcpvg-img-container {
    overflow: hidden;
    cursor: zoom-in;
    background: #fff;
    line-height: 0;
}

.wcpvg-img-container.wcpvg-zoomed {
    cursor: zoom-out;
}

.wcpvg-slide .wcpvg-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #fff;
    transition: transform 0.35s ease;
    transform-origin: 50% 50%;
    pointer-events: none;
}

/* Hover: gentle zoom preview */
.wcpvg-img-container:not(.wcpvg-zoomed):hover .wcpvg-img {
    transform: scale(1.06);
}

/* Clicked: deep zoom using JS-set transform-origin */
.wcpvg-img-container.wcpvg-zoomed .wcpvg-img {
    transform: scale(2);
    transition: transform 0.2s ease;
}

/* ---- iFrame (YouTube) ---- */
.wcpvg-iframe-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.wcpvg-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Uploaded video ---- */
.wcpvg-video-wrap {
    position: relative;
    background: #000;
}

.wcpvg-video-wrap video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
}

/* ---- Navigation arrows ---- */
.wcpvg-arrow {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcpvg-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}

.wcpvg-prev { left: 8px; }
.wcpvg-next { right: 8px; }

/* ---- Thumbnails ---- */
.wcpvg-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-top: 8px;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.wcpvg-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    background: #eee;
    transition: border-color 0.15s;
}

.wcpvg-thumb.wcpvg-active {
    border-color: #0073aa;
}

.wcpvg-thumb:hover {
    border-color: #aaa;
}

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

/* Video thumbnail overlay */
.wcpvg-thumb-video {
    width: 100%;
    height: 100%;
    position: relative;
}

.wcpvg-thumb-video .wcpvg-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
}

.wcpvg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 2;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .wcpvg-gallery {
        max-width: 100%;
    }
    .wcpvg-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}
