//
// Buttons
// --------------------------------------------------


// Base styles
// --------------------------------------------------

.bk-bs-btn {
  display: inline-block;
  margin-bottom: 0; // For input.bk-bs-btn
  font-weight: @btn-font-weight;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.bk-bs-com/necolas/normalize.bk-bs-css/issues/214
  border: 1px solid transparent;
  white-space: nowrap;
  .bk-bs-button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base);
  .bk-bs-user-select(none);

  &,
  &:active,
  &.bk-bs-active {
    &:focus {
      .bk-bs-tab-focus();
    }
  }

  &:hover,
  &:focus {
    color: @btn-default-color;
    text-decoration: none;
  }

  &:active,
  &.bk-bs-active {
    outline: 0;
    background-image: none;
    .bk-bs-box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
  }

  &.bk-bs-disabled,
  &[disabled],
  fieldset[disabled] & {
    cursor: not-allowed;
    pointer-events: none; // Future-proof disabling of clicks
    .bk-bs-opacity(.65);
    .bk-bs-box-shadow(none);
  }
}


// Alternate buttons
// --------------------------------------------------

.bk-bs-btn-default {
  .bk-bs-button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
}
.bk-bs-btn-primary {
  .bk-bs-button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}
// Success appears as green
.bk-bs-btn-success {
  .bk-bs-button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
}
// Info appears as blue-green
.bk-bs-btn-info {
  .bk-bs-button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
}
// Warning appears as orange
.bk-bs-btn-warning {
  .bk-bs-button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
}
// Danger and error appear as red
.bk-bs-btn-danger {
  .bk-bs-button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
}


// Link buttons
// -------------------------

// Make a button look and behave like a link
.bk-bs-btn-link {
  color: @link-color;
  font-weight: normal;
  cursor: pointer;
  border-radius: 0;

  &,
  &:active,
  &[disabled],
  fieldset[disabled] & {
    background-color: transparent;
    .bk-bs-box-shadow(none);
  }
  &,
  &:hover,
  &:focus,
  &:active {
    border-color: transparent;
  }
  &:hover,
  &:focus {
    color: @link-hover-color;
    text-decoration: underline;
    background-color: transparent;
  }
  &[disabled],
  fieldset[disabled] & {
    &:hover,
    &:focus {
      color: @btn-link-disabled-color;
      text-decoration: none;
    }
  }
}


// Button Sizes
// --------------------------------------------------

.bk-bs-btn-lg {
  // line-height: ensure even-numbered height of button next to large input
  .bk-bs-button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
}
.bk-bs-btn-sm {
  // line-height: ensure proper height of button next to small input
  .bk-bs-button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
}
.bk-bs-btn-xs {
  .bk-bs-button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small);
}


// Block button
// --------------------------------------------------

.bk-bs-btn-block {
  display: block;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

// Vertically space out multiple block buttons
.bk-bs-btn-block + .bk-bs-btn-block {
  margin-top: 5px;
}

// Specificity overrides
input[type="submit"],
input[type="reset"],
input[type="button"] {
  &.bk-bs-btn-block {
    width: 100%;
  }
}
