/* MG Mobile Nav — vertical, mobile-friendly menu component.
   Uses Elementor color globals when available, falls back to safe defaults. */

.mg-mn {
	/* ── Colors ── */
	--mg-mn-fg:                 #ffffff;
	--mg-mn-fg-muted:           rgba(255, 255, 255, 0.7);
	--mg-mn-accent:             var(--e-global-color-accent, #83C760);
	--mg-mn-rule:               rgba(255, 255, 255, 0.1);
	--mg-mn-rule-width:         1px;
	--mg-mn-sub-bg:             rgba(0, 0, 0, 0.2);
	--mg-mn-sub-fg:             inherit;
	--mg-mn-bg:                 transparent;
	--mg-mn-bg-hover:           transparent;
	/* ── Toggle ── */
	--mg-mn-toggle-color:       inherit;
	--mg-mn-toggle-hover-color: var(--mg-mn-accent);
	--mg-mn-toggle-bg-hover:    rgba(255, 255, 255, 0.06);
	--mg-mn-toggle-size:        56px;
	--mg-mn-icon-size:          18px;
	/* ── Layout ── */
	--mg-mn-radius:             0px;
	--mg-mn-transition:         180ms;
	--mg-mn-ease:               cubic-bezier(.22, .61, .36, 1);

	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	color: var(--mg-mn-fg);
	font-family: inherit;
	line-height: 1.3;
}

/* Light theme override */
.mg-mn--theme-light {
	--mg-mn-fg:             #1a1f2e;
	--mg-mn-fg-muted:       rgba(26, 31, 46, 0.65);
	--mg-mn-rule:           rgba(0, 0, 0, 0.08);
	--mg-mn-sub-bg:         rgba(0, 0, 0, 0.03);
	--mg-mn-toggle-bg-hover: rgba(0, 0, 0, 0.04);
}

.mg-mn__list,
.mg-mn__sublist {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Divider between items */
.mg-mn__item {
	border-bottom: var(--mg-mn-rule-width) solid var(--mg-mn-rule);
}
.mg-mn__item:last-child {
	border-bottom: 0;
}

.mg-mn__row {
	display: flex;
	align-items: stretch;
	min-height: 56px;
}

.mg-mn__link {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	padding: 14px 18px;
	color: inherit;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;
	background: var(--mg-mn-bg);
	border-radius: var(--mg-mn-radius);
	transition:
		color     var(--mg-mn-transition) var(--mg-mn-ease),
		background var(--mg-mn-transition) var(--mg-mn-ease);
}
.mg-mn--align-center .mg-mn__link {
	justify-content: center;
	text-align: center;
}
.mg-mn__link:hover,
.mg-mn__link:focus-visible {
	color: var(--mg-mn-accent);
	background: var(--mg-mn-bg-hover);
	outline: none;
}
.mg-mn__item--current > .mg-mn__row > .mg-mn__link {
	color: var(--mg-mn-accent);
}

/* Submenu toggle button */
.mg-mn__toggle {
	flex: none;
	align-self: center;  /* don't stretch to row height — size from padding only */
	height: auto;        /* break any inherited stretch */
	padding: var(--mg-mn-toggle-pad, 8px);
	background: transparent;
	color: var(--mg-mn-toggle-color);
	border: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition:
		color     var(--mg-mn-transition) var(--mg-mn-ease),
		background var(--mg-mn-transition) var(--mg-mn-ease);
}
.mg-mn__toggle:hover,
.mg-mn__toggle:focus-visible {
	color: var(--mg-mn-toggle-hover-color);
	background: var(--mg-mn-toggle-bg-hover);
	outline: none;
}
.mg-mn__toggle svg {
	width: var(--mg-mn-icon-size);
	height: var(--mg-mn-icon-size);
	color: inherit; /* ensure color cascades from the button */
	transition: transform 240ms var(--mg-mn-ease);
}
.mg-mn__toggle svg path {
	stroke: currentColor; /* CSS beats SVG attribute — hover color changes flow through */
}
.mg-mn__toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* Submenu collapse — JS sets explicit max-height inline */
.mg-mn__sublist {
	max-height: 0;
	overflow: hidden;
	background: var(--mg-mn-sub-bg);
	transition: max-height 320ms var(--mg-mn-ease);
}
.mg-mn--start-expanded .mg-mn__sublist {
	max-height: none;
}
.mg-mn__item--has-children.is-open > .mg-mn__sublist {
	max-height: 2000px;
}

/* Parent links */
.mg-mn__link--parent {
	cursor: pointer;
}

/* ── Sub-item hierarchy: indented + slightly smaller.
   Specificity is intentionally 3 classes so the widget's sub_typography
   group control (4-class selector) can override font-size without !important. */
.mg-mn .mg-mn__sublist .mg-mn__link {
	padding-left: 36px;
	font-size: 0.9em;
	color: var(--mg-mn-sub-fg);
}
.mg-mn .mg-mn__sublist .mg-mn__sublist .mg-mn__link {
	padding-left: 56px;
	font-size: 0.9em;
}
.mg-mn .mg-mn__sublist .mg-mn__sublist .mg-mn__sublist .mg-mn__link {
	padding-left: 76px;
	font-size: 0.9em;
}

/* Center-aligned: no indent, size only */
.mg-mn--align-center .mg-mn__sublist .mg-mn__link,
.mg-mn--align-center .mg-mn__sublist .mg-mn__sublist .mg-mn__link {
	padding-left: 18px;
}

/* Larger tap targets on touch devices */
@media (hover: none) {
	.mg-mn__row { min-height: 60px; }
	.mg-mn__link { padding-top: 16px; padding-bottom: 16px; }
}
