body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.fatherPopup {
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    /* Fijo para que cubra toda la pantalla */
    top: 0;
    left: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.SonPopup {
    width: 90%;
    max-width: 50%;
    /* Máximo tamaño en pantallas grandes */
    display: flex;
    justify-content: end;
    align-items: start;
    flex-direction: row-reverse;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    /* Evita que la imagen se salga */
    z-index: 999;
    top: 6vh;

}

.SonPopup img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    z-index: 999;
    top: 7rem;

}

.close {
    cursor: pointer;
    padding: 0.2rem;
    z-index: 999;
    background: #fff;
}


@media (max-width: 480px) {
    .SonPopup {
        width: 95%;
        /* ocupa casi todo el ancho */
        max-width: none;
        /* elimina el límite de 600px */
        height: auto;
        /* ajusta altura según imagen */
        flex-direction: column;
        /* si quieres que la X quede arriba */
        align-items: end;
        z-index: 999;
    }


    .close {
        position: absolute;
        top: 0.5vw;
        right: 1vw;
        background-color: transparent;
        z-index: 999;
    }

}

@media (min-width: 481px) and (max-width: 768px) {
    .SonPopup {
        width: 95%;
        max-width: none;
        height: auto;
        z-index: 999;
    }
}

/* ----------- 🖥️ Escritorio ----------- */
@media (min-width: 769px) {
    .SonPopup {
        width: 80%;
        z-index: 999;
        max-width: 50%;
    }
}

/* ✅ Corrige altura en iOS Safari */
.fatherPopup {
    height: 100dvh;
    /* usa unidades dinámicas modernas */
}

/* Fallback para navegadores sin soporte de dvh */
@supports not (height: 100dvh) {
    .fatherPopup {
        height: 100vh;
    }

    .SonPopup {
        top: 6vh;
    }
}

/* Previene rebotes raros al bloquear el scroll */
html,
body {
    overscroll-behavior: none;
}