/**
 * WC Product Video Gallery - Public Styles
 * Fixed: Removed flex display that broke Flickity cell measurement
 */

/* Video slide container - matches Flatsome's expected structure */
.wcpvg-video-slide {
    position: relative;
}

.wcpvg-video-container {
    position: relative;
    width: 100%;
    background: #000;
    /* Block layout - NO flex (flex breaks Flickity cell measurement) */
}

/* Poster wrapper - simple block layout */
.wcpvg-poster-wrapper {
    position: relative;
    width: 100%;
    cursor: pointer;
    /* Block layout - NO flex (flex breaks Flickity cell measurement) */
}

.wcpvg-poster-image {
    display: block;
    width: 100%;
    height: auto;
    /* Poster image with explicit width/height attributes establishes slide dimensions */
}

/* Play button - Luxury white circular design */
.wcpvg-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    cursor: pointer;
    display: flex;  /* OK here - it's on the button, not the cell */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

.wcpvg-play-button:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.wcpvg-play-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 6px 30px rgba(0, 0, 0, 0.2);
}

.wcpvg-play-button svg {
    width: 32px;
    height: 32px;
    margin-left: 4px; /* Optical centering for play icon */
}

/* Video wrapper - absolutely positioned overlay on poster */
.wcpvg-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    /* NO flex - video element will fill container */
}

.wcpvg-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading spinner */
.wcpvg-loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcpvg-spin 0.8s linear infinite;
}

.wcpvg-loading .wcpvg-loading-spinner {
    display: block;
}

.wcpvg-loading .wcpvg-video {
    opacity: 0;
}

@keyframes wcpvg-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Thumbnail video badge - ensure proper positioning in thumbnail grid */
.product-thumbnails .col,
.wcpvg-thumb-col {
    position: relative;
}

.wcpvg-thumb-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 5;
}

.wcpvg-thumb-badge svg {
    width: 12px;
    height: 12px;
    color: #333;
    margin-left: 1px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .wcpvg-play-button {
        width: 60px;
        height: 60px;
    }

    .wcpvg-play-button svg {
        width: 24px;
        height: 24px;
        margin-left: 3px;
    }

    .wcpvg-thumb-badge {
        width: 20px;
        height: 20px;
        bottom: 2px;
        right: 2px;
    }

    .wcpvg-thumb-badge svg {
        width: 10px;
        height: 10px;
    }
}

/* Ensure thumbnails have relative positioning for badge */
.wcgs-thumb,
.wcgs-thumbnails .swiper-slide {
    position: relative;
}
