.modal-container {
    margin: 0 auto;
    position: relative;
    --modal-width: 70vw;
}

body:has(.modal-container #modal-toggle:checked) {
    overflow: hidden;
    height: 100vh;
    overscroll-behavior: none;
    touch-action: none;
}

.modal-container button {
    display: block;
    margin: 0 auto;
    width: 160px;
    height: 50px;
    line-height: 50px;

    font-size: 22px;
    border: 0;
    border-radius: 3px;
    box-shadow: 0 5px 5px -5px #333;
    transition: background 0.3s ease-in;
}

.modal-container .modal-backdrop {
    height: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.2s ease-in;
}

.modal-container #modal-toggle {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.modal-container #modal-toggle:hover~button {
    background: #1E824C;
}

.modal-container #modal-toggle:checked {
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    opacity: 0;
}

.modal-container #modal-toggle:checked~.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 1;
}

.modal-container #modal-toggle:checked~.modal-backdrop .modal-content {
    background-color: #fff;
    max-width: var(--modal-width);
    width: 100%;
    padding: 2rem;
    position: absolute;
    left: calc(50% - ( var(--modal-width) / 2));
    top: 12%;
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    z-index: 999;
    pointer-events: auto;
    cursor: auto;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.6);
}

.modal-container #modal-toggle:checked~.modal-backdrop .modal-content .modal-scrollable {
    max-height: 100%;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.modal-container #modal-toggle:checked~.modal-backdrop .modal-content .modal-close.button {
    position: static;
    align-self: flex-end;
    margin-top: 1rem;
    padding: 0.5rem 2rem;
    background: #ec6726;
    color: #fff;
    border-radius: 2px;
    font-size: 1rem;
    font-weight: normal;
    text-align: center;
}

.modal-container #modal-toggle:checked~.modal-backdrop .modal-content .modal-close.button:hover {
    color: #fff;
    background: #ec6726;
}

@media screen and (min-width: 1920px) {
    .modal-container {
        --modal-width: 50vw;
    }
}

@media screen and (max-width:991px) {
    .modal-container {
        --modal-width: 90vw;
    }
}

@media screen and (max-width:767px) {
    .modal-container {
        --modal-width: 90vw;
    }

    body:has(.modal-container #modal-toggle:checked) .mobile-nav-section {
        z-index: 10;
    }

    body:has(.modal-container #modal-toggle:checked) .nav-control {
        pointer-events: none;
    }

    body:has(.modal-container #modal-toggle:checked) .modal-container #modal-toggle:checked ~ .modal-backdrop {
        z-index: 200;
    }
}

@media screen and (max-width:479px) {
    .modal-container {
        --modal-width: 90vw;
    }

    .modal-container #modal-toggle:checked~.modal-backdrop .modal-content {
        top: 8%;
        max-height: 84vh;
    }
}


