/* General popup styling */

.popup {
    width: 100%;
    max-height: 100vh;
    background-color: #fff;
    border-radius: 15px 15px 0px 0px;
    position: fixed;
    top: 100vh;
    left: 0;
    right: 0;
    bottom: -100%;
    transition: all 1s;
    z-index: 20;
    text-align: center;
    overflow-y: auto;
}

.popup.active {
    top: 60px;
    bottom: 0;
    transition: all 1s;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.popup-header {
    position: sticky;
    top: 0px;
    left: 0px;
    right: 0px;
    background-color: #fff;
    padding: 10px 0px;
    z-index: 10;
}

.popup-header .sub-headline {
    padding: 0px 20px;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
}

.popup {
    scrollbar-color: #C9CBCE transparent;
    scrollbar-width: thin;
}

/* Legacy rules for older Chrome, Safari, and Edge engines */

.popup::-webkit-scrollbar {
    width: 10px; /* Essential to specify width for webkit scrollbars to show up */
  }
  

.popup::-webkit-scrollbar-track {
    background: transparent; /* Track color */
    border-radius: 5px;
}
  
.popup::-webkit-scrollbar-thumb {
    background: #C9CBCE; /* Thumb color */
    border-radius: 5px;   /* Optional: rounds the corners */
}


@media (min-width: 600px) {

    .popup {
        display: none;
        border-radius: 10px;
        max-width: 500px;
        max-height: calc(100vh - 40px);
        margin: auto;
        position: fixed;
        top: auto;
        bottom: auto; 
        transform: translateY(-50%);
    }

    .popup.active {
        display: block;
        top: 50%;
        bottom: auto;
        z-index: 12;
    }

    body:has(.popup.active) #dim-background {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #000;
        opacity: 0.7;
        z-index: 11;
    }

    .close-popup {
        cursor: pointer;
    }

    .close-popup:hover {
        color: #9D0910;
    }

}

@media (min-width: 1000px) {

    body:has(.desktop-nav-open) .popup {
        transform: translateX(127.5px) translateY(-50%); /* 127.5px is half of the width of the desktop nav when open (255px) */
    }

    body:has(.desktop-nav-closed) .popup {
        transform: translateX(27px) translateY(-50%); /* 27px is half of the width of the desktop nav when closed (54px) */
    }
}