 /* Reset básico */
 * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
}

/* Estructura del popup - Versión móvil primero */
#popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    z-index: 1000;
    text-align: center;
    padding: 5px 5px;
    margin-top: 64px;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

/* Contenedor de imagen optimizado para móviles */
#image-container {
    width: 100%;
    margin: auto ;
    max-height: 66vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup img {
    max-width: 90%;
    max-height: 90vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 2px;
    padding: -5px;
    
}

/* Texto responsivo */
#ppop {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 15px 0;
    line-height: 1.4;
    padding: 0 5px;
}

/* Botón optimizado para móviles */
.btn {
    display: block;
    width: 90%;
    max-width: 280px;
    margin: 0 auto;
    padding: 12px 5px;
    background-color: #4a6fa5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

/* Media Queries para diferentes tamaños */
@media (min-width: 768px) {
    .popup {
        padding: 40px 25px 25px;
    }
    
    .image-container {
        max-height: 400px;
    }
    
    .popup img {
        max-height: 400px;
    }
    
    #ppop {
        font-size: 17px;
        margin: 20px 0;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .popup {
        width: 98%;
        padding: 35px 10px 15px;
        max-height: 95vh;
    }
    
    .image-container {
        max-height: 65vh;
    }
    
    .popup img {
        max-height: 65vh;
    }
    
    #ppop {
        font-size: 15px;
    }
    
    .btn {
        width: 95%;
        padding: 10px 5px;
    }
}

@media (max-width: 360px) {
    #ppop {
        font-size: 14px;
    }
    
    .btn {
        font-size: 14px;
    }
}