.ngsp-popup-wrap {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 999999;
    max-width: min(var(--ngsp-max-width, 420px), calc(100vw - 32px));
    width: auto;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
}

.ngsp-popup-wrap[hidden] {
    display: none !important;
}

.ngsp-popup-wrap.ngsp-popup-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ngsp-popup-box {
    position: relative;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
    filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.22));
}

.ngsp-popup-box img {
    display: block;
    width: auto;
    max-width: min(var(--ngsp-max-width, 420px), calc(100vw - 32px));
    max-height: min(72vh, 640px);
    height: auto;
    border-radius: 16px;
    object-fit: contain;
}

.ngsp-popup-link {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.ngsp-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    min-width: 34px;
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
    z-index: 2;
}

.ngsp-close-red {
    background: #d82128;
}

.ngsp-close-dark {
    background: #121826;
}

.ngsp-popup-close:hover,
.ngsp-popup-close:focus {
    transform: translateY(-1px);
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

.ngsp-popup-close-x {
    font-size: 18px;
    line-height: 0.8;
}

.ngsp-popup-close-text {
    line-height: 1;
}

@media (max-width: 640px) {
    .ngsp-popup-wrap {
        left: 12px;
        right: 12px;
        bottom: 14px;
        max-width: calc(100vw - 24px);
        display: flex;
        justify-content: center;
    }

    .ngsp-popup-box {
        max-width: 100%;
    }

    .ngsp-popup-box img {
        max-width: calc(100vw - 24px);
        max-height: 68vh;
        border-radius: 14px;
    }

    .ngsp-popup-close {
        top: -10px;
        right: -6px;
        min-height: 36px;
        min-width: 36px;
        padding: 8px 10px;
    }
}
