/* ---- MPC Popup Carousel v5.1 Styles - Con Multimedia y Links ---- */

.mpc-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center; z-index: 99999;
    padding: 20px; box-sizing: border-box;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s 0.3s linear;
}
.mpc-overlay.visible { opacity: 1; visibility: visible; transition-delay: 0s; }

.mpc-popup {
    position: relative; background: #fff; border-radius: 5px;
    width: 100%; max-width: 900px; max-height: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(0.9); transition: transform 0.3s ease;
    display: flex; flex-direction: column;
    padding: 0;
}
.mpc-overlay.visible .mpc-popup { transform: scale(1); }

/* --- BARRA DE TÍTULO --- */
.mpc-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    flex-shrink: 0;
}
.mpc-popup-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding-right: 20px;
}

/* --- BOTÓN CERRAR --- */
.mpc-close {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #008B8B;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.mpc-close:hover {
    background-color: #005f5f;
}

/* --- CONTENIDO DEL POPUP --- */
.mpc-popup-content {
    padding: 20px;
    overflow: hidden;
    flex-grow: 1;
}
.mpc-carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.mpc-carousel-images {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

/* --- ESTILOS PARA IMÁGENES --- */
.mpc-carousel-item img {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border-radius: 4px;
}

/* --- ENLACES EN IMÁGENES --- */
.mpc-image-link {
    display: inline-block;
    cursor: pointer;
    position: relative;
}

.mpc-image-link img {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.mpc-image-link:hover img {
    transform: scale(1.02);
    opacity: 0.9;
}

.mpc-image-link::after {
    content: '🔗';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mpc-image-link:hover::after {
    opacity: 1;
}

/* --- TOOLTIPS NATIVOS MEJORADOS --- */
.mpc-image-link[title],
.mpc-has-tooltip[title] {
    position: relative;
}

/* --- ESTILOS PARA PDFs --- */
.mpc-pdf-viewer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mpc-pdf-viewer iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}
.mpc-pdf-download {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}
.mpc-pdf-download:hover {
    background: #135e96;
}

/* --- ESTILOS PARA VIDEOS --- */
.mpc-video-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.mpc-video-wrapper iframe,
.mpc-video-wrapper video {
    max-width: 100%;
    border-radius: 4px;
}

/* --- FLECHAS --- */
.mpc-prev, .mpc-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4); color: white;
    border-radius: 50%; width: 40px; height: 40px;
    font-size: 20px;
    z-index: 10; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s;
}
.mpc-prev:hover, .mpc-next:hover { background: rgba(0, 0, 0, 0.7); }
.mpc-prev { left: 15px; }
.mpc-next { right: 15px; }

/* --- CONTADOR --- */
.mpc-counter {
    position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, 0.6);
    color: white; padding: 4px 10px; border-radius: 15px; font-size: 13px; z-index: 10;
}

/* --- PUNTOS --- */
.mpc-dots {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; padding: 10px; z-index: 10;
}
.mpc-dot {
    width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0,0,0,0.2); margin: 0 4px; cursor: pointer; transition: all 0.3s;
}
.mpc-dot:hover { background-color: #fff; }
.mpc-dot.active { background-color: #fff; transform: scale(1.2); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .mpc-popup {
        max-width: 95%;
    }
    .mpc-pdf-viewer iframe {
        height: 400px;
    }
    .mpc-video-wrapper iframe,
    .mpc-video-wrapper video {
        height: 300px !important;
    }
    .mpc-carousel-item img {
        max-height: calc(100vh - 200px);
    }
    
    /* En móviles, mostrar siempre el icono de enlace */
    .mpc-image-link::after {
        opacity: 0.8;
    }
}