/**
 * Theme Builder header: bar alignment, desktop mega panel width/position, mobile sheet, CTA.
 * Scoped to .elementor-location-header — no Elementor element IDs (those change per env).
 *
 * Submenus span the inset header inner bar (same edges as logo / nav); see .e-n-menu-content rules below.
 */

.elementor-location-header .e-con.e-parent {
	/* Match page: .e-flexbox-base padding + Tivity module width (see tivity-widget-width.css). */
	--padding-left: var(--tivity-elementor-flex-inset);
	--padding-right: var(--tivity-elementor-flex-inset);
	--padding-inline-start: var(--tivity-elementor-flex-inset);
	--padding-inline-end: var(--tivity-elementor-flex-inset);
	--container-max-width: var(--tivity-block-width-full);
	/* Theme Builder header CSS sets --content-width: 1800px; override so inner bar aligns with modules. */
	--content-width: min(var(--tivity-block-max-full), calc(100% - var(--tivity-block-gutter-total))) !important;
}

.elementor-location-header .e-con.e-parent > .e-con-inner {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: min(var(--tivity-block-max-full), calc(100% - var(--tivity-block-gutter-total)));
	margin-inline: auto;
}

/* Dropdown anchors to .e-con-inner (already aligned with page modules); don’t inset again. */
.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) {
	--tivity-mega-dropdown-max-width: 100%;
}

.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-content > .e-con {
	width: 100% !important;
	max-width: 100% !important;
	margin-inline: 0 !important;
}

/* --- Desktop horizontal menu --- */

/* Widget root is position:relative in Elementor — dropdown would align to nav column only (excludes logo). */
.elementor-location-header .elementor-widget-n-menu:has(.e-n-menu:not([data-layout="dropdown"])),
.elementor-location-header .elementor-widget-mega-menu:has(.e-n-menu:not([data-layout="dropdown"])) {
	position: static !important;
	flex: 1 1 auto;
	min-width: 0;
}

.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) {
	position: static !important;
	width: 100%;
}

.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-wrapper,
.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-heading {
	width: 100%;
}

.elementor-location-header .e-n-menu-heading {
	anchor-name: --tivity-menu-bar;
}

/*
 * Panel spans header .e-con-inner (logo + nav), not the menu widget box.
 * Requires menu widget position:static so this absolute box anchors to .e-con-inner.
 */
.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-content {
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	width: auto !important;
	max-width: none !important;
	top: anchor(--tivity-menu-bar bottom) !important;
	margin: 0 !important;
}

/* Push search + CTA to the right; spacer on first action item only. */
.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-item:has(#header-search) {
	margin-inline-start: auto;
}

.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-heading:not(:has(#header-search)) .e-n-menu-item:has(#get-in-touch) {
	margin-inline-start: auto;
}

.elementor-location-header .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-item:has(#header-search) + .e-n-menu-item:has(#get-in-touch) {
	margin-inline-start: 16px;
}

.elementor-location-header #header-search .e-n-menu-title {
	padding: 8px !important;
	min-height: auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.elementor-location-header #header-search .e-n-menu-title-container {
	display: flex;
	align-items: center;
}

.elementor-location-header #header-search .e-n-menu-icon {
	display: flex;
	align-items: center;
	line-height: 0;
}

.elementor-location-header #header-search .e-n-menu-title-text:not(:empty) {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.elementor-location-header #get-in-touch {
	background-color: transparent;
	border-radius: 0;
	padding: 0 !important;
}

.elementor-location-header #get-in-touch a.e-n-menu-title-container {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 12px 22px !important;
	border-radius: 999px;
	background-color: #000;
	color: #fff !important;
	font-family: "Instrument Sans", sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color var(--n-menu-title-transition, 0.2s) ease, color var(--n-menu-title-transition, 0.2s) ease;
}

.elementor-location-header #get-in-touch a.e-n-menu-title-container:hover,
.elementor-location-header #get-in-touch a.e-n-menu-title-container:focus-visible {
	background-color: var(--Orange, #ff3600);
	color: #fff !important;
}

.elementor-location-header #get-in-touch .e-n-menu-title-text {
	color: inherit !important;
}

/*
 * Parent items with a mega panel: flip the dropdown chevron on hover / when open.
 * (Elementor toggles opened/closed icon markup; rotate keeps a consistent “panel open” cue.)
 */
.elementor-location-header .e-n-menu .e-n-menu-title .e-n-menu-dropdown-icon {
	transition: transform var(--n-menu-title-transition, 0.3s) ease;
}

