/* Popup menus and context menus */

@import "popups-contents.css";
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

/* Style menus */
menupopup {
	-moz-appearance: none !important;
	--panel-background: var(--gnome-menu-background) !important;
	--panel-border-color: var(--gnome-menu-border-color) !important;
	--panel-border-radius: 3px !important;
	--panel-padding: 6px 0 !important;
	--panel-shadow: var(--gnome-popover-shadow) !important;
	--panel-shadow-margin: 3px 6px 8px !important;
	--arrowpanel-border-radius: 3px !important;
	--arrowpanel-background: var(--gnome-menu-background) !important;
	--arrowpanel-border-color: var(--gnome-menu-border-color) !important;
	color: var(--gnome-toolbar-color) !important;
}

panel {
	--panel-background: var(--gnome-menu-background) !important;
	--panel-border-color: var(--gnome-menu-border-color) !important;
}

.panel-arrowcontent {
	border: none !important;
}

:is(menupopup, panel)[type="arrow"] {
	--panel-border-radius: 3px !important;
	--panel-padding: 6px !important;
}

:is(panel, menupopup)::part(content) {
	border: none !important;
}

#PlacesToolbar menupopup[placespopup="true"]::part(content),
#PlacesToolbar menupopup[placespopup="true"]::part(arrowscrollbox),
#PlacesToolbar menupopup {
	padding: 0 !important;
	margin: -2px 0 0 -6px !important;
	border: none !important;
	box-shadow: none !important;
}

#PlacesToolbar menuitem, #PlacesToolbar menu, .subview-subheader, panelview .toolbarbutton-1, .subviewbutton, .widget-overflow-list .toolbarbutton-1 {
	appearance: none;
	margin: 1px 6px !important;
	min-height: 24px;
	padding: 4px 8px !important;
	border-radius: 2px !important;
	background-color: transparent;
}

menubar > menu > menupopup {
	border-top-left-radius: 0 !important;
	border-top-right-radius: 0 !important;
}

menuitem, menupopup menu {
	-moz-appearance: none !important;
	padding: 4px 8px !important;
	border: none !important;
	box-shadow: none !important;
}

menuitem[type="checkbox"] image, menuitem[type="radio"] image {
	visibility: visible !important;
}

menuitem[disabled="true"]:hover, menupopup menu[disabled="true"]:hover {
	background: transparent !important;
}

/* Adjust popovers position */
panel[type=arrow] {
	margin-top: 6px !important;
	appearance: none !important;
	border: none !important;
	background-color: transparent !important;
}

/* Style popovers */
.panel-arrowcontent .panel-arrowcontent,
.panel-header, .PanelUI-subView,
.panel-subview-body, #widget-overflow-mainView, #protections-popup-footer,
panelview {
	border: none !important;
	background: transparent !important;
}

.panel-arrowcontent {
	background: var(--gnome-popover-background) !important;
	border: 1px solid !important;
	border-color: var(--gnome-popover-border-color) !important;
	border-radius: 5px;
	color: var(--gnome-toolbar-color) !important;
}

.panel-arrow {
	fill: var(--gnome-popover-background) !important;
	stroke: var(--gnome-popover-border-color) !important;
}

.PanelUI-subView toolbarseparator:not([orient="vertical"]) {
	margin: 10px 2px !important;
}

.panel-header {
	padding: 0 0 10px 0 !important;
}
.panel-footer {
	background-color: transparent !important;
	display: flex;
	justify-content: flex-end;
	padding-top: 0px !important;
}
.panel-footer toolbarseparator {
	display: none !important;
}

.panel-subview-body {
	padding: 0 !important;
}
.panel-subview-footer {
	margin-top: 10px !important;
}

/* Style popovers menu buttons */
.subviewbutton:not(.subviewbutton-back),
.protections-popup-category,
.identity-popup-content-blocking-category {
	border-radius: 2px !important;
	color: var(--gnome-toolbar-color) !important;
	border: 1px solid transparent !important;
	font: menu !important;
}

.subviewbutton:not(.subviewbutton-back),
.protections-popup-category,
.identity-popup-content-blocking-category {
	padding: 5px !important;
}

.subviewbutton[disabled],
.protections-popup-category[disabled],
.identity-popup-content-blocking-category[disabled] {
	opacity: 0.5 !important;
}

.subviewbutton[shortcut]:after {
	opacity: 0.5 !important;
}

.subviewbutton:not([disabled]):hover, .protections-popup-category:not([disabled]):hover,
.identity-popup-content-blocking-category:not([disabled]):hover {
	background: var(--gnome-button-hover-background) !important;
	border-color: var(--gnome-button-border-color) !important;
}

.subviewbutton:not([disabled]):active, .protections-popup-category:not([disabled]):active,
.identity-popup-content-blocking-category:not([disabled]):active {
	background: var(--gnome-button-active-background) !important;
	border-color: var(--gnome-button-active-border-color) !important;
}

/* Style popover separators */
toolbarseparator, menuseparator {
	border-color: var(--gnome-popover-separator-color) !important;
}
toolbarseparator:not([orient="vertical"]) {
	margin: 8px 0 !important;
}
toolbarseparator[orient="vertical"] {
	margin: 0 3px !important;
}
