/* Divi Menu Submenu Collapse
   Layout and icon styles for the collapsed sub-menus. */

/* ---------- Collapsed state ---------- */

.dmsc-menu li.dmsc-has-children > ul.dmsc-sub {
	max-height: 0 !important;
	overflow: hidden !important;
	transition: max-height 0.3s ease;
	display: block !important; /* Divi hides mobile sub-menus in some versions */
	visibility: visible;
	opacity: 1;
}

.et_mobile_menu li.dmsc-has-children > ul.dmsc-sub {
	padding-left: 0;
}

.dmsc-menu li.dmsc-has-children.dmsc-open > ul.dmsc-sub {
	max-height: 9999px !important;
}


/* ---------- Inline icon: sits right after the menu name ---------- */

.dmsc-menu.dmsc-pos-inline li.dmsc-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

/* The link only takes the width of its text so the icon can sit beside it. */
.dmsc-menu.dmsc-pos-inline li.dmsc-has-children > a {
	flex: 0 1 auto;
	width: auto !important;
	display: inline-block !important;
}

.dmsc-menu.dmsc-pos-inline li.dmsc-has-children > .dmsc-toggle {
	position: static;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	margin-left: 2px;
}

/* The sub-menu drops to its own full-width row below the name + icon. */
.dmsc-menu.dmsc-pos-inline li.dmsc-has-children > ul.dmsc-sub {
	flex: 0 0 100%;
	width: 100%;
}

/* ---------- Far-right icon (optional setting) ---------- */

.dmsc-menu.dmsc-pos-right li.dmsc-has-children {
	position: relative;
}

.dmsc-menu.dmsc-pos-right li.dmsc-has-children > .dmsc-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 48px;
	height: 44px;
}

/* ---------- Toggle button ---------- */

.dmsc-toggle {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	line-height: 1;
	color: inherit;
	z-index: 5;
	-webkit-appearance: none;
	appearance: none;
}

.dmsc-toggle:hover,
.dmsc-toggle:focus {
	background: rgba(0, 0, 0, 0.04);
	outline: none;
}

.dmsc-toggle .dmsc-icon {
	position: relative;
	display: block;
	margin: 0 auto;
	width: 11px;
	height: 11px;
}

/* Plus / minus icon: two bars, one rotates away when open. */
.dmsc-plus .dmsc-icon::before,
.dmsc-plus .dmsc-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 11px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.25s ease;
}

.dmsc-plus .dmsc-icon::before {
	transform: translateY(-50%) rotate(90deg);
}

.dmsc-plus .dmsc-icon::after {
	transform: translateY(-50%);
}

.dmsc-menu li.dmsc-open > .dmsc-plus .dmsc-icon::before {
	transform: translateY(-50%) rotate(0deg);
}

/* Chevron icon: a rotating arrow head. */
.dmsc-chevron .dmsc-icon {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transform-origin: center;
	transition: transform 0.25s ease;
	top: -2px;
}

.dmsc-menu li.dmsc-open > .dmsc-chevron .dmsc-icon {
	transform: rotate(-135deg);
	top: 2px;
}

/* ---------- Divi overrides ---------- */

/* Some Divi versions force mobile sub-menus to stay visible. */
.et_mobile_menu .dmsc-has-children > ul.dmsc-sub.sub-menu {
	display: block !important;
}

/* Slightly smaller tap target on deeper levels. */
.dmsc-menu ul.dmsc-sub .dmsc-toggle {
	width: 30px;
	height: 30px;
}
