[class*="fizz-button"] {
  border-radius: $border-radius-medium;
  border: $border-width-thin solid $color-border-input;
  font-weight: $font-weight-semibold;
  font-size: $text-medium-font-size;
  line-height: $text-medium-line-height;
  padding: $spacing-8 $spacing-16;
  display: block;
  color: $color-text-brand;
  background-color: $color-background-surface;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

[class*="fizz-button"]:focus-visible,
[class*="fizz-icon-button"]:focus-visible {
  outline: none;
  border-color: $color-border-brand-secondary;
  box-shadow: $box-shadow-input-focus;
}

a[class*="fizz-button"]:hover {
  text-decoration: none;
}

.fizz-button:hover:not(:disabled),
.fizz-button-small:hover:not(:disabled),
.fizz-button-large:hover:not(:disabled) {
  border-color: $color-navy-800;
}

.fizz-button:disabled,
.fizz-button-small:disabled,
.fizz-button-large:disabled,
.fizz-button-primary:disabled,
.fizz-button-secondary:disabled,
.fizz-button-super-primary:disabled {
  opacity: .5;
  cursor: default;
}

.fizz-button-small,
.fizz-button-group .fizz-button-small {
  font-size: $text-small-font-size;
  line-height: $text-small-line-height;
  padding: $spacing-4 $spacing-8;
}

.fizz-button-large,
.fizz-button-group .fizz-button-large {
  font-size: $text-medium-font-size;
  line-height: $text-medium-line-height;
  padding: $spacing-16;
}

.fizz-button-small:not(.fizz-button):hover,
.fizz-button-large:not(.fizz-button):hover {
  border-color: transparent;
}

.fizz-button-primary {
  background-color: $color-background-brand;
  color: $color-text-inverse;
  border-color: transparent;
}

.fizz-button-primary:hover:not(:disabled) {
  background-color: $color-navy-600;
}

.fizz-button-secondary {
  background-color: $color-background-brand-secondary;
  color: $color-text-inverse;
  border-color: $color-border-brand-secondary;
}

.fizz-button-secondary:hover:not(:disabled) {
  background-color: $color-background-brand-secondary-hover;
}

.fizz-button-danger {
  background-color: $color-background-error;
  color: $color-text-inverse;
  border-color: $color-border-error;
}

.fizz-button-danger:hover:not(:disabled) {
  background-color: $color-background-error-hover;
}

.fizz-button-super-primary {
  background-color: $color-background-success;
  color: $color-text-inverse;
  border-color: $color-border-success;
}

.fizz-button-super-primary:hover:not(:disabled) {
  background-color: $color-background-success-hover;
}

[class*="fizz-button-icon"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

[class*="fizz-button-icon"] > :not(:last-child) {
  margin-right: $spacing-8;
}

.fizz-button-text {
  color: $color-text-link;
  border-color: transparent;
  background-color: transparent;
}

.fizz-button-text:hover {
  background-color: $color-background-brand-secondary-subdued;
}

.fizz-button-text:disabled {
  color: $color-text-interactive-inactive;
  cursor: default;

  &:hover {
    background-color: transparent;
  }
}

.fizz-icon-button {
  background-color: inherit;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 4px;
  border: 0;
}

.fizz-icon-button:hover {
  background-color: $color-gray-100;
}

.fizz-icon-button:disabled {
  &:hover {
    background-color: transparent;
    cursor: unset;
  }
  svg {
    fill: $color-gray-400;
  }
}

.fizz-icon-button.fizz-button-small {
  width: 28px;
  height: 28px;
  padding: 0;
}

.fizz-icon-button-small {
  background-color: inherit;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  border: 0;
  &:disabled svg {
    opacity: .5;
  }
}

.fizz-icon-button-small:hover {
  background-color: $color-gray-100;
}

.fizz-icon-button-subdued svg {
  fill: $color-icon-subdued;
}

.fizz-icon-button-subdued:hover svg {
  fill: $color-icon-body;
}

.fizz-icon-button-inverted svg {
  fill: $color-icon-inverted;
}

.fizz-icon-button-inverted:hover svg {
  fill: $color-icon-brand;
}

.fizz-icon-button-small:active {
  background-color: $color-background-interactive;

  svg {
    fill: $color-icon-inverted;
  }
}

.fizz-icon-button-inverted:active {
  background-color: $color-background-interactive;

  svg {
    fill: $color-icon-inverted;
  }
}

.fizz-button-group {
  display: inline-flex;
  border: none;
  border-radius: 0;
  overflow: hidden;
  padding: 0;
}

.fizz-button-group:after {
  content: "";
  display: block;
  clear: both; 
}

.fizz-button-group > [class*="fizz-button"] {
  border-radius: 0;
  color: $color-text-subdued;
}

.fizz-button-group > [class*="fizz-button"]:not(:last-child) {
  border-right-width: $border-width-thin;
}

.fizz-button-group > [class*="fizz-button"]:first-child {
  border-radius: $border-radius-medium 0 0 $border-radius-medium;
}

.fizz-button-group > [class*="fizz-button"]:last-child {
  border-radius: 0 $border-radius-medium $border-radius-medium 0;
}

.fizz-button-group > .fizz-is-active {
  background-color: $color-background-brand;
  color: $color-text-inverse;
  border-color: transparent;
}

.fizz-button-group > [class*="fizz-button"]:hover:not(:disabled):not(.fizz-is-active) {
  background-color: $color-background-body;
  border-color: $color-border-input;
}

.fizz-button-group > [class*="fizz-button"]:not(:first-child) {
  border-left-width: 0;
}

.fizz-close-button {
  position: absolute;
  top: $spacing-8;
  right: $spacing-8;
}

.fizz-close-button:hover {
  background-color: inherit;
}

.fizz-close-button svg {
  fill: $color-icon-subdued;
}

.fizz-close-button:hover svg {
  fill: $color-icon-body;
}

.fizz-button-select {
  display: block;
  max-width: 100%;
  border-radius: $border-radius-medium;
  border: $border-width-thin solid $color-border-input;
  color: $color-text-body;
  font-size: $text-medium-font-size;
  line-height: $text-medium-line-height;
  font-weight: $font-weight-regular;
  padding: $spacing-8 calc(#{$spacing-32} + #{$spacing-8}) $spacing-8 $spacing-16;
  background-image: $icon-chevron-down;
  background-repeat: no-repeat;
  background-position: top 50% right $spacing-16;
  background-size: $spacing-16 $spacing-16;
  background-color: $color-background-surface;
  text-align: left;
}

.fizz-button-select:focus {
  outline: none;
  border-color: $color-border-brand-secondary;
  box-shadow: $box-shadow-input-focus;
}

.fizz-button-select:active,
.fizz-button-select:hover {
  border-color: $color-border-brand-secondary;
}

.fizz-button-spinner {
  position: relative;
  color: transparent;
  user-select: none;
}

.fizz-button-spinner:before {
  display: inline-block;
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  animation: spinner-button 1s linear infinite;
  background-image: $icon-spinner-brand;
}

.fizz-button-primary.fizz-button-spinner:before,
.fizz-button-secondary.fizz-button-spinner:before {
  background-image: $icon-spinner-white;
}

@keyframes spinner-button {
  from {
    transform:  translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.fizz-cart-button {
  font-size: $text-medium-font-size;
  line-height: $text-medium-line-height;
  background-color: $color-background-brand-secondary;
  color: $color-text-inverse;
  border-radius: $border-radius-xlarge;
  border: $border-width-thin solid transparent;
  background-image: $icon-cart-white;
  background-repeat: no-repeat;
  background-size: $spacing-24;
  background-position: left $spacing-12 top 50%;
  padding: $spacing-8 $spacing-12 $spacing-8 calc(#{$spacing-32} + #{$spacing-8});
}

.fizz-cart-button:hover {
  background-color: $color-teal-800;
}

[data-cart-items="0"].fizz-cart-button {
  color: inherit;
  background-color: $color-background-highlight;
  background-image: $icon-cart-brand
}
[data-cart-items="0"].fizz-cart-button:hover {
  background-color: $color-gray-200;
}

.fizz-location-button {
  padding: $spacing-4;
  border-radius: $border-radius-medium;
  color: $color-text-brand;
}