//
// Base styles
//

.btn {
  display: inline-block;
  font-family: $btn-font-family;
  font-weight: $btn-font-weight;
  line-height: $btn-line-height;
  color: $body-color;
  text-align: center;
  white-space: $btn-white-space;
  vertical-align: middle;
  cursor: if($enable-pointer-cursor-for-buttons, pointer, null);
  user-select: none;
  background-color: transparent;
  border: $btn-border-width solid transparent;
  @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-border-radius);
  @include transition($btn-transition);
  text-decoration: none;

  &:hover {
    color: $body-color;
    text-decoration: none;
  }

  &:focus {
    //outline: none;
  }
  &:focus-visible {
    outline: none;
    border: 2px solid white!important;
    box-shadow: 0 0 0 2px black!important;
  }
  &.focus {
    outline: 0;
    box-shadow: $btn-focus-box-shadow;
  }

  &:active,
  &.active {
    @include box-shadow($btn-active-box-shadow);

    &:focus {
      @include box-shadow($btn-focus-box-shadow, $btn-active-box-shadow);
    }
  }

  &:disabled,
  &.disabled,
  fieldset:disabled & { // stylelint-disable-line selector-no-qualifying-type
    pointer-events: none;
    opacity: $btn-disabled-opacity;
    @include box-shadow(none);
  }

  .icon {
    width: 1rem;
    height: 1rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    position: relative;
    top: -0.05rem;
    text-align: center;

    &:first-child {
      margin-right: 0.4rem;
      margin-left: 0.05rem;
    }
    &:last-child {
      margin-left: 0.4rem;
      margin-right: 0.05rem;
    }
  }
}


//
// Alternate buttons
//

@each $color, $value in $theme-button-colors {
  .btn-#{$color} {
    @include button-variant($value, $value);
    box-shadow: 0 8px 24px -17px $theme-button-shadow-color;
    font-weight: 500;
    .icon {
      width: 1.5rem;
      height: 1.5rem;
      padding: 0 0.75rem;
      &:before {
        height: 1.6rem;
        width: 1.6rem;
      }
      &:first-child {
        margin-right: 0.5rem;
        margin-left: 0.05rem;
      }
      &:last-child {
        margin-left: 0.5rem;
        margin-right: 0.05rem;
      }
    }
  }
}

// @each $color, $value in $theme-colors {
//   .btn-outline-#{$color} {
//     @include button-outline-variant($value);
//   }
// }


//
// Link buttons
//

// Make a button look and behave like a link
.btn-link {
  font-weight: $font-weight-normal;
  color: $btn-link-color;
  text-decoration: $link-decoration;

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

  &:focus {
    //outline: none;
  }
  &:focus-visible {
    outline: none;
    border: 2px solid white!important;
    box-shadow: 0 0 0 2px black!important;
  }
  &.focus {
    text-decoration: $link-hover-decoration;
    box-shadow: none;
  }

  &:disabled,
  &.disabled {
    color: $btn-link-disabled-color;
  }
  &_narrow {
    padding-left: 0;
    padding-right: 0;
    margin-top: 0.4rem;
  }
  &_icon {
    font-weight: bold;
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    width: auto;
    align-items: center;

    .text-left > & {
      margin-right: 1rem;
    }
    .text-right > & {
      margin-left: 1rem;
    }
    &:focus {
			//outline: none;
		}
		&:focus-visible {
			outline: none;
			border: 2px solid white!important;
			box-shadow: 0 0 0 2px black!important;
		}
  }
  // No need for an active state here
}


//
// Button Sizes
//

.btn-lg {
  @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $btn-font-size-lg, $btn-border-radius-lg);
}

.btn-sm {
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
}


//
// Block button
//

.btn-block {
  display: block;
  width: 100%;

  // Vertically space out multiple block buttons
  p + &,
  + .btn-block {
    margin-top: $btn-block-spacing-y;
  }
}

.btn-secondary {
  &:focus {
    //outline: none;
  }
  &:focus-visible {
    outline: none;
    border: 2px solid white!important;
    box-shadow: 0 0 0 2px black!important;
  }
}

button {
  &:focus {
    //outline: none;
  }
  &:focus-visible {
    outline: none;
    border: 2px solid white!important;
    box-shadow: 0 0 0 2px black!important;
  }
}