$_menu-padding: 12px; //inner menuitem padding
//global $menu-margin for outside menuitems

popover.menu {
  padding: 0;

  box.inline-buttons {
    padding: 0 $_menu-padding;

    button.image-button.model {
      @include button(undecorated);

      min-height: 30px;
      min-width: 30px;
      padding: 0;
      border: none;
      outline: none;
      transition: none;

      &:selected { background: image($menu_selected_color); }
    }
  }

  box.circular-buttons {
    padding: $_menu-padding $_menu-padding 6px;

    button.circular.image-button.model {
      @extend %outline_button;

      padding: 11px;
      &:focus {
         background-color: $menu_selected_color;
         border-color: $menu_selected_color;
      }
    }
  }

  & > arrow,
  &.background > contents {
    background-color: $menu_color;
    padding: $menu-margin;
  }

  &.background separator {
    margin: 6px 0;
  }

  accelerator {
    color: gtkalpha(currentColor, 0.55);

    &:dir(ltr) { margin-left: $_menu-padding; }
    &:dir(rtl) { margin-right: $_menu-padding; }
  }

  check,
  radio {
    @include check('menu', 'transparent', $text_color);

    &:hover { @include check('menu-active', 'transparent', $text_color); }
    &:active { @include check('menu-active', 'transparent', $text_color); }
  }

  //only menu radios have a border
  radio {
    border-color: $borders_color;

    &:active { border-color: transparentize($borders_color,0.5); }
  }

  arrow.left,
  radio.left,
  check.left {
    margin-left: -2px;
    margin-right: 6px;
  }

  arrow.right,
  radio.right,
  check.right {
    margin-left: 6px;
    margin-right: -2px;
  }

  arrow:disabled,
  check:disabled,
  radio:disabled { -gtk-icon-filter: opacity(0.5); }

  modelbutton {
    min-height: 30px;
    min-width: 40px;
    padding: 0 $_menu-padding;
    border-radius: $menu-margin;

    @extend %undecorated_button;

    &:hover,
    &:selected {
      color: $text-color;
      background-color: $menu_selected_color;

      &:active {
        background-color: darken($bg_color,14%); // matching buttons
      }
    }

    &:disabled { color: $insensitive_fg_color; }

    arrow {
      background: none;
      min-width: 16px;
      min-height: 16px;
      opacity: 0.3; // dim icon

      &:hover { background: none; }

      &.left { -gtk-icon-source: -gtk-icontheme("go-previous-symbolic"); }

      &.right { -gtk-icon-source: -gtk-icontheme("go-next-symbolic"); }
    }
  }

  label.title {
    font-weight: bold;
    padding: 4px ($_menu-padding + 20px); //this will fall apart with font sizing
  }
}

menubar {
  padding: 0px;
  box-shadow: inset 0 -1px transparentize(black, 0.9);

  > item {
    min-height: 16px;
    padding: 4px 8px;

    &:selected { //Seems like it :hover even with keyboard focus
      box-shadow: inset 0 -3px $selected_bg_color;
      color: $link_color;
    }

    &:disabled {
      color: $insensitive_fg_color;
      box-shadow: none;
    }

    popover.menu.background > contents {
      padding: $menu-margin;
    }

    //nested submenus
    popover.menu popover.menu {
      padding: 0 0 4px 0;
    }

    popover.menu.background popover.menu.background > contents {
      margin: 0;
      border-radius: $popover_radius; //including top
    }
  }
}
