/* ============================================
   POPUP CON IMAGEN - MÁS PEQUEÑO Y CENTRADO
   ============================================ */

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    /* 👇 CENTRADO PERFECTO */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Contenedor - MÁS PEQUEÑO */
.popup-container {
    max-width: 480px;  /* 👈 ANTES 700px, AHORA 480px */
    width: 90%;        /* 👈 AHORA 90% en lugar de 100% */
    position: relative;
    animation: popupSlide 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto;      /* 👈 CENTRADO */
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   IMAGEN - MÁS PEQUEÑA
   ============================================ */
.popup-imagen {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   BOTÓN DE CERRAR - MÁS PEQUEÑO
   ============================================ */
.popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 38px;        /* 👈 ANTES 44px, AHORA 38px */
    height: 38px;       /* 👈 ANTES 44px, AHORA 38px */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 18px;    /* 👈 ANTES 20px, AHORA 18px */
    font-weight: 300;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.popup-close:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #ffffff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

.popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ============================================
   RESPONSIVE - MÁS PEQUEÑO EN MÓVILES
   ============================================ */

/* Tablets */
@media screen and (max-width: 768px) {
    .popup-container {
        max-width: 420px;  /* 👈 MÁS PEQUEÑO */
        width: 92%;
    }
    
    .popup-close {
        top: -10px;
        right: -10px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    
    .popup-imagen {
        border-radius: 14px;
    }
}

/* Móviles */
@media screen and (max-width: 480px) {
    .popup-overlay {
        padding: 15px;
        background: rgba(0, 0, 0, 0.85);
    }
    
    .popup-container {
        max-width: 380px;  /* 👈 MÁS PEQUEÑO EN MÓVIL */
        width: 95%;
    }
    
    .popup-close {
        top: -8px;
        right: -8px;
        width: 30px;
        height: 30px;
        font-size: 14px;
        border-width: 1.5px;
    }
    
    .popup-imagen {
        border-radius: 12px;
    }
}

/* Móviles pequeños */
@media screen and (max-width: 375px) {
    .popup-overlay {
        padding: 10px;
    }
    
    .popup-container {
        max-width: 320px;  /* 👈 MÁS PEQUEÑO */
        width: 98%;
    }
    
    .popup-close {
        top: -6px;
        right: -6px;
        width: 26px;
        height: 26px;
        font-size: 12px;
        border-width: 1.5px;
    }
    
    .popup-imagen {
        border-radius: 10px;
    }
}

/* ============================================
   PREVENCIÓN DE SCROLL
   ============================================ */
body.popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
