
/* ========================================
   AE GO GALAXY - POPUP RESPONSIVE
======================================== */

.galaxy-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
}

.galaxy-popup.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.galaxy-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 20, .86);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.galaxy-popup-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    padding: 10px;
    border: 1px solid rgba(80, 190, 255, .65);
    border-radius: 18px;
    background: linear-gradient(145deg, #101c35, #070b19 75%);
    box-shadow:
        0 0 25px rgba(0, 160, 255, .20),
        0 0 80px rgba(91, 57, 255, .15);
    transform: translateY(18px) scale(.97);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
    outline: none;
}

.galaxy-popup.is-visible .galaxy-popup-panel {
    transform: translateY(0) scale(1);
}

.galaxy-popup-close {
    position: absolute;
    z-index: 3;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(3, 9, 24, .88);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 190, 255, .2);
    transition: background .2s ease, transform .2s ease;
}

.galaxy-popup-close:hover {
    background: #087cf0;
    transform: rotate(90deg);
}

.galaxy-popup-close:focus-visible {
    outline: 2px solid #65dcff;
    outline-offset: 3px;
}

.galaxy-popup-image-wrap {
    overflow: hidden;
    border-radius: 11px;
    background: #050b18;
}

.galaxy-popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 125px);
    object-fit: contain;
    object-position: center;
}

.galaxy-popup-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 12px 4px 4px;
    color: #9bb8db;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-align: center;
}

.galaxy-popup-dot {
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #45eaff;
    box-shadow: 0 0 10px #45eaff;
}

/* Móviles */
@media (max-width: 600px) {
    .galaxy-popup {
        padding: 14px;
        padding-top: max(14px, env(safe-area-inset-top));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .galaxy-popup-panel {
        width: 100%;
        max-height: calc(100dvh - 28px);
        padding: 7px;
        border-radius: 14px;
    }

    .galaxy-popup-image {
        max-height: calc(100dvh - 115px);
    }

    .galaxy-popup-close {
        top: 11px;
        right: 11px;
        width: 38px;
        height: 38px;
        font-size: 27px;
    }

    .galaxy-popup-caption {
        margin-top: 10px;
        font-size: 9px;
        letter-spacing: 1px;
    }
}

/* Pantallas pequeñas en horizontal */
@media (max-height: 500px) {
    .galaxy-popup-panel {
        max-height: calc(100dvh - 20px);
    }

    .galaxy-popup-image {
        max-height: calc(100dvh - 90px);
    }
}

/* Respeta la preferencia de reducir animaciones */
@media (prefers-reduced-motion: reduce) {
    .galaxy-popup,
    .galaxy-popup-panel,
    .galaxy-popup-close {
        transition: none;
    }
}
