$z_index_modal: 9000;
$z_index_overlay: 8000;
$font_size: 1rem;

.has-modal {
    position: fixed; // mobile?
    overflow: hidden; // goodbay scroll
    width: 100%; // force width 100% to avoid breaks behind the cortains
}

.modal {
    overflow: auto;

    z-index: $z_index_overlay;

    position: fixed;
    top: 0;
    left: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 20px 0;

    background: rgba(0, 0, 0, .9);

    text-align: left;

    &.modal--close-on-backdrop {
        cursor: not-allowed;
    }

    .modal__wrapper {
        padding: 1.5rem;
        background: white;
        font-size: $font_size;
        cursor: default; // modal--close-on-backdrop

        .modal__header {
            padding-bottom: 1.5rem;

            .modal__title {
                margin: 0;
            }
        }

        .modal__footer {
            margin-top: 35px;

            &.modal__buttons-right {
                text-align: right;
            }
        }
    }

    .modal__close {
        position: absolute;
        top: -2px;
        right: 8px;

        color: white;
        line-height: 1;
        font-size: 36px;
        font-style: initial;
        text-shadow: 0 0 1px black;

        cursor: pointer;
    }
}

/*
 *
 * MEDIA QUERIES
 */

@media screen and (max-width: 639px) {
    .modal {
        align-items: flex-start;
        padding: 0;

        .modal__wrapper {
            width: 100% !important;
            min-height: 100%;

            .modal__header {
                padding-right: 2rem;
            }
        }

        .modal__close {
            color: #444;
        }
    }
}
