/* Popovers/Menus */

//.the popover itself
.popup-menu-boxpointer {
  -arrow-border-radius: 6px;
  -arrow-background-color: transparent;
  -arrow-border-width: 0;
  -arrow-border-color: $borders_color;
  -arrow-base: 24px;
  -arrow-rise: 0;
  -arrow-box-shadow: none; // dreaming bugzilla #689995
}

// container of the popover menu
.popup-menu {
  min-width: 15em;
  color: $fg_color !important;
  background: none;
  border: none;
  box-shadow: none;

  //.popup-status-menu-item { font-weight: normal;  color: pink; } //dunno what that is
  &.panel-menu {
    -boxpointer-gap: 4px; // distance from the panel
    margin-bottom: 1.75em;
  }

  .search-entry {
    border: 1px solid $borders_color;

    &:hover { border: 1px solid $borders_color; }
    &:focus { border: 1px solid $selected_bg_color; }
  }
}

.popup-menu-content {
  padding: 6px 0;
  background-color: $base_color !important;
  border-radius: $material_radius;
  margin: 2px 7px 12px;
  box-shadow: 0 3px 5px rgba(black, 0.15);
  border: if($variant == 'light', 0, 1px) solid $borders_color !important;
}

// menu items
.popup-menu-item {
  spacing: 6px;
  padding: 6px;
  color: $alt_fg_color !important;
  border-radius: 0 !important;
  border-top: none !important;

  &:checked {
    background-color: darken($base_color, 3%) !important;
    border-top: 1px solid $borders_color !important;
    box-shadow: none !important;
    color: $fg_color !important;
    border-radius: 0 !important;
  }

  &:hover, &:focus, &.selected {
    background-color: $selected_bg_color !important;
    color: $selected_fg_color !important;
  }

  &:active {
    background-color: darken($selected_bg_color, 5%) !important;
    color: $selected_fg_color !important;
  }

  &:insensitive { color: transparentize($fg_color, 0.5) !important; }
}

// all icons and other graphical elements
.popup-inactive-menu-item {
  color: $fg_color !important;

  &:insensitive { color: transparentize($fg_color, 0.5) !important; }
}

// symbolic icons in popover
.popup-menu-arrow,
.popup-menu-icon { icon-size: 16px; }

// popover submenus
.popup-sub-menu {
  background-color: darken($base_color, 3%) !important;
  border: none !important;
  border-bottom: 1px solid $borders_color !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  .popup-menu-item {
    background-color: transparent;
  }
}

// container for radio and check boxes
.popup-menu-ornament {
  width: 1.2em;

  &:ltr { text-align: right; }
  &:rtl { text-align: left; }
}

// separator
.popup-separator-menu-item {
  margin: 0 !important;
  padding: 0 !important;

  .popup-separator-menu-item-separator {
    //-margin-horizontal: 24px;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent;

    .popup-sub-menu & { //submenu separators
      margin: 0 !important;
      padding: 0 !important;
      background-color: transparent;
    }
  }
}

// desktop background menu
.background-menu {
  -boxpointer-gap: 4px;
  -arrow-rise: 0px; // hide the beak on the menu
}

// system status menu
.aggregate-menu {
  min-width: 21em;

  // lock screen, shutdown, etc. buttons
  .popup-menu-icon {
    padding: 0;
    margin: 0 4px;
    -st-icon-style: symbolic;
  }
}
