// App Buttons.
.btn-app {
    @include border-radius(0 !important);
    position: relative;
    padding: 15px 5px;
    min-width: 80px;

    > .fa,
    > .glyphicon {
        @include font-size(20);
        margin: 0 auto;
        display: block;
    }

    > .badge {
        @include absolute(top -3px right -10px);
        font-size: 0.835em;
        font-weight: 400;
        z-index: 5;
    }

    @include rtl {
        > .badge { right: auto; left: -10px; }
    }
}

.btn-group > .btn-app > .badge {
    @include border-radius(0 0 0 4px !important);
    top: 0;
    right: 0;
    @include rtl {
        right: auto;
        left: 0;
        @include border-radius(0 0 4px 0 !important);
    }
}

.btn-app + .btn-app,
.btn-group + .btn-app,
.btn-app + .btn-group {
    margin-left: 0.625rem;
    @include rtl { margin-left: 0; margin-right: 0.625rem; }
}

.btn-group-xs > .btn,
.btn-xs {
    @include font-size(12);
    @include border-radius(3px);
    padding: 1px 5px;
    line-height: 1.5;
}

.btn-group-sm > .btn,
.form-control-sm, .btn-sm {
    @include font-size(12);
    vertical-align: top;
}

.btn-group > .btn-icon,
.btn-icon {
    position: relative;
    text-align: left;
    vertical-align: baseline;
    padding-left: 47px;

    > [class^="fa"] {
        @include absolute(top 0 left 0);
        @include border-left-radius(4px);
        border-right: 1px solid transparent;
        font-size: inherit;
        height: 100%;
        display: block;
        line-height: 1;
        text-align: center;
        width: 35px;

        &::before {
            @include absolute(top 50% left 50%);
            @include transform(translate(-50%, -50%));
            display: block;
            width: 100%;
            text-align: center;
        }
    }

    &.btn-xs {
        padding-left: 25px;
        > [class^="fa"] {
            @include border-left-radius(3px);
            width: 20px;
        }
    }
    &.btn-sm {
        padding-left: 34px;
        > [class^="fa"] {
            @include border-left-radius(3.2px);
            width: 26px;
        }
    }
    &.btn-lg {
        padding-left: 61px;
        > [class^="fa"] {
            @include border-left-radius(4.8px);
            width: 45px;
        }
    }

    @include rtl {
        padding-left: 0.75rem;
        padding-right: 47px;

        > [class^="fa"] {
            @include border-left-radius(0);
            @include border-right-radius(4px);
            left: auto;
            right: 0;
            border-right: none;
            border-left: 1px solid transparent;

            &::before {
                @include absolute(top 50% left 50%);
                @include transform(translate(-50%, -50%));
                display: block;
                width: 100%;
                text-align: center;
            }
        }

        &.btn-xs {
            padding-left: 0.3125rem;
            padding-right: 25px;
            > [class^="fa"] {
                @include border-left-radius(0);
                @include border-right-radius(3px);
            }
        }
        &.btn-sm {
            padding-left: 0.5rem;
            padding-right: 34px;
            > [class^="fa"] {
                @include border-left-radius(0);
                @include border-right-radius(3.2px);
            }
        }
        &.btn-lg {
            padding-left: 1rem;
            padding-right: 61px;
            > [class^="fa"] {
                @include border-left-radius(0);
                @include border-right-radius(4.8px);
            }
        }
    }
}

// Button groups with icon buttons.
.btn-group {
    > .btn-icon > [class^="fa"] { @include border-radius(0!important); }

    &.btn-group-xs > .btn-icon {
        padding-left: 25px;
        > [class^="fa"] { width: 20px; }
    }

    &.btn-group-sm > .btn-icon {
        padding-left: 34px;
        > [class^="fa"] { width: 26px; }
    }

    &.btn-group-lg > .btn-icon {
        padding-left: 61px;
        > [class^="fa"] { width: 45px; }
    }

    @include rtl {
        &.btn-group-xs > .btn-icon {
            padding-left: 0.3125rem;
            padding-right: 25px;
            > [class^="fa"] { width: 20px; }
        }

        &.btn-group-sm > .btn-icon {
            padding-left: 0.5rem;
            padding-right: 34px;
            > [class^="fa"] { width: 26px; }
        }

        &.btn-group-lg > .btn-icon {
            padding-left: 1rem;
            padding-right: 61px;
            > [class^="fa"] { width: 45px; }
        }
    }
}

select.form-control-sm:not([size]):not([multiple]),
.input-group-sm > select.form-control:not([size]):not([multiple]),
.input-group-sm > .input-group-prepend > select.input-group-text:not([size]):not([multiple]),
.input-group-sm > .input-group-append > select.input-group-text:not([size]):not([multiple]),
.input-group-sm > .input-group-prepend > select.btn:not([size]):not([multiple]),
.input-group-sm > .input-group-append > select.btn:not([size]):not([multiple]) { height: auto }
