.product-video-gallery {
    margin: 2em 0;
    padding: 0;
    background: transparent;
    clear: both;
    width: 100%;
}

.product-video-gallery h2 {
    margin: 0 0 1em 0;
    padding: 0;
    font-size: 1.2em;
    color: #333;
    text-align: left;
    clear: both;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 1em;
    clear: both;
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: #f7f7f7;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 200px; /* Ensure minimum height on mobile */
}

.video-thumbnail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-thumbnail:hover .video-placeholder::before {
    opacity: 1;
}

.play-icon {
    font-size: 2.5em;
    color: #fff;
    opacity: 0.9;
    transition: all 0.2s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 2;
    background: rgba(0,0,0,0.4);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail:hover .play-icon {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(0,0,0,0.6);
}

.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.video-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal video {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: #000;
}

.close-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .video-thumbnail {
        min-height: 180px;
    }
    
    .video-modal {
        padding: 10px;
    }
    
    .video-modal video {
        max-height: 85vh;
        width: 100%; /* Force full width on mobile */
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .play-icon {
        font-size: 2em;
        width: 50px;
        height: 50px;
    }
}

/* Fix for theme compatibility */
.woocommerce-product-gallery {
    opacity: 1 !important;
} 