/* =========================================================
   Legacy Financial — Mobile / Tablet Header
   Visible only at ≤ 1024px; hides the desktop header.
   Font: Quicksand (already enqueued via functions.php)
   ========================================================= */

@media (max-width: 1024px) {
	.lf-header {
		display: none;
	}
}

/* ---- Header wrapper — hidden on desktop ---- */
.lfm-header {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1001;
	font-family: 'Quicksand', sans-serif;
}

@media (max-width: 1024px) {
	.lfm-header {
		display: block;
	}
}

/* ---- Header bar (logo + toggle) ---- */
.lfm-header__bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	height: 70px;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(30px);
	-webkit-backdrop-filter: blur(30px);
	box-sizing: border-box;
}

/* ---- Logo ---- */
.lfm-header__logo,
.lfm-header__logo a,
.lfm-header__logo-link {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.lfm-header__logo img,
.lfm-header__logo .custom-logo {
	height: 40px;
	width: auto;
	object-fit: contain;
	display: block;
	max-width: 200px;
}

/* ---- Hamburger toggle ---- */
.lfm-header__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	cursor: pointer;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
	-webkit-appearance: none;
	appearance: none;
}

.lfm-header__toggle:focus,
.lfm-header__toggle:active,
.lfm-header__toggle:focus-visible {
	background: none !important;
	box-shadow: none !important;
	outline: none !important;
}

.lfm-header__hamburger,
.lfm-header__close {
	position: absolute;
	top: 50%;
	left: 50%;
	transition: opacity 0.25s ease, transform 0.3s ease;
}

.lfm-header__hamburger {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0deg);
}

.lfm-header__close {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(-90deg);
}

.lfm-header.is-open .lfm-header__hamburger {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(90deg);
}

.lfm-header.is-open .lfm-header__close {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0deg);
}

/* ---- Full-screen navigation overlay ---- */
.lfm-nav-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: rgba(224, 224, 224, 0.8);
	backdrop-filter: blur(15px);
	-webkit-backdrop-filter: blur(15px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 70px 20px 40px;
	overflow-y: auto;
	box-sizing: border-box;

	opacity: 0;
	pointer-events: none;
	transform: translateY(-8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.lfm-header.is-open .lfm-nav-overlay {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

/* ---- Nav menu ---- */
.lfm-nav-overlay__nav {
	width: 100%;
	text-align: center;
	padding-top: 36px;
}

.lfm-nav-overlay__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lfm-nav-overlay__menu li {
	display: flex;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.lfm-nav-overlay__menu a {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	font-family: 'Quicksand', sans-serif;
	font-size: 20px;
	font-weight: 700;
	color: #262626;
	text-decoration: none;
	padding: 14px 20px;
	transition: color 0.2s ease;
}

.lfm-nav-overlay__menu a::after {
	content: '';
	display: block;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: #262626;
	transition: width 0.25s ease;
}

.lfm-nav-overlay__menu a:hover {
	color: #009D44;
}

.lfm-nav-overlay__menu .current-menu-item > a::after {
	width: 24px;
}


/* ---- Sub-menu accordion ---- */

/* Parent li becomes a column so sub-menu drops below the row */
.lfm-nav-overlay__menu .menu-item-has-children {
	flex-direction: column;
	align-items: center;
	width: 100%;
}

/* Row: parent link + chevron button side by side */
.lfm-sub-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 14px 0;
}

/* Remove padding from the link — the row handles spacing, and the
   horizontal padding was pushing the chevron away from the text */
.lfm-sub-row > a {
	flex-direction: row;
	gap: 0;
	padding: 0;
}

.lfm-sub-row > a::after {
	display: none;
}

/* Chevron toggle button */
.lfm-sub-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: none !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	cursor: pointer;
	color: #262626;
	flex-shrink: 0;
	transition: transform 0.25s ease;
	-webkit-tap-highlight-color: transparent;
	-webkit-appearance: none;
	appearance: none;
}

.lfm-sub-toggle:focus,
.lfm-sub-toggle:active,
.lfm-sub-toggle:focus-visible {
	background: none !important;
	outline: none !important;
	box-shadow: none !important;
	color: #262626 !important;
}

.menu-item-has-children.is-open > .lfm-sub-row > .lfm-sub-toggle {
	transform: rotate(180deg);
}

/* Sub-menu — collapsed by default, accordion expand */
.lfm-nav-overlay__menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lfm-nav-overlay__menu .menu-item-has-children.is-open > .sub-menu {
	max-height: 600px;
}

/* Sub-menu items */
.lfm-nav-overlay__menu .sub-menu li {
	display: flex;
	justify-content: center;
	width: 100%;
}

.lfm-nav-overlay__menu .sub-menu a {
	font-size: 16px;
	font-weight: 600;
	color: #444444;
	padding: 10px 20px;
}

.lfm-nav-overlay__menu .sub-menu a:hover {
	color: #009D44;
}

/* Remove the animated underline from sub-menu links */
.lfm-nav-overlay__menu .sub-menu a::after {
	display: none;
}

/* ---- WhatsApp CTA button ---- */
.lfm-nav-overlay__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 32px;
	height: 52px;
	background: #0E7EAC;
	border: 2px solid #33C0F9;
	border-radius: 999px;
	color: #ffffff;
	font-family: 'Quicksand', sans-serif;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	margin-top: 36px;
	white-space: nowrap;
	box-sizing: border-box;
	transition: opacity 0.2s ease;
}

.lfm-nav-overlay__cta:hover {
	opacity: 0.9;
	color: #ffffff;
}

/* ---- Contact details ---- */
.lfm-nav-overlay__contact {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin-top: 28px;
}

.lfm-nav-overlay__contact-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Quicksand', sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #444444;
	text-decoration: none;
	transition: color 0.2s ease;
}

.lfm-nav-overlay__contact-item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.lfm-nav-overlay__contact-item:hover {
	color: #009D44;
}

/* ---- Prevent body scroll when menu is open ---- */
body.lfm-menu-open {
	overflow: hidden;
}