.elementor-location-header .e-n-menu .e-n-menu-item:has(.e-n-menu-dropdown-icon):hover .e-n-menu-dropdown-icon,
.elementor-location-header .e-n-menu .e-n-menu-item:has(.e-n-menu-dropdown-icon):focus-within .e-n-menu-dropdown-icon,
.elementor-location-header .e-n-menu .e-n-menu-title.e-current .e-n-menu-dropdown-icon,
.elementor-location-header .e-n-menu .e-n-menu-dropdown-icon[aria-expanded="true"] {
	transform: rotate(90deg);
}

/* --- Mobile / tablet dropdown layout (≤1200px; see --tivity-mega-nav-mobile-max) --- */

.elementor-location-header .e-con.e-parent:has(.e-n-menu[data-layout="dropdown"]) {
	--padding-top: 16px;
	--padding-bottom: 16px;
	--padding-block-start: 16px;
	--padding-block-end: 16px;
}

.elementor-location-header .elementor-widget-n-menu:has(.e-n-menu[data-layout="dropdown"]),
.elementor-location-header .elementor-widget-mega-menu:has(.e-n-menu[data-layout="dropdown"]) {
	position: static !important;
	margin-inline-start: auto;
	flex: 0 0 auto;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] {
	position: static !important;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-toggle {
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
}

@media (max-width: 1200px) {
	.elementor-location-header .e-n-menu-toggle {
		display: flex !important;
	}

	/*
	 * Elementor’s menu breakpoint may still be 1024px while we use 1200px for the sheet.
	 * Without this, 1025–1200px keeps --n-menu-wrapper-display:flex and the nav looks open.
	 */
	.elementor-location-header .e-n-menu[data-layout="dropdown"] {
		--n-menu-wrapper-display: none;
	}

	.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-toggle[aria-expanded="true"] + .e-n-menu-wrapper {
		--n-menu-wrapper-display: flex;
	}
}

@media (min-width: 1201px) {
	.elementor-location-header .e-n-menu-toggle {
		display: none !important;
	}
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-wrapper {
	position: absolute !important;
	top: 100% !important;
	left: calc(var(--padding-left, 20px) * -1) !important;
	right: calc(var(--padding-right, 20px) * -1) !important;
	width: auto !important;
	background: #fff;
	border-radius: 0 !important;
	z-index: 40;
	box-shadow: 0 16px 28px rgba(0, 0, 0, 0.08);
	padding: 0 0 8px;
	margin: 0 !important;
	max-height: calc(100dvh - 80px);
	overflow: auto;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-heading {
	flex-direction: column !important;
	align-items: stretch !important;
	width: 100% !important;
	gap: 0 !important;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-item {
	width: 100%;
	border-bottom: 1px solid #e6e8ec;
	margin: 0;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-title {
	width: 100%;
	min-height: 56px;
	padding: 16px 20px !important;
	box-sizing: border-box;
	box-shadow: none !important;
	background-color: transparent;
	border-radius: 0;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-item:not(:has(#get-in-touch)) .e-n-menu-title:hover {
	background-color: #f4f6f8;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] #get-in-touch {
	box-shadow: none !important;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] #get-in-touch a.e-n-menu-title-container {
	width: 100%;
	min-height: 48px;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-content {
	position: static !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	box-shadow: none !important;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-content > .e-con,
.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-content > .e-con > .e-con-inner {
	flex-direction: column !important;
	width: 100% !important;
	max-width: none !important;
	border-radius: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
}

/*
 * Mobile sheet: mega panel — hide column photos, one text column, padding matches top-level items (16px 20px).
 */
.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-content {
	--tivity-menu-col-padding-block: 16px;
	--tivity-menu-col-padding-inline: 20px;
	--tivity-menu-col-padding-inline-start-first: 20px;
	--tivity-menu-promo-padding-inline-start: 20px;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col--image-only {
	display: none;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col__media {
	display: none;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col--reserve-top-band::before,
.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links--reserve-top-band::before {
	display: none;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col--reserve-top-band,
.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links--reserve-top-band {
	gap: 0;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col__main {
	grid-template-columns: minmax(0, 1fr) !important;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col.tivity-menu-col--has-right-border .tivity-menu-col__main {
	border-right: 0;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-col,
.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links,
.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-promo {
	border-radius: 0;
}

/* Dividers: parent link → panel, each stacked widget, link-list rows. */
.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-item > .e-n-menu-content {
	border-top: 1px solid #e6e8ec;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-content > .e-con > .e-con-inner > .elementor-element + .elementor-element {
	border-top: 1px solid #e6e8ec;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links__item {
	border-bottom-color: #e6e8ec;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links__item:first-child {
	border-top: none;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .tivity-menu-links__item:last-child {
	border-bottom: none;
}

.elementor-location-header .e-n-menu[data-layout="dropdown"] .e-n-menu-item:has(#get-in-touch) {
	margin: 16px 0 8px;
	padding: 0 20px;
	width: 100%;
	box-sizing: border-box;
	border-top: 1px solid #e6e8ec;
	border-bottom: 0;
}
