/* ============================================
   Product Video Support Styles
   ============================================ */

/* Main Video Container */
.product-main-video {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: #000;
    border-radius: 8px;
}

.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Thumbnails in Gallery */
.media-thumb {
    position: relative;
    display: inline-block;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.media-thumb:hover {
    transform: scale(1.05);
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: auto;
    display: block;
}

/* Play Button Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #fff;
    opacity: 0.9;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.media-thumb:hover .play-overlay {
    opacity: 1;
}

.video-thumb .play-overlay i {
    color: #fff;
}

.youtube-thumb .play-overlay i {
    color: #ff0000;
}

/* Admin Video Preview */
.video-preview-container,
.youtube-preview-container {
    position: relative;
}

.video-preview-container video {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
}

.video-preview-container .badge,
.youtube-preview-container .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    padding: 5px 10px;
}

/* Product Images Thumb Styling */
.product-images-thumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-images-thumb a,
.product-images-thumb .media-thumb {
    flex: 0 0 calc(25% - 10px);
    max-width: calc(25% - 10px);
}

.product-images-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.product-images-thumb a:hover img,
.product-images-thumb .media-thumb:hover img {
    border-color: #007bff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .product-main-video {
        max-height: 400px;
    }

    .play-overlay {
        font-size: 36px;
    }

    .product-images-thumb a,
    .product-images-thumb .media-thumb {
        flex: 0 0 calc(33.333% - 10px);
        max-width: calc(33.333% - 10px);
    }
}

@media (max-width: 480px) {
    .product-main-video {
        max-height: 300px;
    }

    .play-overlay {
        font-size: 28px;
    }

    .product-images-thumb a,
    .product-images-thumb .media-thumb {
        flex: 0 0 calc(33% - 10px);
        max-width: calc(33% - 10px);
    }
}