// _modals.scss
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: $z-index-modal;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    
    &.show {
        display: block;
    }
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: $spacer * 1.75;
    pointer-events: none;
    
    @include respond-to(md) {
        max-width: 500px;
        margin: $spacer * 1.75 auto;
    }
    
    &.modal-lg {
        @include respond-to(md) {
            max-width: 800px;
        }
    }
    
    &.modal-xl {
        @include respond-to(md) {
            max-width: 1140px;
        }
    }
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: $white;
    background-clip: padding-box;
    border: 1px solid $gray-200;
    border-radius: $border-radius-lg;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: $spacer * 1.25 $spacer * 1.5;
    border-bottom: 1px solid $gray-200;
    border-top-left-radius: $border-radius-lg;
    border-top-right-radius: $border-radius-lg;
    
    .btn-close {
        background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
        padding: $spacer * 0.5;
        cursor: pointer;
        opacity: 0.5;
        transition: $transition-fast;
        
        &:hover {
            opacity: 1;
        }
    }
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: $spacer * 1.5;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: $spacer * 0.75 $spacer * 1.5;
    border-top: 1px solid $gray-200;
    border-bottom-right-radius: $border-radius-lg;
    border-bottom-left-radius: $border-radius-lg;
    
    > * {
        margin: $spacer * 0.25;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: $z-index-modal-backdrop;
    width: 100vw;
    height: 100vh;
    background-color: $black;
    
    &.show {
        opacity: 0.5;
    }
}