/* Estilos para el Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

.popup-content {
    position: relative;
    padding: 0;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    padding: 5px;
    margin: auto;
    letter-spacing: 0;
    line-height: 1px;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.popup-image {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    width: auto;
    display: block;
    border-radius: 10px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    to {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
}

/* Efecto de salida */
.popup-overlay.closing {
    animation: fadeOut 0.3s ease-in-out forwards;
}

.popup-overlay.closing .popup-container {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95%;
        max-height: 95%;
        margin: 10px;
    }

    .popup-close {
        top: 5px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .popup-image {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .popup-container {
        max-width: 98%;
        max-height: 98%;
    }

    .popup-image {
        max-height: 60vh;
    }
}

/* Prevenir scroll del body cuando el popup está abierto */
body.popup-open {
    overflow: hidden;
}