//
// Base styles
//

.btn {
  font-family: $btn-font-family;
  text-transform: uppercase;
  vertical-align: bottom;
  border: 0;
  box-shadow: $btn-box-shadow;
  font-weight: $btn-font-weight;
  @include button-size-mdb(
    $btn-padding-top,
    $btn-padding-right,
    $btn-padding-bottom,
    $btn-padding-left,
    $btn-font-size,
    $btn-line-height
  );

  &:hover {
    box-shadow: $btn-hover-box-shadow;
  }

  &:focus,
  &.focus {
    box-shadow: $btn-focus-box-shadow;
  }

  &:active,
  &.active {
    box-shadow: $btn-hover-box-shadow;

    &:focus {
      box-shadow: $btn-hover-box-shadow;
    }
  }

  &:disabled,
  &.disabled,
  fieldset:disabled & {
    box-shadow: $btn-box-shadow;
    border: 0;
  }

  .btn-check:focus + &,
  &:focus {
    outline: 0;
    box-shadow: $btn-focus-box-shadow;
  }
}

//
// Outline option
//

[class*='btn-outline-'] {
  border-width: $btn-border-width;
  border-style: solid;
  box-shadow: none;
  @include button-outline-size-mdb(
    $btn-outline-padding-top,
    $btn-outline-padding-right,
    $btn-outline-padding-bottom,
    $btn-outline-padding-left
  );

  &:hover {
    box-shadow: none;
    text-decoration: none;
  }

  &:focus,
  &.focus {
    box-shadow: none;
    text-decoration: none;
  }

  &:active,
  &.active {
    box-shadow: none;

    &:focus {
      box-shadow: none;
    }
  }

  &:disabled,
  &.disabled,
  fieldset:disabled & {
    box-shadow: none;
  }

  &.btn-lg {
    @include button-outline-size-mdb(
      $btn-outline-padding-top-lg,
      $btn-outline-padding-right-lg,
      $btn-outline-padding-bottom-lg,
      $btn-outline-padding-left-lg
    );
  }

  &.btn-sm {
    @include button-outline-size-mdb(
      $btn-outline-padding-top-sm,
      $btn-outline-padding-right-sm,
      $btn-outline-padding-bottom-sm,
      $btn-outline-padding-left-sm
    );
  }
}

//
// Alternate buttons
//

@each $color, $value in $theme-colors {
  .btn-#{$color} {
    @include button-variant-mdb($value);
  }
}

//
// Alternate buttons outline
//

@each $color, $value in $theme-colors {
  .btn-outline-#{$color} {
    @include button-outline-variant-mdb($value);
  }
}

//
// Button Sizes
//

.btn-lg {
  @include button-size-mdb(
    $btn-padding-top-lg,
    $btn-padding-right-lg,
    $btn-padding-bottom-lg,
    $btn-padding-left-lg,
    $btn-font-size-lg,
    $btn-line-height-lg
  );
}

.btn-sm {
  @include button-size-mdb(
    $btn-padding-top-sm,
    $btn-padding-right-sm,
    $btn-padding-bottom-sm,
    $btn-padding-left-sm,
    $btn-font-size-sm,
    $btn-line-height-sm
  );
}

// Link buttons
//
// Make a button look and behave like a link

.btn-link {
  box-shadow: none;
  text-decoration: none;

  &:hover {
    box-shadow: none;
    text-decoration: none;
    background-color: $btn-link-bgc;
  }

  &:focus,
  &.focus {
    box-shadow: none;
    text-decoration: none;
    background-color: $btn-link-bgc;
  }

  &:active,
  &.active {
    box-shadow: none;
    background-color: $btn-link-bgc;

    &:focus {
      box-shadow: none;
      background-color: $btn-link-bgc;
    }
  }

  &:disabled,
  &.disabled,
  fieldset:disabled & {
    box-shadow: none;
  }
}

//
// Rounded option
//

.btn-rounded {
  border-radius: $btn-rounded-border-radius;
}

//
// Floating option
//

.btn-floating,
[class*='btn-outline-'].btn-floating {
  border-radius: $btn-floating-border-radius;
  padding: 0;
  position: relative;
}

.btn-floating {
  width: $btn-floating-width;
  height: $btn-floating-height;

  .fas,
  .far,
  .fab {
    width: $btn-floating-icon-width;
    line-height: $btn-floating-icon-line-height;
  }

  &.btn-lg {
    width: $btn-floating-width-lg;
    height: $btn-floating-height-lg;

    .fas,
    .far,
    .fab {
      width: $btn-floating-icon-width-lg;
      line-height: $btn-floating-icon-line-height-lg;
    }
  }

  &.btn-sm {
    width: $btn-floating-width-sm;
    height: $btn-floating-height-sm;

    .fas,
    .far,
    .fab {
      width: $btn-floating-icon-width-sm;
      line-height: $btn-floating-icon-line-height-sm;
    }
  }
}

[class*='btn-outline-'].btn-floating {
  .fas,
  .far,
  .fab {
    width: $btn-outline-floating-icon-width;
    line-height: $btn-outline-floating-icon-line-height;
  }

  &.btn-lg {
    .fas,
    .far,
    .fab {
      width: $btn-outline-floating-icon-width-lg;
      line-height: $btn-outline-floating-icon-line-height-lg;
    }
  }

  &.btn-sm {
    .fas,
    .far,
    .fab {
      width: $btn-outline-floating-icon-width-sm;
      line-height: $btn-outline-floating-icon-line-height-sm;
    }
  }
}
