.iea-megamenu {
	position: relative;
	width: 100%;
}

/* ---------- Top bar ---------- */
.iea-megamenu__bar {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 28px;
}

.iea-megamenu__item {
	margin: 0;
}

.iea-megamenu__trigger {
	display: flex;
	align-items: center;
	gap: 6px;
}

.iea-megamenu__link {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

/* Doubled-up selectors so these outrank the Elementor kit's global
   `.elementor-kit-* button` styles (background, padding, radius). */
.iea-megamenu .iea-megamenu__chevron-btn,
.iea-megamenu .iea-megamenu__chevron-btn:hover,
.iea-megamenu .iea-megamenu__chevron-btn:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	min-height: 0;
	color: inherit;
	font-size: inherit;
	line-height: 1;
	cursor: pointer;
}

.iea-megamenu__chevron {
	width: 14px;
	height: 14px;
	transition: transform 0.2s ease;
}

.iea-megamenu__item.is-open > .iea-megamenu__trigger .iea-megamenu__chevron {
	transform: rotate(180deg);
}

/* ---------- Panel ---------- */
.iea-megamenu__panel {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 999;
	background: #fff;
	background-size: cover;
	background-position: center;
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

/* Overlay tint layer (color set by the widget's Background Overlay control). */
.iea-megamenu__panel::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.iea-megamenu__item.is-open > .iea-megamenu__panel {
	display: block;
}

/* When "Stretch Panel To Viewport" is on, the JS measures the widget's
   viewport offset and sets left/width inline — CSS alone can't know where
   the widget sits in the viewport. */

.iea-megamenu__panel-inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: stretch;
}

/* Columns area: fills the space next to the promo card. */
.iea-megamenu__cols {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: center;
	column-gap: 64px;
	row-gap: 32px;
	padding: 40px;
}

.iea-megamenu__col {
	min-width: 160px;
}

/* Promo card: flush right, image background, button pinned to the bottom. */
.iea-megamenu__promo {
	flex: 0 0 auto;
	width: 320px;
	min-height: 220px;
	margin-left: auto;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: stretch;
	background-size: cover;
	background-position: center;
}

.iea-megamenu__promo-heading {
	display: block;
	padding: 16px 20px;
	font-weight: 700;
	color: #fff;
}

.iea-megamenu .iea-megamenu__promo-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	text-align: center;
	border-radius: 0;
}

.iea-megamenu__promo-chevron {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.iea-megamenu__col-title {
	display: block;
	margin-bottom: 16px;
	font-weight: 700;
	text-decoration: none;
	color: inherit;
}

.iea-megamenu__col-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	row-gap: 10px;
}

.iea-megamenu__col-list a {
	text-decoration: none;
	color: inherit;
}

/* Lone-column panels spread their links across two columns (the row count
   comes inline from the widget so links read top-to-bottom, then across). */
.iea-megamenu__col-list--two-col {
	display: grid;
	grid-auto-flow: column;
	column-gap: 48px;
}

/* ---------- Mobile drill-down ----------
   Separate markup from the desktop bar/panels; the per-instance breakpoint
   CSS swaps the bar out for this below the breakpoint. Tapping a row with
   children "drills" into its nested view; the back row returns. */
.iea-megamenu__mobile {
	display: none;
}

.iea-megamenu__mlist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.iea-megamenu__mlist li {
	margin: 0;
}

/* Dividers between rows at the root level only (matches the design:
   drilled link lists have no dividers). Inset from the right so the rule
   stops short of the edge, past the chevron. */
.iea-megamenu__mobile > .iea-megamenu__mview > .iea-megamenu__mlist > .iea-megamenu__mitem {
	position: relative;
}

.iea-megamenu__mobile > .iea-megamenu__mview > .iea-megamenu__mlist > .iea-megamenu__mitem + .iea-megamenu__mitem::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 18px;
	height: 1px;
	background: var(--iea-mm-mdivider, #eeeeee);
}

.iea-megamenu .iea-megamenu__mrow,
.iea-megamenu .iea-megamenu__mrow:hover,
.iea-megamenu .iea-megamenu__mrow:focus {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 14px 18px;
	margin: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	min-height: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.iea-megamenu__mchevron {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* Header row of a drilled view. The underline starts at the back chevron's
   left edge instead of running the full width. */
.iea-megamenu__mback {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
}

.iea-megamenu__mback::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 18px;
	right: 0;
	height: 1px;
	background: var(--iea-mm-mdivider, #eeeeee);
}

.iea-megamenu .iea-megamenu__mback-btn,
.iea-megamenu .iea-megamenu__mback-btn:hover,
.iea-megamenu .iea-megamenu__mback-btn:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
	min-height: 0;
	color: inherit;
	cursor: pointer;
}

.iea-megamenu__mback-title {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-decoration: none;
	color: inherit;
}

/* Group headers after the first have no back chevron; indent them so their
   titles align with the first header's title. */
.iea-megamenu__mback--nochev {
	padding-left: 48px;
}

.iea-megamenu__mback--nochev::after {
	left: 48px;
}

.iea-megamenu__mlist + .iea-megamenu__mback {
	margin-top: 10px;
}

/* Indent drilled rows so they align with the back-row title text. */
.iea-megamenu .iea-megamenu__mview .iea-megamenu__mview .iea-megamenu__mrow {
	padding-left: 48px;
}

/* Drill mechanics: nested views are hidden until their row is drilled;
   while drilled, the parent view shows only that branch. */
.iea-megamenu__mview .iea-megamenu__mview {
	display: none;
}

.iea-megamenu__mitem.is-drilled > .iea-megamenu__mview {
	display: block;
}

.iea-megamenu__mitem.is-drilled > .iea-megamenu__mrow {
	display: none;
}

.iea-megamenu__mview.has-drill > .iea-megamenu__mback {
	display: none;
}

.iea-megamenu__mview.has-drill > .iea-megamenu__mlist > .iea-megamenu__mitem:not(.is-drilled) {
	display: none;
}

.iea-megamenu__mview.has-drill > .iea-megamenu__mlist > .iea-megamenu__mitem::before {
	display: none;
}

/* ---------- Mobile toggle (shown via the per-instance breakpoint CSS) ---------- */
.iea-megamenu .iea-megamenu__toggle,
.iea-megamenu .iea-megamenu__toggle:hover,
.iea-megamenu .iea-megamenu__toggle:focus {
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--iea-mm-toggle-bg, transparent);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: var(--iea-mm-toggle-pad, 4px);
	margin: 0;
	min-height: 0;
	color: inherit;
	cursor: pointer;
}

.iea-megamenu__toggle svg {
	width: 28px;
	height: 28px;
}

.iea-megamenu__toggle-close {
	display: none;
}

.iea-megamenu--mobile-open .iea-megamenu__toggle-open {
	display: none;
}

.iea-megamenu--mobile-open .iea-megamenu__toggle-close {
	display: block;
}

/* ---------- Editor notice ---------- */
.iea-megamenu__notice {
	padding: 20px;
	text-align: center;
	color: #888;
	background: #f5f5f5;
	border: 1px dashed #ccc;
}
