@define-mixin button-type $type {
  .button--$(type) {
    color: var(--$(type)-link-color) !important;
    border-color: var(--$(type)-border-color);
    background: var(--$(type)-muted-color);
  }

  .button--$(type) a {
    color: inherit;
  }

  .button--$(type).button--important {
    color: var(--text-color) !important;
    background: var(--$(type)-color);
  }

  .button--$(type):hover,
  .button--$(type):active,
  .button--$(type).selected {
    color: var(--text-color) !important;
    background: var(--$(type)-dark-color);
    border-radius: var(--border-radius-inner);
  }

  .button__group--$(type) {
    border-color: var(--$(type)-color);
    background: var(--$(type)-dark-color);
  }

  .button__group--$(type) a {
    color: var(--$(type)-link-color);
  }

  .button__group--$(type) a:hover {
    @mixin animated-transition;
    color: var(--text-color);
    background: var(--$(type)-color);
    border-radius: var(--border-radius-inner);
  }
}

@define-mixin button-block-type $type {
  .block--$(type) .button:not([class*="button--"]) {
    color: var(--$(type)-link-color) !important;
    border-color: var(--$(type)-border-color);
    background: var(--$(type)-muted-color);
  }

  .block--$(type) .button:not([class*="button--"]) a {
    color: inherit;
  }

  .block--$(type) .button--important:not([class*="button--"]) {
    color: var(--text-color) !important;
    background: var(--$(type)-color);
  }

  .block--$(type) .button:not([class*="button--"]):hover,
  .block--$(type) .button:not([class*="button--"]):active,
  .block--$(type) .button:not([class*="button--"]).selected {
    color: var(--text-color) !important;
    background: var(--$(type)-dark-color);
    border-radius: var(--border-radius-inner);
  }

  .block--$(type) .button__group:not([class*="button--"]),
  .block--$(type)
    .button__group--single:not([class*="button--"])
    .block--$(type)
    .button__group--standalone:not([class*="button--"]) {
    border-color: var(--$(type)-color);
    background: var(--$(type)-dark-color);
  }

  .block--$(type) .button__group:not([class*="button--"]) a,
  .block--$(type)
    .button__group--single:not([class*="button--"])
    a
    .block--$(type)
    .button__group--standalone:not([class*="button--"])
    a {
    color: var(--$(type)-link-color);
  }

  .block--$(type) .button__group:not([class*="button--"]) a:hover,
  .block--$(type)
    .button__group--single:not([class*="button--"])
    a:hover
    .block--$(type)
    .button__group--standalone:not([class*="button--"])
    a:hover {
    @mixin animated-transition;
    color: var(--text-color);
    background: var(--$(type)-color);
    border-radius: var(--border-radius-inner);
  }
}

.button {
  @mixin animated-transition;
  display: flex;
  flex: 0 1 auto;
  width: fit-content;
  font-weight: bold;
  font-size: var(--font-size);
  background: var(--primary-muted-color);
  color: var(--link-color);
  border-radius: var(--border-radius-inner);
  padding: 0 var(--padding-small);
  overflow: hidden;
  line-height: var(--button-height);
  align-items: center;
  border-width: 0;
}

.button:hover,
.button:active {
  @mixin animated-transition;
  color: var(--text-color);
  background: var(--primary-dark-color);
  border-radius: var(--border-radius-inner);
  cursor: pointer;
}

.button > i {
  margin-right: var(--padding-small);
}

@mixin if-phone {
  .button > span {
    margin-left: var(--padding-small);
  }
}

.button--important {
  background: var(--primary-color);
}

.button__row {
  display: flex;
  flex-direction: row;
}

.button__row > button {
  margin-right: var(--padding-small);
}

.button__group--single {
  margin-right: 0;
}

.button__group,
.button__group--single,
.button__group--standalone {
  display: flex;
  flex-direction: row;
  border-radius: var(--border-radius-inner);
  margin-right: var(--padding-normal);
  background: var(--secondary-dark-color);
  line-height: var(--button-group-height);
  padding: 0 var(--padding-small);
}

.button__group:last-child,
.button__group--single:last-child,
.button__group--standalone:last-child {
  margin: 0;
}

.button__group--tall {
  line-height: var(--button-group-tall-height);
}

.button__group--small {
  line-height: var(--button-group-small-height);
}

.button__group .button {
  border: 0;
  border-right: var(--secondary-color);
}

.button__group .button:last-child {
  border-right: 0;
}

.button__group--standalone a {
  @mixin animated-transition;
  font-weight: bold;
  padding: 0 var(--padding-small);
}

.button__group--standalone a:hover {
  @mixin animated-transition;
  background: var(--secondary-muted-color);
  border-radius: var(--border-radius-inner);
}

.button--borderless {
  border-width: 0;
}

.button--transparent,
.button--transparent:hover {
  background: 0 !important;
}

@mixin button-block-type primary;
@mixin button-block-type secondary;
@mixin button-block-type success;
@mixin button-block-type warning;
@mixin button-block-type danger;
@mixin button-block-type information;
@mixin button-block-type special;

@mixin button-type primary;
@mixin button-type secondary;
@mixin button-type success;
@mixin button-type warning;
@mixin button-type danger;
@mixin button-type information;
@mixin button-type special;
