/* ==========================================================================
   Simple Mega Menu
   All selectors scoped under .mega-menu to avoid conflicts.
   Colors via CSS custom properties — set by plugin settings inline style.
   ========================================================================== */

/* ---------- Box Sizing ---------- */

.mega-menu,
.mega-menu *,
.mega-menu *::before,
.mega-menu *::after {
	box-sizing: border-box;
}

/* ---------- Reset & Container ---------- */

.mega-menu {
	position: relative;
}

.mega-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: var(--mm-justify, space-between);
	align-items: stretch;
	flex-wrap: wrap;
}

/* ---------- Top-Level Items ---------- */

.mega-menu__item {
	position: static; /* panels position relative to .mega-menu */
	padding: 0;
	margin: 0;
	list-style: none;
}

/* ---------- Trigger Buttons & Links (Top Level) ---------- */

.mega-menu__trigger {
	/* Reset button/link defaults */
	background: none;
	border: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;

	/* Styling */
	display: flex;
	align-items: center;
	outline: none;
	letter-spacing: 1.28px;
	color: var(--mm-toplevel-color, #fff);
	font-size: 1.6rem;
	font-weight: 600;
	text-transform: uppercase;
	text-decoration: none;
	padding: 18px 19px;
	line-height: 1.4;
	white-space: nowrap;
	transition: opacity 0.2s ease;
	position: relative;
}

.mega-menu__trigger:hover,
.mega-menu__trigger:focus-visible {
	color: var(--mm-toplevel-color, #fff);
}

/* Arrow indicator on open/hover */
.mega-menu__item.is-open > .mega-menu__trigger::after {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
	border-left: 14px solid transparent;
	border-right: 14px solid transparent;
	border-bottom: 14px solid var(--mm-arrow-color, #fff);
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	z-index: 11;
	pointer-events: none;
}

/* ---------- Caret Button (only present when item has children + URL) ---------- */
/* Hidden on desktop — hover handles the panel. Shown on mobile next to the
   link so the link can navigate while the caret toggles the accordion. */

.mega-menu__caret {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	color: inherit;
}

.mega-menu__caret-icon {
	display: inline-block;
	width: var(--mm-mobile-chevron, 8px);
	height: var(--mm-mobile-chevron, 8px);
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.3s ease;
}

.mega-menu__item.is-open > .mega-menu__caret > .mega-menu__caret-icon {
	transform: rotate(45deg);
}

/* ---------- Dropdown Panels ---------- */

.mega-menu__panel {
	position: absolute;
	left: 0;
	right: 0;
	/* When the panel anchors to a wrapper element (Wrapper ID setting), the
	   wrapper's bottom padding pushes the panel below .mega-menu's bottom edge,
	   creating a visual gap and breaking hover continuity. JS measures that gap
	   and stores it in --mm-bottom-gap so the panel is shifted UP to sit flush
	   against the trigger row. Defaults to 0 (no shift) when no wrapper is set. */
	top: calc(100% - var(--mm-bottom-gap, 0px));
	background: var(--mm-panel-bg, #fff);
	border: 1px solid var(--mm-panel-border, #3b6171);
	border-top: none;
	z-index: 10;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);

	/* Hidden by default — no transition on hide to prevent overlap flicker */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-1em);
}

.mega-menu__item.is-open > .mega-menu__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition:
		opacity 0.15s ease,
		transform 0.15s ease;
}

/* ---------- Panel Inner / Column Layout ---------- */

.mega-menu__panel-inner {
	max-width: var(--mm-panel-max-width, 1170px);
	margin: 0 auto;
	padding: 30px 25px;
}

.mega-menu__columns {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0 40px;
}

.mega-menu__column {
	flex: 0 0 auto;
	min-width: 180px;
	max-width: 280px;
	margin: 0 0 20px 0;
	padding: 0;
	list-style: none;
}

/* ---------- Column Count (cols-N on Level 1 item) ---------- */

.mega-menu__item.cols-2 .mega-menu__column,
.mega-menu__item.cols-3 .mega-menu__column,
.mega-menu__item.cols-4 .mega-menu__column,
.mega-menu__item.cols-5 .mega-menu__column,
.mega-menu__item.cols-6 .mega-menu__column {
	min-width: 0;
	max-width: none;
}

.mega-menu__item.cols-2 .mega-menu__column { flex: 1 1 calc((100% - 40px) / 2); }
.mega-menu__item.cols-3 .mega-menu__column { flex: 1 1 calc((100% - 80px) / 3); }
.mega-menu__item.cols-4 .mega-menu__column { flex: 1 1 calc((100% - 120px) / 4); }
.mega-menu__item.cols-5 .mega-menu__column { flex: 1 1 calc((100% - 160px) / 5); }
.mega-menu__item.cols-6 .mega-menu__column { flex: 1 1 calc((100% - 200px) / 6); }

/* ---------- Auto-Width Panels (auto-width on Level 1 item) ---------- */

.mega-menu__item.auto-width {
	position: relative;
}

.mega-menu__item.auto-width > .mega-menu__panel {
	left: auto;
	right: auto;
	width: auto;
	min-width: 200px;
}

.mega-menu__item.auto-width .mega-menu__panel-inner {
	max-width: none;
}

/* ---------- Column Headings (Depth 1) ---------- */

.mega-menu__heading {
	display: block;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 1.6rem;
	letter-spacing: 1.28px;
	color: var(--mm-heading-color, #141414);
	text-decoration: none;
	padding: 0 0 8px 0;
	margin-bottom: 5px;
	border-bottom: 1px solid var(--mm-heading-border, #e5e5e5);
	line-height: 1.3;
}

a.mega-menu__heading:hover,
a.mega-menu__heading:focus {
	color: var(--mm-label-color, #141414);
}

/* ---------- Flat Column Links (--flat at Depth 1) ---------- */

.mega-menu__column--flat a {
	display: block;
	padding: 5px 0;
	color: var(--mm-link-color, #7f98a3);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.3;
	text-decoration: none;
	transition: color 0.15s ease;
}

.mega-menu__column--flat a:hover,
.mega-menu__column--flat a:focus {
	color: var(--mm-link-hover, #3b6171);
}

/* ---------- Links (Depth 2) ---------- */

.mega-menu__links {
	list-style: none;
	margin: 0;
	padding: 0 0 0 10px;
}

.mega-menu__link {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu__link a {
	display: block;
	padding: 5px 0;
	color: var(--mm-link-color, #7f98a3);
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1.3;
	text-decoration: none;
	transition: color 0.15s ease;
}

.mega-menu__link a:hover,
.mega-menu__link a:focus {
	color: var(--mm-link-hover, #3b6171);
}

/* ---------- Plain Text Labels (--plain) ---------- */

.mega-menu__label {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu__label-text {
	display: block;
	color: var(--mm-label-color, #3b6171);
	font-weight: 600;
	font-size: 1.4rem;
	text-transform: uppercase;
	padding: 10px 0 2px 0;
	letter-spacing: 0.5px;
}

/* First label in a column doesn't need extra top padding */
.mega-menu__links > .mega-menu__label:first-child .mega-menu__label-text {
	padding-top: 2px;
}

/* ---------- Highlight (--highlight on any link item) ---------- */

.mega-menu__link.--highlight a,
.mega-menu__column--flat.--highlight a,
a.mega-menu__heading.--highlight,
.mega-menu__trigger.--highlight {
	color: var(--mm-highlight, #e74c3c);
}

.mega-menu__link.--highlight a:hover,
.mega-menu__link.--highlight a:focus,
.mega-menu__column--flat.--highlight a:hover,
.mega-menu__column--flat.--highlight a:focus {
	color: var(--mm-highlight, #e74c3c);
	opacity: 0.8;
}

/* ---------- Desktop-only hide (--hide-dt) ---------- */
/* Items with this class are hidden on desktop, visible only in mobile drawer. */
.mega-menu:not(.mega-menu--mobile) .--hide-dt {
	display: none !important;
}

/* ---------- Text style helpers ---------- */
.mega-menu .--bold > .mega-menu__trigger,
.mega-menu .--bold.mega-menu__column--flat > a,
.mega-menu .--bold > .mega-menu__heading,
.mega-menu .--bold.mega-menu__link > a {
	font-weight: 700 !important;
}
.mega-menu .--underline > .mega-menu__trigger,
.mega-menu .--underline.mega-menu__column--flat > a,
.mega-menu .--underline > .mega-menu__heading,
.mega-menu .--underline.mega-menu__link > a {
	text-decoration: underline !important;
}

/* ==========================================================================
   MOBILE STYLES (Off-Screen Drawer Menu)
   Activated when .mega-menu has --mm-breakpoint:1 inline style (below 1030px)
   All mobile styles scoped under .mega-menu--mobile
   ========================================================================== */

/* ---------- Hamburger Button ---------- */

.mega-menu__hamburger {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	background: none;
	border: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
	width: 28px;
	height: 22px;
	position: relative;
	z-index: 1000;
	flex-shrink: 0;
}

.mega-menu__hamburger-bar {
	display: block;
	width: 22px;
	height: 3px;
	background-color: var(--mm-hamburger-color, #141414);
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.mega-menu__hamburger.is-active .mega-menu__hamburger-bar:nth-child(1) {
	transform: translateY(9.5px) rotate(45deg);
}

.mega-menu__hamburger.is-active .mega-menu__hamburger-bar:nth-child(2) {
	opacity: 0;
}

.mega-menu__hamburger.is-active .mega-menu__hamburger-bar:nth-child(3) {
	transform: translateY(-9.5px) rotate(-45deg);
}

/* ---------- Overlay Backdrop ---------- */

.mega-menu__overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.mega-menu--mobile-open .mega-menu__overlay {
	display: block;
	opacity: 1;
	pointer-events: auto;
}

/* ---------- Drawer Wrapper ---------- */

.mega-menu__drawer {
	display: contents; /* transparent on desktop */
}

/* Drawer direction: left (default) or right via --mm-drawer-direction */
.mega-menu--mobile .mega-menu__drawer {
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0;
	width: 90vw;
	max-width: 440px;
	height: 100vh;
	height: 100dvh;
	background-color: var(--mm-mobile-bg, var(--mm-panel-bg, #fff));
	/* High z-index so the drawer stacks above the hamburger toggle (which is
	   z-index: 1000) — important when the drawer slides in from the right and
	   the toggle sits on the right side of the page. */
	z-index: 9999;
	transition: transform 0.3s ease;
	overflow: hidden;
}

/* Left (default) */
.mega-menu--mobile .mega-menu__drawer {
	left: 0;
	right: auto;
	transform: translateX(-100%);
}

.mega-menu--mobile-open .mega-menu__drawer {
	transform: translateX(0);
}

/* Right */
.mega-menu--drawer-right.mega-menu--mobile .mega-menu__drawer {
	left: auto;
	right: 0;
	transform: translateX(100%);
}

.mega-menu--drawer-right.mega-menu--mobile-open .mega-menu__drawer {
	transform: translateX(0);
}

/* WP admin bar offset */
body.admin-bar .mega-menu--mobile .mega-menu__drawer {
	top: 32px;
	height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .mega-menu--mobile .mega-menu__drawer {
		top: 46px;
		height: calc(100dvh - 46px);
	}
}

/* ---------- Drawer Header (close + search slot) ---------- */

.mega-menu__drawer-header {
	display: none;
}

.mega-menu--mobile .mega-menu__drawer-header {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	padding: 16px 20px;
	border-bottom: 1px solid var(--mm-mobile-border, var(--mm-heading-border, #e5e5e5));
	gap: 12px;
}

/* Close button */
.mega-menu__close {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	padding: 4px;
	width: 32px;
	height: 32px;
	color: var(--mm-mobile-text, var(--mm-heading-color, #141414));
	border-radius: 4px;
	transition: background-color 0.15s ease;
	align-self: flex-end;
}

.mega-menu__close:hover,
.mega-menu__close:focus-visible {
	background-color: rgba(0, 0, 0, 0.05);
}

/* ---------- Drawer Search ---------- */

.mega-menu__search {
	display: none;
}

.mega-menu--mobile .mega-menu__search {
	display: flex;
	align-items: center;
	border: 1px solid var(--mm-heading-border, #e5e5e5);
	border-radius: 4px;
	overflow: hidden;
	background: #f8f8f8;
}

/* Custom shortcode search: remove built-in constraints so the plugin's own styles work. */
.mega-menu--mobile .mega-menu__search--custom {
	display: block;
	border: none;
	border-radius: 0;
	overflow: visible;
	background: transparent;
}

/* Force third-party search widgets inside the drawer to be visible.
   Plugins like AWS hide duplicate instances; we override that here.
   Scoped to .mega-menu--mobile to avoid affecting desktop instances. */
.mega-menu--mobile .mega-menu__search--custom > * {
	display: block !important;
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.mega-menu__search-input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 12px;
	font-size: 1.4rem;
	font-family: inherit;
	color: var(--mm-heading-color, #141414);
	outline: none;
	min-width: 0;
}

.mega-menu__search-input::placeholder {
	color: var(--mm-link-color, #7f98a3);
}

.mega-menu__search-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 10px 12px;
	color: var(--mm-heading-color, #141414);
	flex-shrink: 0;
}

.mega-menu__search-btn:hover {
	color: var(--mm-link-hover, #3b6171);
}

/* ---------- Drawer Social Icons ---------- */

.mega-menu__social {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.mega-menu__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--mm-heading-color, #141414);
	text-decoration: none;
	transition: opacity 0.15s ease;
	width: 36px;
	height: 36px;
}

.mega-menu__social-link:hover {
	opacity: 0.7;
}

/* ---------- Drawer Footer Hook Slot ---------- */

.mega-menu__drawer-bottom {
	display: none;
}

.mega-menu--mobile .mega-menu__drawer-bottom {
	display: flex;
	flex-direction: column;
	gap: 16px;
	flex-shrink: 0;
	padding: 20px;
	margin-top: auto;
	border-top: 1px solid var(--mm-heading-border, #e5e5e5);
}

/* Custom HTML / shortcode block (CTA button, language switcher, etc.).
   The block fills the drawer footer width; child elements (button + language
   switcher) lay out side-by-side via flexbox. */
.mega-menu__drawer-custom {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.mega-menu__drawer-custom > * {
	margin: 0;
}

/* ---------- Off-Screen Menu List ---------- */

.mega-menu--mobile .mega-menu__list {
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	flex-wrap: nowrap;
	flex-grow: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0;
	padding: 0;
}

/* ---------- Mobile Menu Items ---------- */

.mega-menu--mobile .mega-menu__item {
	position: static;
	border-bottom: 1px solid var(--mm-mobile-border, var(--mm-heading-border, #e5e5e5));
	margin: 0;
	padding: 0;
}

.mega-menu--mobile .mega-menu__trigger {
	width: 100%;
	justify-content: space-between;
	align-items: center;
	padding: 15px 20px;
	font-size: var(--mm-mobile-font-trigger, 1.4rem);
	color: var(--mm-mobile-text, var(--mm-heading-color, #141414));
	letter-spacing: 0.8px;
	text-transform: uppercase;
	text-align: left;
	white-space: normal;
	line-height: 1.4;
}

.mega-menu--mobile .mega-menu__trigger:hover,
.mega-menu--mobile .mega-menu__trigger:focus-visible {
	color: var(--mm-mobile-text, var(--mm-heading-color, #141414));
	background-color: rgba(0, 0, 0, 0.02);
}

/* Chevron indicator for items with children (button-only triggers, no URL).
   When the item has a separate caret button, the rule below hides this chevron
   so we don't show two of them. */
.mega-menu--mobile .mega-menu__item--has-children > .mega-menu__trigger::after {
	content: "";
	display: inline-block;
	width: var(--mm-mobile-chevron, 8px);
	height: var(--mm-mobile-chevron, 8px);
	border-right: 2px solid var(--mm-mobile-text, var(--mm-heading-color, #141414));
	border-bottom: 2px solid var(--mm-mobile-text, var(--mm-heading-color, #141414));
	transform: rotate(-45deg);
	transition: transform 0.3s ease;
	margin-left: auto;
	flex-shrink: 0;
}

.mega-menu--mobile .mega-menu__item.is-open > .mega-menu__trigger::after {
	transform: rotate(45deg);
}

/* When the item has a separate caret button, hide the trigger's own chevron. */
.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__trigger::after {
	display: none;
}

/* ---------- Mobile Layout: Link + Caret (item with URL + children) ---------- */
/* The item becomes a wrapping flex row: link fills available space, caret has
   a fixed width on the right, panel wraps to its own row below. */

.mega-menu--mobile .mega-menu__item--has-caret {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
}

.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__trigger {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
}

.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__caret {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 56px;
	align-self: stretch;
	color: var(--mm-mobile-text, var(--mm-heading-color, #141414));
	border-left: 1px solid var(--mm-mobile-border, var(--mm-heading-border, #e5e5e5));
	transition: background-color 0.15s ease;
}

.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__caret:hover,
.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__caret:focus-visible {
	background-color: rgba(0, 0, 0, 0.04);
	outline: none;
}

/* Panel must occupy a full row below the link/caret pair, otherwise flexbox
   would lay it out as a third column. */
.mega-menu--mobile .mega-menu__item--has-caret > .mega-menu__panel {
	flex: 1 0 100%;
	width: 100%;
}

/* Remove desktop arrow indicator on mobile */
.mega-menu--mobile .mega-menu__item.is-open > .mega-menu__trigger::after {
	/* Reset the desktop triangle arrow — mobile uses its own chevron */
	position: static;
	width: var(--mm-mobile-chevron, 8px);
	height: var(--mm-mobile-chevron, 8px);
	border-left: none;
	border-right: 2px solid var(--mm-mobile-text, var(--mm-heading-color, #141414));
	border-bottom: 2px solid var(--mm-mobile-text, var(--mm-heading-color, #141414));
	border-top: none;
	transform: rotate(45deg);
	left: auto;
	bottom: auto;
	z-index: auto;
	pointer-events: auto;
	margin-left: auto;
	flex-shrink: 0;
}

/* ---------- Mobile Accordion Panels ---------- */

.mega-menu--mobile .mega-menu__panel {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	background: transparent;
	border: none;
	box-shadow: none;
	z-index: auto;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s ease;
	padding: 0;
	margin: 0;
}

.mega-menu--mobile .mega-menu__item.is-open > .mega-menu__panel {
	max-height: 3000px;
}

/* ---------- Mobile Panel Inner / Column Layout ---------- */

.mega-menu--mobile .mega-menu__panel-inner {
	max-width: none;
	padding: 0;
	margin: 0;
}

.mega-menu--mobile .mega-menu__columns {
	flex-direction: column;
	gap: 0;
	flex-wrap: nowrap;
}

.mega-menu--mobile .mega-menu__column {
	flex: none;
	min-width: auto;
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--mm-mobile-border, var(--mm-heading-border, #e5e5e5));
}

.mega-menu--mobile .mega-menu__column:last-child {
	border-bottom: none;
}

/* Override all cols-N rules on mobile */
.mega-menu--mobile .mega-menu__item.cols-2 .mega-menu__column,
.mega-menu--mobile .mega-menu__item.cols-3 .mega-menu__column,
.mega-menu--mobile .mega-menu__item.cols-4 .mega-menu__column,
.mega-menu--mobile .mega-menu__item.cols-5 .mega-menu__column,
.mega-menu--mobile .mega-menu__item.cols-6 .mega-menu__column {
	flex: none;
	min-width: auto;
	max-width: 100%;
	width: 100%;
}

/* ---------- Nested Accordion: Column Headings ---------- */

.mega-menu--mobile .mega-menu__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: var(--mm-mobile-font-heading, 1.3rem);
	font-weight: 700;
	padding: 12px 20px 12px 30px;
	margin-bottom: 0;
	border-bottom: none;
	color: var(--mm-mobile-heading, var(--mm-heading-color, #141414));
	text-decoration: none;
	cursor: pointer;
}

/* Chevron on column headings (nested accordion) — only used when the heading
   is the click target (no separate caret button, e.g. when the menu item has
   no real URL). For columns with a caret button, this chevron is hidden by
   the .mega-menu__column--has-caret rule below. */
.mega-menu--mobile .mega-menu__heading::after {
	content: "";
	display: inline-block;
	width: calc(var(--mm-mobile-chevron, 8px) - 2px);
	height: calc(var(--mm-mobile-chevron, 8px) - 2px);
	border-right: 2px solid var(--mm-mobile-link, var(--mm-link-color, #7f98a3));
	border-bottom: 2px solid var(--mm-mobile-link, var(--mm-link-color, #7f98a3));
	transform: rotate(-45deg);
	transition: transform 0.3s ease;
	margin-left: auto;
	flex-shrink: 0;
}

.mega-menu--mobile .mega-menu__column.is-col-open > .mega-menu__heading::after {
	transform: rotate(45deg);
}

/* ---------- Mobile Layout: Column with separate caret (link + caret) ---------- */
/* Same pattern as top-level items with caret. Heading link sits on the left
   and navigates; caret button on the right toggles the nested accordion. */

.mega-menu--mobile .mega-menu__column--has-caret {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
}

.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__heading {
	flex: 1 1 auto;
	min-width: 0;
	justify-content: flex-start;  /* override the space-between used for chevron */
}

/* Hide the heading's built-in chevron — caret button has its own */
.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__heading::after {
	display: none;
}

.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__caret--column {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 56px;
	align-self: stretch;
	color: var(--mm-mobile-link, var(--mm-link-color, #7f98a3));
	border-left: 1px solid var(--mm-mobile-border, var(--mm-heading-border, #e5e5e5));
	transition: background-color 0.15s ease;
}

.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__caret--column:hover,
.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__caret--column:focus-visible {
	background-color: rgba(0, 0, 0, 0.04);
	outline: none;
}

/* The links list must occupy a full row below the heading/caret pair */
.mega-menu--mobile .mega-menu__column--has-caret > .mega-menu__links {
	flex: 1 0 100%;
	width: 100%;
}

/* Rotate caret icon when column is open (mirrors the heading chevron behavior) */
.mega-menu--mobile .mega-menu__column.is-col-open > .mega-menu__caret--column > .mega-menu__caret-icon {
	transform: rotate(45deg);
}

/* ---------- Nested Accordion: Link Lists ---------- */

.mega-menu--mobile .mega-menu__links {
	padding: 0;
	list-style: none;
	margin: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.mega-menu--mobile .mega-menu__column.is-col-open > .mega-menu__links {
	max-height: 1000px;
}

.mega-menu--mobile .mega-menu__link {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu--mobile .mega-menu__link a {
	display: flex;
	align-items: center;
	padding: 10px 20px 10px 40px;
	color: var(--mm-mobile-link, var(--mm-link-color, #7f98a3));
	font-size: var(--mm-mobile-font-link, 1.3rem);
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.15s ease;
	min-height: 44px;
}

.mega-menu--mobile .mega-menu__link a:hover,
.mega-menu--mobile .mega-menu__link a:focus {
	color: var(--mm-mobile-link-hover, var(--mm-link-hover, #3b6171));
}

/* Flat column links on mobile */
.mega-menu--mobile .mega-menu__column--flat a {
	display: flex;
	align-items: center;
	padding: 10px 20px 10px 30px;
	color: var(--mm-mobile-link, var(--mm-link-color, #7f98a3));
	font-size: var(--mm-mobile-font-link, 1.3rem);
	font-weight: 400;
	line-height: 1.4;
	text-decoration: none;
	min-height: 44px;
}

.mega-menu--mobile .mega-menu__column--flat a:hover,
.mega-menu--mobile .mega-menu__column--flat a:focus {
	color: var(--mm-mobile-link-hover, var(--mm-link-hover, #3b6171));
}

/* Plain text labels on mobile */
.mega-menu--mobile .mega-menu__label {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mega-menu--mobile .mega-menu__label-text {
	display: block;
	color: var(--mm-label-color, #3b6171);
	font-weight: 600;
	font-size: 1.2rem;
	text-transform: uppercase;
	padding: 8px 20px 2px 40px;
	letter-spacing: 0.5px;
}

/* ---------- Highlight overrides on mobile ---------- */

.mega-menu--mobile .mega-menu__trigger.--highlight {
	color: var(--mm-mobile-highlight, var(--mm-highlight, #e74c3c));
}

/* ---------- Body Scroll Lock ---------- */

body.mega-menu-drawer-open {
	overflow: hidden;
}
