/* Popup menus and context menus */

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

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

menupopup label {
	color: var(--gnome-toolbar-color) !important;
}

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

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;
}

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

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

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

/* Adjust popovers position */
panel[type="arrow"] {
	appearance: none !important;
	border: none !important;
	background-color: transparent !important;
	margin-top: 8px !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: none !important;
}

panelview {
	padding: 8px !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
	border-radius: 12px !important;
}

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

#BMB_bookmarksPopup {
	margin-top: 4px !important;
	padding: 0 !important;
	box-shadow: none !important;
	--panel-padding: 0 !important;
}

#BMB_bookmarksPopup menupopup {
	padding: 6px !important;
}

panel:not([remote]), #BMB_bookmarksPopup {
	--arrowpanel-background: var(--gnome-popover-background) !important;
}

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

.panel-header {
	padding: 0 0 10px 0 !important;
}
.panel-header + toolbarseparator,
#identity-popup-mainView-panel-header + toolbarseparator,
#permission-popup-mainView-panel-header + toolbarseparator,
#protections-popup-mainView-panel-header-section + toolbarseparator {
	display: none !important;
}
.panel-footer {
	background-color: transparent !important;
	display: flex;
	justify-content: flex-end;
	padding-top: 0px !important;
}
.panel-footer.panel-footer-menulike {
	border-top: 0 !important;
	margin-top: 8px !important;
}
.panel-footer toolbarseparator {
	display: none !important;
}
.proton-zap {
	border-image: unset !important;
}
.panel-subview-body {
	padding: 0 !important;
}
.panel-subview-footer {
	margin-top: 10px !important;
}

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

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

/* Menu buttons disabled */
menuitem[disabled="true"], menupopup menu[disabled="true"],
.subviewbutton[disabled="true"], .toolbarbutton-1[disabled="true"],
.protections-popup-category[disabled="true"],
.identity-popup-content-blocking-category[disabled="true"] {
	opacity: 0.5 !important;
/*	color: var(--gnome-inactive-toolbar-color) !important;*/
	background: none !important;
}

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

/* Menu buttons hover */
.toolbarbutton-1:not([disabled]):hover,
menuitem:not([disabled="true"]):is(:hover, [_moz-menuactive]),
menupopup menu:not([disabled="true"]):is(:hover, [_moz-menuactive]),
.subviewbutton:not([disabled="true"], #appMenu-zoom-controls2, #appMenu-fxa-label2):hover,
.protections-popup-footer-button:not([disabled="true"]):hover,
#protections-popup-show-report-stack:hover .protections-popup-footer-button,
.protections-popup-category:not([disabled="true"]):hover,
.identity-popup-content-blocking-category:not([disabled="true"]):hover,
#PlacesToolbar .bookmark-item:is(:hover, [open], [_moz-menuactive]),
#downloadsPanel-mainView .download-state:hover {
	background: var(--gnome-popover-button-hover-background) !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;
}

/* Auto complete popups */
panel[type="autocomplete-richlistbox"] {
	background: var(--gnome-menu-background) !important;
	border: 1px solid var(--gnome-menu-border-color) !important;
	padding: 4px 0 !important;
	color: var(--gnome-toolbar-color) !important;
}
.autocomplete-richlistbox {
	margin: 0 !important;
}

.autocomplete-richlistitem:not([type="loginsFooter"]) {
	color: var(--gnome-toolbar-color) !important;
	font: menu !important;
	margin: 0 !important;
}
.autocomplete-richlistitem:not([type="loginsFooter"]) .ac-site-icon {
	fill: var(--gnome-toolbar-color) !important;
	opacity: 0.5;
}
.autocomplete-richlistitem:not([type="loginsFooter"]):hover {
	color: #fff !important;
	background-color: Highlight !important;
}
.autocomplete-richlistitem:not([type="loginsFooter"]):hover .ac-site-icon {
	fill: #fff !important;
}
