// popup menu shortcuts gray if not mouseover
.toolbarbutton-1,
.subviewbutton,
.widget-overflow-list .toolbarbutton-1,
.toolbaritem-combined-buttons:is(
    :not([cui-areatype="toolbar"]),
    [overflowedItem="true"]
  )
  > toolbarbutton {
  &:not([disabled]) {
    &[shortcut]::after {
      color: get-var("text-disabled") !important;
    }

    &:hover[shortcut]::after {
      color: inherit !important;
    }
  }

  &[disabled] {
    &[shortcut]::after {
      color: get-var("text-disabled") !important;
    }

    &:hover[shortcut]::after {
      color: get-var("text-disabled") !important;
    }
  }
}

// also for #toolbar-menubar
menuitem:not([disabled]) {
  .menu-accel,
  .menu-iconic-accel {
    color: get-var("text-secondary") !important;
  }

  &:hover {
    .menu-accel,
    .menu-iconic-accel {
      color: inherit !important;
    }
  }
}

menuitem[disabled] {
  .menu-accel,
  .menu-iconic-accel {
    color: get-var("text-secondary") !important;
  }

  &:hover {
    .menu-accel,
    .menu-iconic-accel {
      color: get-var("text-secondary") !important;
    }
  }
}

// separator style
#widget-overflow-mainView > toolbarseparator,
#widget-overflow-mainView > .panel-subview-body > toolbarseparator,
.PanelUI-subView toolbarseparator,
#unified-extensions-panel toolbarseparator,
#permission-popup-mainView > toolbarseparator,
#editBookmarkPanel toolbarseparator,
#downloadsFooterButtons > toolbarseparator,
.cui-widget-panel toolbarseparator {
  margin: 0.4em 4px !important;
}
// menuseparator {
//   border-top: 1px solid !important;
//   border-color: get-var("menu-border-color") !important;
// }

toolbarbutton menupopup[placespopup] menuseparator::before {
  border-top: 1px solid !important;
  border-color: get-var("menu-border-color") !important;
}

// popup drop shadow
@media (-moz-platform: windows) {
  menupopup,
  panel:not(#autoscroller) {
    --panel-shadow-margin: 12px !important;
  }
}

menupopup,
panel:not(#autoscroller) {
  --panel-shadow: #{get-var("elevation-2")} !important;
}

dialog,
.dialogBox {
  .titleIcon {
    background-color: transparent !important;
  }
}

// menupopup and panel border width
@media (prefers-color-scheme: dark) {
  *[part="content"] {
    border-width: 2px !important;
  }
}

// --------
// Context menu icons
// Customize Toolbar… icon
// menuitem.viewCustomizeToolbar {
//   background-image: get-var("edit-icon") !important;
//   background-size: 16px !important;
//   background-repeat: no-repeat !important;
//   background-position: left 1em center !important;
//   -moz-context-properties: fill !important;
//   fill: get-var("icon-color-primary") !important;
// }

// [dir="rtl"] {
//   menuitem.viewCustomizeToolbar {
//       background-position: right 1em center !important;
//   }
// }
// --------

@media (-moz-platform: windows) {
  // context menu padding inline start
  menupopup {
    menuitem:not(.menuitem-iconic, [checked="true"]),
    menu:not(.menu-iconic) {
      padding-inline-start: 36px !important;
    }
  }
}
