/* Buttons */
.btn,
.button,
input.submit,
input[type="submit"] {
    @include transition (all .1s);
    cursor: pointer;
}

button {
    border: 1px solid #ccc;
}

.button {
    display: inline-block;
    text-align: center;
    font-weight: 400;
    vertical-align: middle;
    touch-action: manipulation;
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    &:disabled {
        cursor: default;
    }
}

.btn-default {
    &.btn {
        background: #fff;
        box-shadow: none !important;
        &[disabled], &[disabled]:hover {
            background: #fff;
            border-color: rgba(0, 0, 0, .09);
        }
        &:hover {
            background-color: #f2f2f2;
            border-color: rgba(0, 0, 0, .06);
        }
    }
    &.btn-borders {
        background: none;
    }
}

/* Outline */
.btn-outline {
    border-width: 2px;
}

/* Icons    */
.btn-icon i {
    margin-#{$right}: 10px;
}

.btn-icon-right i {
    margin-#{$right}: 0;
    margin-#{$left}: 10px;
}

@each $state in $states {
    .btn-#{nth($state,1)} {
        border-color: #{nth($state,2)};
        background-color: #{nth($state,2)};
        border-color: #{nth($state,2)} #{nth($state,2)} darken(nth($state,2), 10%);
        color: #{nth($state,3)};

        &:hover {
            border-color: lighten(nth($state,2), 5%) lighten(nth($state,2), 5%) darken(nth($state,2), 5%);
            background-color: darken(nth($state,2), 5%);
            color: #{nth($state,3)};
        }

        &:active,
        &:focus {
            border-color: darken(nth($state,2), 5%);
            background-color: darken(nth($state,2), 5%);
            color: #{nth($state,3)};
        }

        &.dropdown-toggle {
            border-#{$left}-color: darken(nth($state,2), 5%);
        }

        &[disabled] {
            border-color: darken(nth($state,2), 20%);
            background-color: darken(nth($state,2), 20%);
            color: #CCC;
        }
    }
}

/* Border Buttons */
.btn-borders {
    border-width: 2px;
}

@each $state in $states {
    .btn-borders {
        &.btn-#{nth($state,1)} {
            background: transparent;
            border-color: #{nth($state,2)};
            color: #{nth($state,2)};
            &:hover, &:focus {
                background-color: darken(nth($state,2), 5%);
                border-color: #{nth($state,2)} !important;
                color: #{nth($state,3)};
            }
        }
    }
}

/* Border Buttons - Sizes */
.btn-borders {
    padding: 0.483rem 1.0625rem;
}
.btn-borders.btn-xl {
    padding: 0.75rem 2rem;
}
.btn-borders.btn-lg, .btn-group-lg > .btn-borders.btn {
    padding: 0.45rem 1rem;
}

.btn-borders.btn-sm, .btn-group-sm > .btn-borders.btn {
    border-width: 2px;
    padding: 0.25rem 0.65rem;
}

.btn-borders.btn-xs, .btn-group-xs > .btn-borders.btn {
    padding: 0.15rem 0.5rem;
    border-width: 1px;
}

/* 3D Buttons */
.btn-3d {
    border-bottom-width: 3px;
}

.btn-3d.btn-sm, .btn-group-sm > .btn-3d.btn {
    border-width: 2px;
}

.btn-3d.btn-xs, .btn-group-xs > .btn-3d.btn {
    border-width: 1px;
}

.btn-flat {
    display: inline-block;
}

.btn-modern {
    text-transform: uppercase;
    font-size: .75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    &.btn-xl {
        font-size: 1rem;
        padding: 1.25em 3.125em;
    }
    &.btn-lg {
        font-size: .875rem;
        padding: 1rem 2.25rem;
    }
    &.btn-sm {
        font-size: .7rem;
        padding: .7rem 1.4rem
    }
    &.btn-xs {
        font-size: .625rem;
        padding: .6rem 1.2rem;
    }
}

.box-shadow-2 .btn, .btn.box-shadow-2 {
    box-shadow: 0 15px 30px -15px rgba(0, 0, 0, 0.45);
}

/* Arrow Button */
.btn-arrow {
    font-weight: 600;
    &:not(.btn-borders) {
        background: none !important;
        border: none !important;
    }
    &:focus {
        box-shadow: none !important;
    }

    .icon-wrapper {
        background-color: #ccc;
        display: inline-block;
        height: 25px;
        line-height: 24px;
        width: 24px;
        border-radius: 50%;
        margin-#{$left}: 8px;
        transition: all 0.1s linear;
    }
    &:hover .icon-wrapper {
        transform: translateX(5px);
    }
    i {
        color: #fff;
        font-size: 8px;
        top: -1px;
        position: relative;
    }
}
