@mixin normal_buttons($bg, $fg, $br) {
  padding: 4px 8px;
  border-style: solid;
  border-width: 1px;
  border-radius: $button_radius;
  color: $fg;
  border-color: $br;
  border-top-color: gtkmix($bg, $light_shadow, 0.7);
  border-left-color: gtkmix($bg, $light_shadow, 0.7);
  background-color: $bg;
  -gtk-outline-radius: $button_radius;
  outline-color: $titlebar_bg_color;
  outline-offset: 2px;
  outline-style: solid;

  &:hover {
  }

  &:active, &:checked {
    color: $fg;
    border-top-color: $br;
    border-left-color: $br;
    border-bottom-color: gtkmix($bg, $light_shadow, 0.7);
    border-right-color: gtkmix($bg, $light_shadow, 0.7);
    background-color: gtkshade($bg, 0.9);
    background-image: none;

    &:disabled {
      color: gtkmix($fg, $unfocused_disabled_fg_color, 0.1);
      text-shadow: 1px 1px gtkalpha($light_shadow, 0.7);
      background-color: gtkshade($disabled_bg_color, 0.9);
    }
  }

  &:disabled {
    color: gtkmix($fg, $unfocused_disabled_fg_color, 0.5);
    text-shadow: 1px 1px gtkalpha($light_shadow, 0.85);   // override in labels.scss
  }
}

@mixin flat_buttons($bg, $fg, $br)
{
  border-color: transparent;
  border-radius: $button_radius;
  color: $fg;
  box-shadow: none;
  background-color: transparent;

  &:hover {
    color: $fg;
    background-color: $bg;
    border-color: $br;
    border-top-color: gtkmix($bg, $light_shadow, 0.7);
    border-left-color: gtkmix($bg, $light_shadow, 0.7);
    background-color: $bg;
  }

  &:active, &:checked {
    color: $fg;
    border-top-color: $br;
    border-left-color: $br;
    border-bottom-color: gtkmix($bg, $light_shadow, 0.7);
    border-right-color: gtkmix($bg, $light_shadow, 0.7);
    background-color: gtkshade($bg, 0.9);
    background-image: none;

    &:disabled {
      color: gtkmix($fg, $unfocused_disabled_fg_color, 0.1);
      text-shadow: 1px 1px gtkalpha($light_shadow, 0.7);
      background-color: gtkshade($disabled_bg_color, 0.9);
    }
  }

  &:disabled {
    border-color: transparent;
    color: gtkalpha($fg, 0.8);
    text-shadow: 1px 1px gtkalpha($light_shadow, 0.7);
    background-color: transparent;
  }
}

@mixin button() {
  button {
    @include normal_buttons($bg_color, $fg_color, $borders);
    
    &.flat {
      @include flat_buttons($bg_color, $fg_color, $borders);
    }
  }
}
