@mixin normal_buttons($bg, $fg, $br) {
  & {
    padding: 6px 6px;
    border: 1px solid gtkmix(gtkshade($br, 0.3), $selected_bg_color, 0.25);
    border-radius: $button_radius;
    color: $fg;
    background-color: $bg;
    background-image: linear-gradient(to bottom, rgba(252,252,252,1) 0%,rgba(235,235,235,1) 50%,rgba(221,221,221,1) 51%,rgba(174,174,174,1) 100%);
    box-shadow: inset 0 0 3px 0px rgba(0,0,0,0.15);
    -gtk-outline-radius: $button_radius;

    &:hover, &:focus {
      box-shadow: inset 0 0 1px 2px #ffc73c;
      border-color: gtkmix(gtkshade($br, 0.3), $selected_bg_color, 0.3);
    }

    &:active, &:checked {
      border-color: gtkshade($br, 0.3);
      background-color: gtkshade($bg_color, 0.95);
      background-image: linear-gradient(to bottom,gtkshade(#f7f7f7, 0.6),gtkshade(#f7f7f7, 0.7),gtkshade(#f7f7f7, 0.75));
      
      &:backdrop {
      }
      
      &:disabled {
        color: gtkmix($fg, $unfocused_disabled_fg_color, 0.1);
        border-color: gtkmix($fg, $disabled_bg_color, 0.5);
        background-color: gtkshade($disabled_bg_color, 0.9);
        
        &:backdrop {
        }
      }
    }

    &:disabled {
      color: $disabled_fg_color;
      border-color: gtkshade($br, 0.75);
      background-color: $disabled_bg_color;
        
      &:backdrop {
      }
    }

    &:backdrop {
    }
  }
}

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

    &:hover {
      border-color: gtkmix(gtkshade($br, 0.3), $selected_bg_color, 0.3);
      background-color: $bg;
      background-image: linear-gradient(to bottom, rgba(252,252,252,1) 0%,
                                           rgba(235,235,235,1) 50%,
                                           rgba(221,221,221,1) 51%,
                                           rgba(174,174,174,1) 100%);
      box-shadow: inset 0 0 3px 0px rgba(0,0,0,0.15);
    }

    &:active, &:checked {
      border-color: gtkshade($br, 0.3);
      background-color: gtkshade($bg_color, 0.95);
      background-image: linear-gradient(to bottom,gtkshade(#f7f7f7, 0.6),gtkshade(#f7f7f7, 0.7),gtkshade(#f7f7f7, 0.75));
      
      &:backdrop {
      }
    }

    &:disabled {
      border-color: transparent;
      color: gtkalpha($fg, 0.8);
      background-color: transparent;
      
      &:backdrop {
      }
    }

    &:backdrop {
    }
  }
}

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