/* 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;
	background: var(--sweet-menu-background) !important;
	border: 1px solid var(--sweet-menu-border-color) !important;
	border-radius: 5px;
	padding: 4px 0 !important;
	color: var(--sweet-toolbar-color) !important;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1) !important;
}
#PlacesToolbar menupopup {
	background: var(--sweet-popover-background) !important;
	padding: 4px !important;
}
.menupopup-arrowscrollbox {
	background: none !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

menuitem, menupopup menu {
	-moz-appearance: none !important;
	padding: 4px 8px !important;
	margin: 0 !important;
	color: var(--sweet-popover-color) !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: 8px !important;
}

/* Style popovers */
.panel-arrowcontent,
.panel-header, .PanelUI-subView,
.panel-subview-body, #widget-overflow-mainView, #protections-popup-footer,
panelview {
	border: 0 !important;
	background: transparent !important;
}
.panel-arrowcontent {
	background: var(--arrowpanel-background) !important;
	border: 1px solid !important;
	border-color: var(--sweet-popover-border-color) !important;
	border-radius: 9px !important;
	color: var(--sweet-toolbar-color) !important;
}
.panel-arrow {    
	fill: var(--arrowpanel-background) !important;
	stroke: var(--sweet-popover-border-color) !important;
	display: -moz-inline-box !important;
}
panel:not([remote]), #BMB_bookmarksPopup {
	--arrowpanel-background: var(--sweet-popover-background) !important;
	--arrowpanel-border-color: var(--sweet-popover-border-color) !important;
}

panel {
	--panel-padding: 12px !important;
}
.panel-no-padding panelview, .panel-no-padding > .panel-subview-body, .panel-no-padding > .panel-header {
	padding: var(--panel-padding) !important;
}
.panel-no-padding > .panel-header {
	padding-bottom: 0 !important;
}
panel[type="arrow"].panel-no-padding::part(content) {
	padding: var(--panel-padding) !important;
}

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

.panel-header {
	padding: 0 0 10px 0 !important;
	position: relative !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 */
menuitem, menupopup menu,
panelview .subviewbutton:not(#appMenu-fxa-label2),
panelview .toolbarbutton-1,
.protections-popup-footer-button,
.protections-popup-category,
.identity-popup-content-blocking-category,
#PlacesToolbar .bookmark-item,
#downloadsPanel-mainView .download-state {
	-moz-appearance: none !important;
	border-radius: 6px !important;	
	color: var(--sweet-toolbar-color) !important;
	font: menu !important;
	padding: 4px 12px !important;
	min-height: 32px !important;
}
.subviewbutton,
.protections-popup-footer-button,
.protections-popup-category,
.identity-popup-content-blocking-category,
#PlacesToolbar menupopup[placespopup="true"] .bookmark-item,
.openintabs-menuitem,
.widget-overflow-list .toolbarbutton-1 {
	margin: 0 !important;
}

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

.bookmark-item .menu-right {
	fill-opacity: 1 !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: .5 !important;
}
menuitem[disabled="true"][_moz-menuactive], menupopup menu[disabled="true"][_moz-menuactive] {
	background: transparent !important;
}

/* Menu buttons 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(--sweet-popover-button-hover-background) !important;
}

/* Menu buttons fix */
#appMenu-fxa-label2 {
	padding: 0 !important;
}
#appMenu-fxa-label2:hover {
	background: transparent !important;
}

/* Menu buttons back */
.subviewbutton-back {
	opacity: 1 !important;
	width: 100%;
	-moz-box-align: center !important;
	-moz-box-pack: start !important;
	padding: 10px !important;
}
.subviewbutton-back + h1 {
	font-weight: bold !important;
	left: 0 !important;
	padding: 0 !important;
	pointer-events: none;
	position: absolute !important;
	top: 10px !important;
	width: 100%;
}

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