.btn {
    @include transition(color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease);

    border-radius: $border-radius-base;
    font-size: 11px;
    font-weight: $font-weight-bold;
    letter-spacing: 0.5px;
    padding: 8px 15px 7px;
    text-transform: uppercase;
    line-height: normal;

    &:not(.btn-link) {
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.13);
    }

    &:not(.disabled):hover {
        box-shadow: 1px 5px 10px $gray-lighter;
    }

    &.btn-link:hover {
        box-shadow: none;
    }

    &[class*="btn-"]:focus,
    &[class*="btn-"]:active,
    &[class*="btn-"].active,
    &[disabled]:hover,
    &.disabled:hover {
        box-shadow: none;
        outline: none;
    }

    //Caret Icon
    span.caret {
        background: url(/images/redesign/btn-caret.svg) no-repeat center center;
        background-size: 100%;
        transform: rotate(180deg);
        border: none;
        width: 12px;
        height: 12px;
        margin: -2px 0 0 4px;

        &.back {
            margin: -2px 4px 0 0;
            transform: rotate(-90deg);
        }

    }

    &.btn-primary {
        background-color: $fox;
        border-color: $fox;
        box-shadow: none;

        &:hover {
            background-color: $fox;
            box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.2);
        }

        &:focus,
        &.focus,
        &:active,
        &.active {
            background-color: $fox;
            border-color: $btn-primary-active-shadow;
            box-shadow: inset 0 0 5px 0 rgba(0, 0, 0, 0.2), inset 0 0 1px 0 rgba(0, 0, 0, 0.4);
        }

        &.disabled,
        &[disabled],
        &.disabled:hover,
        &[disabled]:hover,
        &.disabled:focus ,
        &[disabled]:focus {
            border-color: $fox;
            box-shadow: none;
            pointer-events: none;
            opacity: 0.5;
        }

    }

    &.btn-default {
        @include background(linear-gradient(to bottom, rgba(255, 255, 255, 0.5), $mouse), linear-gradient($white, $white));
        box-shadow: none;
        border: 1px solid $koala;
        color: $rhino;

        &:hover {
            @include background(linear-gradient(to bottom, rgba(255, 255, 255, 0.5), $gray-lightest), linear-gradient($white, $white));
            box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
            border-color: $timberwolf;
            color: $gorilla;
        }

        &:active,
        &.active {
            background: $mouse;
            box-shadow: inset 0 1px 1px 0 rgba(0, 0, 0, 0.2), inset 0 0 5px 0 rgba(0, 0, 0, 0.2);
            border-color: $timberwolf;
            color: $gorilla;
        }
        
        &.disabled,
        &[disabled],
        &.disabled:hover,
        &[disabled]:hover,
        &.disabled:focus ,
        &[disabled]:focus {
            background: $mouse;
            box-shadow: none;
            border-color: $gray-lightest;
            color: $timberwolf;
        }

    }

    &.btn-danger {
        background-color: $btn-default-bg;
        border-color: $btn-default-border;
        color: $brand-danger;

        &:focus {
            background-color: $btn-default-bg;
            border-color: $btn-default-border;
            color: $brand-danger;
        }

        &:hover,
        &:focus:hover,
        &:active,
        &.active {
            color: $white;
            background-color: $btn-danger-hover-bg;
            border-color: $btn-danger-hover-border;
        }

        &[disabled]:hover,
        &[disabled]:active {
            background-color: $btn-default-bg;
            border-color: $btn-default-border;
            color: $brand-danger;
            pointer-events: none;
        }

    }

    &.btn-link {
        background-color: $transparent;
        box-shadow: none;
        border-color: $transparent;
        color: $btn-link;

        &:hover,
        &:focus {
            color: $btn-link-hover;
            text-decoration: underline;
        }

    }

    &.btn {
        @include btn-glyphicon(10px);

        &-sm {
            @include btn-glyphicon(9px);

            font-size: 10px;
            padding: 4px 10px;

            span.caret {
                background-size: 90%;
            }

        }

        &-lg {
            @include btn-glyphicon(11px);

            padding: 13px 20px 11px;
            font-size: 12px;
        }

    }

}

.btn-group-lg {

    > .btn, 
    .btn-lg {
        border-radius: 3px;
    }

}

/*** Animated Loading Buttons ****/
.loadingbtn {
    flex: 0 0 200px;
    position: relative;

    .loadingbtn-outer {
        align-items: center;
        display: flex;
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        visibility: visible;
        width: 100%;

        .loadingbtn-dots {
            display: flex;
            flex-wrap: wrap;
            height: 16px;
            justify-content: center;
            overflow: hidden;
            padding-left: 12px;
            padding-right: 12px;
            visibility: hidden;
            width: 100%;

            .loadingbtn-loader-dot {
                -webkit-animation: loadingbutton-scale-dot 1.2s ease-out infinite;
                animation: loadingbutton-scale-dot 1.2s ease-out infinite;                
                border-radius: 50%;
                height: 16px;
                margin: 0 4px;
                opacity: .75;
                -webkit-transform: scale(0.5);
                transform: scale(0.5);
                visibility: inherit;
                width: 16px;

                &:nth-of-type(2) {
                    -webkit-animation-delay: .2s;
                    animation-delay: .2s;
                }

                &:nth-of-type(3) {
                    -webkit-animation-delay: .3s;
                    animation-delay: .3s;
                }

                &:nth-of-type(4) {
                    -webkit-animation-delay: .4s;
                    animation-delay: .4s;
                }

                &:nth-of-type(5) {
                    -webkit-animation-delay: .5s;
                    animation-delay: .5s;
                }

            }

        }

    }

    &.btn-default.loader-active,
    &.btn-primary.loader-active,
    &.btn-danger.loader-active {
        box-shadow: none;
        opacity: .65;
        cursor: not-allowed;
    }

    &.btn-default.loader-active,
    &.btn-default.loader-active:focus,
    &.btn-default.loader-active:hover {
        background-color: $btn-default-bg;
        border-color: $btn-default-border;

        .loadingbtn-loader-dot {
            background: $blue-deep;
        }

    }

    &.btn-primary.loader-active,
    &.btn-primary.loader-active:focus,
    &.btn-primary.loader-active:hover {
        background-color: $brand-primary;
        border-color: $btn-primary-border;

        .loadingbtn-loader-dot {
            background: $white;
        }

    }

    &.btn-danger.loader-active,
    &.btn-danger.loader-active:focus,
    &.btn-danger.loader-active:hover {
        background-color: $btn-danger-hover-bg;
        border-color: $btn-danger-hover-border;

        .loadingbtn-loader-dot {
            background: $white;
        }

    }

    &.loader-active .loadingbtn-dots,
    .loadingbtn-txt {
        visibility: visible;
    }

    &.loader-active .loadingbtn-txt,
    .loadingbtn-dots {
        visibility: hidden;
    }

}

@keyframes loadingbutton-scale-dot {

    0% {
        transform: scale(0.5);
    }

    25% {
        transform: scale(1);
    }

    75% {
        transform: scale(0.5);
    }

    100% {
        transform: scale(0.5);
    }

}
