.npl-popup,
.npl-popup * {
    box-sizing: border-box;
}

body.npl-popup-open {
    overflow: hidden;
}

.npl-overlay {
    position: fixed;
    z-index: 999998;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
}

.npl-popup {
    --npl-max-width: 640px;
    --npl-radius: 8px;
    z-index: 999999;
    width: min(var(--npl-max-width), calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    line-height: 0;
}

.npl-popup--center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.npl-overlay .npl-popup--center {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
}

.npl-popup--bottom-right {
    position: fixed;
    right: 20px;
    bottom: 20px;
}

.npl-popup--bottom-left {
    position: fixed;
    left: 20px;
    bottom: 20px;
}

.npl-popup--top-bar,
.npl-popup--bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
}

.npl-popup--top-bar {
    top: 0;
}

.npl-popup--bottom-bar {
    bottom: 0;
}

.npl-popup__inner {
    position: relative;
    overflow: hidden;
    max-width: var(--npl-max-width);
    margin: 0 auto;
    border-radius: var(--npl-radius);
    background: transparent;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.npl-popup--top-bar .npl-popup__inner,
.npl-popup--bottom-bar .npl-popup__inner {
    width: 100%;
}

.npl-popup__link,
.npl-popup__media {
    display: block;
    width: 100%;
    line-height: 0;
}

.npl-popup img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border: 0;
}

.npl-popup__close {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.64);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    font-family: Arial, sans-serif;
    cursor: pointer;
}

.npl-popup__close:hover,
.npl-popup__close:focus {
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

@media (max-width: 782px) {
    .npl-overlay {
        padding: 12px;
    }

    .npl-popup {
        width: min(var(--npl-max-width), calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    .npl-popup--bottom-right,
    .npl-popup--bottom-left {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
}
