/* ==========================================================================
   Header mega menu (wvh-mega) — loads after wvh-header.css
   Turned on per menu item in Appearance → Menus ("Show as mega menu").
   ========================================================================== */
:root {
	--wvm-navy: #024d78;
	--wvm-accent: #14a79d;
	--wvm-card-bg: #f6f9fb;
	--wvm-card-border: #e4ebf1;
	--wvm-badge-bg: rgba(2, 77, 120, 0.08);
}

/* ---- desktop: main bar + sticky bar ------------------------------------- */
@media (min-width: 992px) {
	/* the panel spans the header row, not the menu item */
	.wvh-main .wvh-inner,
	.wvh-sticky .wvh-inner { position: relative; }
	.wvh-nav .wvh-menu > li.wvh-mega { position: static; }

	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu {
		--wvm-cols: 4;
		display: grid;
		grid-template-columns: repeat(var(--wvm-cols), minmax(0, 1fr));
		gap: 16px;
		left: 0;
		right: 0;
		width: auto;
		padding: 24px 28px 28px;
		background: #fff;
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 0 0 18px 18px;
		box-shadow: 0 24px 48px rgba(2, 77, 120, 0.18);
		border-top: 3px solid var(--wvm-accent);
	}
	.wvh-nav .wvh-menu > li.wvh-mega-cols-2 > .sub-menu { --wvm-cols: 2; }
	.wvh-nav .wvh-menu > li.wvh-mega-cols-3 > .sub-menu { --wvm-cols: 3; }
	.wvh-nav .wvh-menu > li.wvh-mega-cols-5 > .sub-menu { --wvm-cols: 5; gap: 14px; }

	/* invisible strip over the gap between the menu item and the panel, so the
	   panel doesn't close while the pointer moves down to it */
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 24px;
	}

	/* heading row across all columns */
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li.wvh-mega-head {
		grid-column: 1 / -1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		margin-bottom: 6px;
		padding: 0 0 14px;
		border-bottom: 1px solid #f0f0f0;
	}
	.wvh-mega-heading {
		position: relative;
		margin: 0;
		padding-bottom: 8px;
		color: var(--wvm-navy);
		font-size: 20px;
		font-weight: 700;
		line-height: 1.3;
		letter-spacing: -0.2px;
	}
	.wvh-mega-heading::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: 0;
		width: 38px;
		height: 3px;
		border-radius: 3px;
		background: var(--wvm-accent);
	}
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 9px 18px;
		border-radius: 999px;
		background: var(--wvm-navy);
		color: #fff;
		font-size: 13px;
		font-weight: 600;
		line-height: 1.2;
		white-space: nowrap;
		transition: background-color 0.2s ease, transform 0.2s ease;
	}
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall svg { color: currentColor; transition: transform 0.2s ease; }
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall:hover,
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall:focus-visible {
		background: #013a5c;
		color: #fff;
		text-decoration: none;
		transform: translateY(-1px);
	}
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall:hover svg { transform: translateX(3px); }

	/* cards */
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) {
		display: flex;
		border-bottom: 0;
	}
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a {
		position: relative;
		display: flex;
		align-items: center;
		gap: 12px;
		width: 100%;
		min-height: 78px;
		padding: 12px 16px 12px 18px;
		overflow: hidden;
		background: var(--wvm-card-bg);
		border: 1px solid var(--wvm-card-border);
		border-radius: 14px;
		color: var(--wvm-navy);
		font-size: 15px;
		font-weight: 600;
		line-height: 1.35;
		transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	}
	/* accent bar that slides in from the left on hover */
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a::before {
		content: "";
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		width: 4px;
		background: var(--wvm-accent);
		transform: translateX(-4px);
		transition: transform 0.2s ease;
	}
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:hover::before,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:focus-visible::before { transform: translateX(0); }
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:hover,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:focus-visible {
		background: #fff;
		border-color: var(--wvm-accent);
		color: var(--wvm-navy);
		box-shadow: 0 10px 22px rgba(2, 77, 120, 0.14);
		transform: translateY(-3px);
	}
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a::after {
		content: "\2192";
		flex: 0 0 auto;
		margin-left: auto;
		color: var(--wvm-accent);
		font-size: 18px;
		opacity: 0;
		transform: translateX(-6px);
		transition: opacity 0.2s ease, transform 0.2s ease;
	}
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:hover::after,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a:focus-visible::after { opacity: 1; transform: translateX(0); }
	.wvh-mega-title { min-width: 0; }

	.wvh-mega-thumb {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 50px;
		width: 50px;
		height: 50px;
		overflow: hidden;
		background: #fff;
		border: 1px solid rgba(0, 0, 0, 0.06);
		border-radius: 12px;
		transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
	}
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li > a:hover .wvh-mega-thumb { transform: scale(1.05); }
	.wvh-header .wvh-mega-thumb img {
		width: 100%;
		height: 100%;
		object-fit: contain;
	}
	/* no picture set: a round badge with the icon, filled navy on hover */
	.wvh-mega-thumb--icon {
		border: 0;
		border-radius: 50%;
		background: var(--wvm-badge-bg);
		color: var(--wvm-navy);
	}
	.wvh-mega-thumb--icon svg { width: 24px; height: 24px; }
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li > a:hover .wvh-mega-thumb--icon,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li > a:focus-visible .wvh-mega-thumb--icon {
		background: var(--wvm-navy);
		color: #fff;
	}
	/* 5 across: a touch tighter so the longest names still fit on two lines */
	.wvh-nav .wvh-menu > li.wvh-mega-cols-5 > .sub-menu > li:not(.wvh-mega-head) > a { gap: 10px; padding: 12px 12px 12px 14px; font-size: 14px; }
	.wvh-nav .wvh-menu > li.wvh-mega-cols-5 > .sub-menu .wvh-mega-thumb { flex-basis: 44px; width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a::after,
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall,
	.wvh-nav .wvh-menu .sub-menu a.wvh-mega-viewall svg,
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a::before,
	.wvh-nav .wvh-menu .wvh-mega-thumb { transition: none; transform: none; }
	.wvh-nav .wvh-menu > li.wvh-mega > .sub-menu > li:not(.wvh-mega-head) > a::after { opacity: 1; transform: none; }
}

/* ---- mobile slide-out panel: same pictures as the desktop panel ---------
   The thumbs are already in the markup in all three header copies — this
   turns them on and lays each sub-item out as a picture + title row.
   The heading row stays desktop-only: a 20px heading and a "View All" pill
   do not fit a 300px panel that is already scrolling.
   ------------------------------------------------------------------------ */
.wvh-mobile-nav .wvh-mega-head { display: none; }

/* beats `.wvh-mobile-nav .wvh-menu li > a` (display:block; padding:10px 20px)
   and `.wvh-mobile-nav .sub-menu a` (margin-left:20px) in wvh-header.css */
.wvh-mobile-nav .wvh-menu > li.wvh-mega > .sub-menu > li > a {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: 0;
	padding: 8px 20px 8px 16px;
	font-size: 13.5px;
	line-height: 1.35;
}

.wvh-mobile-nav .wvh-mega-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	overflow: hidden;
	background: #fff;
	border-radius: 9px;
}
.wvh-mobile-nav .wvh-mega-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* no Card image set: a round badge, light on the dark panel */
.wvh-mobile-nav .wvh-mega-thumb--icon {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 50%;
	color: #fff;
}
.wvh-mobile-nav .wvh-mega-thumb--icon svg { width: 20px; height: 20px; }

.wvh-mobile-nav .wvh-mega-title { min-width: 0; }
