.c-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: $level--modal;
    transition: .4s ease-out;
    animation: show-modal .4s;
    
    &:not(.is-open) {
        opacity: 0;
        pointer-events: none;
    }

    @media (min-width: $screen--md) {
        flexbox();
        align-items: center;
        justify-content: center;
    }

    &__backdrop {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,.5);
    }

    &__dialog {
        $base-width--sm = (100% / 12) * 4;
        $base-width--lg = (100% / 12) * 8;

        @extend $popover;
        position: relative;
        z-index: $level--modal + 1;
        width: 100%;
        height: 100%;
        overflow: auto;
        border-radius: 0;

        scrollbar();

        @media (min-width: $screen--md) {
            width: $base-width--sm;
            min-width: 400px;
            max-width: calc(100% - 40px);
            height: auto;
            max-height: calc(100% - 40px);
            margin: 20px;
            padding: 30px;
            border-radius: 4px;

            &--lg {
                width: $base-width--lg;
            }
        }

        &--frameless {
            position: absolute;
            top: 50%;
            transform: translate(0, -50%);
            height: auto;
            max-height: 100%;
            padding: 4px;
        }
    }

    &__header {
        position: relative;
        margin-bottom: $vertical--element-lg;
        padding-top: 60px;

        @media (min-width: $screen--md) {
            flexbox();
            align-items: center;
            padding: 0;
        }
    }

    &__close {
        position: absolute;
        top: 0;
        right: 0;

        @media (min-width: $screen--md) {
            position: inherit;
            order: 1;
            margin-left: 10px;
        }

        &--frameless {
            position: absolute;
            top: 15px;
            right: 15px;
            color: #fff;
            z-index: 1;
        }
    }

    &__title {
        margin: 0;
        font-size: 1.75em;
        line-height: 1.15;

        @media (min-width: $screen--md) {
            flex: 1 0 1px;
            text-ellipsis();
        }
    }

    &__action {
        margin-top: $vertical--element-lg;

        .c-btn {
            min-width: 140px;

            @media (min-width: $screen--md) {
                & + .c-btn {
                    margin-left: 10px;
                }
            }
        }
    }
}

@keyframes show-modal {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}