.catmenu-toggle {
	cursor: pointer;
}

/* Override these variables from the theme to restyle the menu. */
.catmenu {
	--catmenu-bg: #fff;
	--catmenu-color: #1e1e1e;
	--catmenu-hover-bg: #f0f0f1;
	--catmenu-border: #dcdcde;
	--catmenu-radius: 6px;
	--catmenu-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);

	position: absolute;
	top: 0;
	left: 0;
	z-index: 99999;
	box-sizing: border-box;
	width: calc(100vw - 16px);
	padding: 4px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	color: var(--catmenu-color);
	font-size: 15px;
	line-height: 1.4;
	text-align: start;
	background: var(--catmenu-bg);
	border: 1px solid var(--catmenu-border);
	border-radius: var(--catmenu-radius);
	box-shadow: var(--catmenu-shadow);
}

.catmenu[hidden] {
	display: none;
}

.catmenu__empty {
	margin: 0;
	padding: 8px 12px;
}

.catmenu__root,
.catmenu__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.catmenu__item {
	margin: 0;
	padding: 0;
}

.catmenu__row {
	display: flex;
	align-items: stretch;
	border-radius: calc(var(--catmenu-radius) - 2px);
}

.catmenu__row:hover,
.catmenu__item.is-open > .catmenu__row {
	background: var(--catmenu-hover-bg);
}

.catmenu__link {
	flex: 1 1 auto;
	min-width: 0;
	padding: 8px 12px;
	color: inherit;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.catmenu__link:hover {
	color: inherit;
	text-decoration: none;
}

.catmenu__expand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	margin: 0;
	padding: 0;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.catmenu__expand:hover,
.catmenu__expand:focus {
	color: inherit;
	background: none;
}

.catmenu__link:focus-visible,
.catmenu__expand:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.catmenu__icon {
	transform: rotate(90deg);
	transition: transform 0.15s;
}

.catmenu__item.is-open > .catmenu__row .catmenu__icon {
	transform: rotate(-90deg);
}

/* Accordion: touch screens and narrow windows. */
.catmenu__sub {
	display: none;
	padding-inline-start: 16px;
}

.catmenu__item.is-open > .catmenu__sub {
	display: block;
}

/* Flyouts. Must match the media query in menu.js. */
@media (hover: hover) and (min-width: 768px) {
	.catmenu {
		width: max-content;
		min-width: 240px;
		max-width: 360px;
	}

	/* Fixed, so that the scrolling parent level does not clip it. Placed by menu.js. */
	.catmenu__sub {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 1;
		box-sizing: border-box;
		width: max-content;
		min-width: 220px;
		max-width: 320px;
		padding: 4px;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--catmenu-bg);
		border: 1px solid var(--catmenu-border);
		border-radius: var(--catmenu-radius);
		box-shadow: var(--catmenu-shadow);
	}

	.catmenu__icon,
	.catmenu__item.is-open > .catmenu__row .catmenu__icon {
		transform: none;
	}

	[dir="rtl"] .catmenu__icon,
	[dir="rtl"] .catmenu__item.is-open > .catmenu__row .catmenu__icon {
		transform: rotate(180deg);
	}
}
