%toolbar {
  button:not(.raised):not(.suggested-action):not(.destructive-action) {
    &.arrow-button,
    &.image-button,
    &.image-text-button {
      @extend %button_basic_flat;
    }
  }

  menubutton:not(.raised):not(.suggested-action):not(.destructive-action) {
    &.image-button > button {
      @extend %button_basic_flat;
    }
  }

  .linked button:not(.raised):not(.suggested-action):not(.destructive-action) {
    &.arrow-button,
    &.image-button,
    &.image-text-button {
      @extend %button_basic_raised;
    }
  }

  menubutton.raised > button:not(.raised):not(.suggested-action):not(.destructive-action) {
    &.arrow-button,
    &.image-button,
    &.image-text-button {
      @extend %button_basic_raised;
    }
  }

  splitbutton {
    // Specificity bump
    > separator.vertical {
      margin-top: 6px;
      margin-bottom: 6px;
    }

    &:not(.raised):not(.suggested-action):not(.destructive-action) {
      @extend %flat_split_button;
    }
  }

  // add vertical margins to common widgets on toolbars to avoid them spanning
  // the whole height
  entry,
  spinbutton,
  splitbutton,
  separator:not(.sidebar),
  button,
  menubutton {
    margin-top: 6px;
    margin-bottom: 6px;
  }

  // Reset margins for buttons inside menubutton
  menubutton > button,
  splitbutton > button,
  splitbutton > menubutton {
    margin-top: 0px;
    margin-bottom: 0px;
  }

  switch {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  // Reset styles for popovers
  popover {
    button:not(.raised):not(.suggested-action):not(.destructive-action) {
      &.arrow-button,
      &.image-button,
      &.image-text-button {
        @extend %button_basic_raised;
      }
    }

    menubutton:not(.raised):not(.suggested-action):not(.destructive-action) {
      &.image-button > button {
        @extend %button_basic_raised;
      }
    }

    entry,
    spinbutton,
    splitbutton,
    separator:not(.sidebar),
    button,
    menubutton,
    switch {
      margin-top: 0;
      margin-bottom: 0;
    }

    &.menu separator:not(.sidebar) {
      margin-top: 6px;
      margin-bottom: 6px;
    }
  }
}

.toolbar {
  padding: 0 6px;
  border-spacing: 6px;
  background-color: $bg_color;

  // on OSD
  .osd & { background-color: transparent; }

  @extend %toolbar;

  // stand-alone OSD toolbars
  &.osd {
    padding: 8px 14px;
    border: none;
    border-radius: 5px;
    background-color: $osd_bg_color;

    &.left,
    &.right,
    &.top,
    &.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
  }
}

/****************
 * GtkSearchBar *
 ****************/

searchbar > revealer > box {
  padding: 6px 6px 7px 6px;
  border-spacing: 6px;

  background-color: $dark_fill;
  box-shadow: inset 0 -1px $borders_color;

 .close {
    min-width: 18px;
    min-height: 18px;
    padding: 4px;
    border-radius: 50%;
    @extend %button_basic_flat;
  }
}

/****************
 * GtkActionBar *
 ****************/

actionbar > revealer > box {
  padding: 1px 6px 0px 6px;
  box-shadow: inset 0 1px $borders_color;
  @extend %toolbar;

  &, > box.start, > box.end {
    border-spacing: 6px;
  }
}

/**************
 * GtkInfoBar *
 **************/

infobar {
  > revealer > box {
    padding: 8px 8px 9px 8px;
    border-spacing: 12px;
    box-shadow: inset 0 -1px $borders_color;
  }

  &.action:hover > revealer > box {
    background-image: image(gtkalpha(currentColor, .05));
  }

  &.action:hover:active > revealer > box {
    background-image: image(gtkalpha(currentColor, .1));
  }

  @each $i_type, $i_color in (info, $accent_bg_color),
                             (question, $accent_bg_color),
                             (warning, $warning_color),
                             (error, $error_color) {
    &.#{$i_type} > revealer > box {
      background-color: gtkmix($i_color, $base_color, if($variant == 'dark', 30%, 15%));
    }
  }

 .close {
    min-width: 18px;
    min-height: 18px;
    padding: 4px;
    border-radius: 50%;
    @extend %button_basic_flat;
  }
}
