body.noscroll{
    overflow: hidden;
}

.popup-overlay{
    position: fixed;
    top: 200%;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, .5);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
}

@keyframes popup {
    0% {
        opacity: 0;
        top: 200%;
        visibility: hidden;
    }
    1%{
        opacity: 0;
        top: 0;
        transform: scale(0);
        visibility: visible;
    }
    50%{
        transform: scale(1);
    }
    100% {
        opacity: 1;
        top: 0;
        visibility: visible;
    }
}

@keyframes popupHide {
    0% {
        opacity: 1;
        top: 0;
        visibility: visible;
    }
    99%{
        opacity: 0;
        top: 0;
        visibility: visible;
    }
    100% {
        opacity: 0;
        top: 200%;
        visibility: hidden;
    }
}

.popup-overlay.show{
    animation: popup 1s;
    animation-fill-mode: forwards;
}

.popup-overlay.hide{
    animation: popupHide 1s;
    animation-fill-mode: forwards;
}

.popup{
    display: none;
    position: relative;
    padding: 2rem;
    width: max-content;
    min-width: 30vw;
    max-width: 80vw;
    background-color: var(--wrapper-bg);
    color: var(--wrapper-text);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);   
}

.popup.show{
    display: block;
}

.popup-close{
    position: absolute;
    top: -.5rem;
    right: -.5rem;
    cursor: pointer;
    background: #fff;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px var(--brand) solid;
}

.popup-close span{
    position: absolute;
    display: block;
    top: calc(50% - 2px);
    left: 10%;
    width: 80%;
    height: 4px;
    border-radius: 2px;
    background: var(--brand);
    transition: 0.3s;
}

.popup-close span:nth-of-type(1){
    transform: rotate(45deg);
}

.popup-close span:nth-of-type(2){
    transform: rotate(-45deg);
}

.popup-close:hover span:nth-of-type(1){
    transform: rotate(180deg) scale(0.8);
}

.popup-close:hover span:nth-of-type(2){
    transform: rotate(-180deg) scale(0.8);
}

.popup-content h2{
    margin: 0 0 1rem;
}

.popup-content-inner{
    max-height: 80vh;
    overflow-y: auto;
}

@media (max-width: 620px) {
    .popup{
        max-width: 90vw;
        padding: 1rem;
    }
}