.product-videos-tab-wrapper {
    padding: 1rem 0;
}

.product-videos-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-videos-tab-item {
    position: relative;
    width: calc(33.333% - 14px); /* 3 columnas con gap */
    min-width: 250px; /* Ancho mínimo para responsividad */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff; /* Fondo blanco para el contenedor */
    display: flex;
    flex-direction: column; /* Disponer elementos en columna */
}

.product-videos-tab-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Miniatura del video */
.product-videos-tab-item .local-video-preview-tab,
.product-videos-tab-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* Mantiene la proporción 16:9 */
    object-fit: cover;
    display: block;
    flex-shrink: 0; /* Evitar que se encoja */
}

.product-videos-tab-item .local-video-preview-tab video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: none;
}

/* Overlay del video */
.product-videos-tab-item .video-overlay-tab {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%; /* Cubrir toda la miniatura */
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-videos-tab-item:hover .video-overlay-tab {
    opacity: 1;
}

.product-videos-tab-item .video-overlay-tab i {
    color: white;
    font-size: 40px;
    opacity: 0.9;
}

/* --- INICIO: Información del video (Título y Descripción) --- */
/* Contenedor de la información del video */
.video-info-tab {
    padding: 10px;
    background-color: #fff;
    flex-grow: 1; /* Ocupar espacio restante */
    display: flex;
    flex-direction: column;
    min-height: 60px; /* Altura mínima para acomodar texto */
}

/* Título del video */
.video-title-tab {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0 0 5px 0;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limitar a 2 líneas */
    -webkit-box-orient: vertical;
    flex-grow: 0; /* No crecer más allá del contenido */
}

/* Descripción del video */
.video-description-tab {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limitar a 3 líneas */
    -webkit-box-orient: vertical;
    flex-grow: 1; /* Crecer para llenar el espacio disponible */
}
/* --- FIN: Información del video (Título y Descripción) --- */


/* Popup de reproducción */
#product-videos-tab-player-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.product-videos-tab-player-content {
    width: 95%;
    max-width: 1000px;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.product-videos-tab-player-content .video-container-tab-player {
    width: 100%;
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9; /* Usar aspect-ratio moderno */
}

.product-videos-tab-player-content .video-container-tab-player iframe,
.product-videos-tab-player-content .video-container-tab-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#close-product-videos-tab-player {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.2s ease, transform 0.1s ease;
}

#close-product-videos-tab-player:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Responsividad */
@media (max-width: 992px) {
    .product-videos-tab-item {
        width: calc(50% - 10px); /* 2 columnas en tablets */
    }
}

@media (max-width: 576px) {
    .product-videos-tab-item {
        width: 100%; /* 1 columna en móviles */
    }
    
    .product-videos-tab-item .video-overlay-tab i {
        font-size: 30px;
    }
    
    /* Ajustar tamaños de fuente en móviles */
    .video-title-tab {
        font-size: 0.85rem;
    }
    
    .video-description-tab {
        font-size: 0.75rem;
    }
}