// BUTTONS
// ––––––––––––––––––––––––––––––––––––––––––––––––––

.btn {
    display: inline-block;
    padding: 8px 20px;
    text-align: center;
    font-weight: $font-weight-base;
    background: none;
    border: none;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    appearance: none;
    transition: $transition;


    @if $radius {
        border-radius: $border-radius;
    }

    &:focus {
        outline: none;
    }

    &.btn-choose-file {
        position: relative;
        user-select: none;
        overflow: hidden;

        input {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer !important;
            z-index: 1;
        }
    }

    &.btn-loading {
        &.loader-active{
            position: relative;
            pointer-events: none !important;
            user-select: none;
            z-index: 1;
            overflow: hidden;
            .loader{
                display: inline-flex !important;
            }
        }

        .loader {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            align-items: center;
            justify-content: center;
            background: inherit;
        }
    }

}



// MAKE BUTTONS
@include makeButton;



// LARGE BUTTON
.btn-lg {
    padding: 14px 30px !important;
    font-size: 20px;
}

// SMALL BUTTON
.btn-sm {
    padding: 8px 15px !important;
    font-size: 14px;
}

// BLOCK BUTTON
.block {
    display: block !important;
    width: 100% !important;

    +.block {
        margin-top: 5px;
    }
}

// BUTTON GROUP
.btn-group {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;

    &+.btn-group {
        margin-top: 5px;
    }

    &>.dropdown>.btn,
    &>.btn {
        margin: 0 !important;
        border-radius: 0;
    }

    &>.dropdown>.btn,
    &>.btn {
        position: relative;

        &:hover,
        &:focus,
        &:active,
        &.active {
            z-index: 1;
        }
    }

    &>.dropdown:first-child>.btn,
    &>.btn:first-child {
        @if $radius {
            border-radius: 4px 0px 0px 4px;
        }
    }

    &>.dropdown:last-child>.btn,
    &>.btn:last-child {
        @if $radius {
            border-radius: 0px 4px 4px 0px;
        }
    }

    &.stacked-group {
        display: inline-flex;
        flex-direction: column;


        &>.dropdown>.btn,
        &>.btn {
            margin: 0 !important;
            border-radius: 0;
            flex: 0 1 auto;
            width: 100%;
        }


        &>.dropdown:first-child>.btn,
        &>.btn:first-child {
            @if $radius {
                border-radius: 4px 4px 0px 0px;
            }
        }

        &>.dropdown:last-child>.btn,
        &>.btn:last-child {
            @if $radius {
                border-radius: 0px 0 4px 4px;
            }
        }

    }
}