/**
 * Estilos para el módulo cdproductdescargables
 * - Lista de documentos/enlaces en pestaña Descargables
 * - Thumbnail de YouTube en galería de producto
 * - Modal de vídeo YouTube
 */

/* === Lista de documentos y enlaces === */

.cdproductdescargables-list {
    list-style: none;
    padding: 0 !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cdproductdescargables-item {
    padding: 0;
}

.cdproductdescargables-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    color: #414651;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.cdproductdescargables-link:hover {
    color: #181d27;
    text-decoration: none;
}

.cdproductdescargables-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.cdproductdescargables-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === YouTube thumbnail en galería === */

.cdvideo-thumb {
    position: relative;
    cursor: pointer;
}

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

.cdvideo-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.cdvideo-thumb:hover .cdvideo-thumb-play svg path:first-child {
    fill: #f00;
    fill-opacity: 1;
}

/* === Modal de vídeo YouTube === */

.cdvideo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.cdvideo-modal--open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cdvideo-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.cdvideo-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
}

.cdvideo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    z-index: 1;
}

.cdvideo-modal-close:hover {
    opacity: 0.8;
}

.cdvideo-modal-body {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.cdvideo-modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 576px) {
    .cdproductdescargables-link {
        font-size: 14px;
    }

    .cdvideo-modal-content {
        width: 95%;
    }

    .cdvideo-modal-close {
        top: -36px;
        font-size: 28px;
    }
}
