@mixin normal_buttons($bg, $fg, $br) {
  color: $fg;
  padding: 6px 8px;
  border-radius: $button_radius;
  border: 2px solid transparent;
  background-color: gtkmix($bg, $fg, 0.15);
  outline-width: 0;

/*
  outline-color: $fg_color;
  outline-offset: 0px;
  outline-style: solid;
*/

  &:hover {
    color: $fg;    
    box-shadow: inset 0 0 0 2px gtkalpha($fg_color, 0.4);
    background-color: gtkmix($bg, $fg, 0.15);
  }

  &:active, &:checked {
    color: $fg;
    background-color: gtkmix($bg, $fg, 0.35);

    &:backdrop {
      color: $unfocused_fg_color;
      background-color: gtkshade($unfocused_bg_color, 0.85);
    }
  }
  
  &:focus {
    box-shadow: inset 0 0 0 1px $base_color;
    border-color: $fg;
  }

  &:disabled {
    color: gtkmix($fg, $unfocused_disabled_fg_color, 0.1);
    background-color: gtkmix($bg, $disabled_bg_color, 0.3);
    
    &:backdrop {
      color: $unfocused_disabled_fg_color;
      background-color: gtkmix($bg, $unfocused_disabled_bg_color, 0.3);
    }
  }

  &:backdrop {
    color: gtkmix($fg, $unfocused_bg_color, 0.3);
    background-color: gtkmix($bg, $fg, 0.2);
  }
}

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

  &:hover {
    color: $fg;
    box-shadow: inset 0 0 0 2px gtkalpha($fg_color, 0.4);
    background-color: gtkmix($bg, $fg, 0.15);
  }

  &:active, &:checked {
    color: $fg;
    background-color: gtkmix($bg, $fg, 0.35);

    &:backdrop {
      color: $unfocused_fg_color;
      background-color: gtkshade($unfocused_bg_color, 0.85);
    }
  }
  
  &:focus {
    box-shadow: inset 0 0 0 1px $light_shadow;
  }

  &:disabled {
    color: gtkmix($fg, $unfocused_disabled_fg_color, 0.1);
    background-color: gtkmix($bg, $disabled_bg_color, 0.3);
    
    &:backdrop {
      color: $unfocused_disabled_fg_color;
      background-color: gtkmix($bg, $unfocused_disabled_bg_color, 0.3);
    }
  }

  &:backdrop {
    color: gtkmix($fg, $unfocused_bg_color, 0.3);
  }
}

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