/* Header and navigation (D-071). Solid bar, 44px targets, one primary action. */

.lp-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 60;
	border-bottom: 1px solid var(--lp-border);
	background: var(--lp-bg);
}

@media (max-width: 600px) {
	/* The admin bar scrolls away on small screens. */
	.admin-bar .lp-header { top: 0; }
}

.lp-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--lp-s-4);
	max-width: calc(var(--lp-max) + 2 * var(--lp-gutter));
	min-height: 72px;
	margin: 0 auto;
	padding: var(--lp-s-3) var(--lp-gutter);
}

/* ---- Logo ---- */
.lp-logo {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--lp-s-2);
	min-height: var(--lp-tap);
	color: var(--lp-text);
	font-family: var(--lp-font-heading);
	font-size: var(--lp-fs-3);
	font-weight: var(--lp-weight-bold);
	letter-spacing: var(--lp-track-heading);
}

.lp-logo:hover { color: var(--lp-text); }

.lp-logo__mark {
	flex: none;
	width: auto;
	height: var(--lp-logo-height);
}

.lp-logo--footer .lp-logo__mark { height: calc(var(--lp-logo-height) * 0.9); }

.lp-logo__img {
	width: auto;
	height: var(--lp-logo-height);
	max-width: 220px;
	object-fit: contain;
}

/* ---- Desktop nav ---- */
.lp-nav__list {
	display: flex;
	align-items: center;
	gap: var(--lp-s-1);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lp-nav__item { position: relative; }

.lp-nav__link {
	display: inline-flex;
	align-items: center;
	gap: var(--lp-s-1);
	min-height: var(--lp-tap);
	padding: 0 var(--lp-s-4);
	border-radius: var(--lp-radius-pill);
	color: var(--lp-text);
	font-size: var(--lp-fs-2);
	transition: background-color var(--lp-ease), color var(--lp-ease);
}

.lp-nav__trigger a {
	display: inline-flex;
	align-items: center;
	min-height: var(--lp-tap);
}

.lp-nav__trigger a,
.lp-nav__trigger a:hover { color: inherit; }

.lp-nav__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--lp-tap);
	min-height: var(--lp-tap);
	margin: 0 calc(-1 * var(--lp-s-4)) 0 calc(-1 * var(--lp-s-3));
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: var(--lp-fs-1);
	cursor: pointer;
}

.lp-nav__chevron span[aria-hidden] { transition: transform var(--lp-ease); }
.lp-nav__item.is-open .lp-nav__chevron span[aria-hidden] { transform: rotate(180deg); }

.lp-nav__item:not(.is-current) > .lp-nav__link:hover,
.lp-nav__item:not(.is-current).is-open > .lp-nav__link,
.lp-nav__item--parent:not(.is-current):hover > .lp-nav__link {
	background: var(--lp-bg-alt);
	color: var(--lp-text);
}

/* Current page: accent fill behind dark text. */
.lp-nav__item.is-current > .lp-nav__link {
	background: var(--lp-accent);
	color: var(--lp-on-accent);
	font-weight: var(--lp-weight-bold);
}

/* "Badge" hover style option: square corners, outline instead of fill. */
.lp-header--badge .lp-nav__link { border-radius: var(--lp-radius-sm); }

.lp-header--badge .lp-nav__item:not(.is-current) > .lp-nav__link:hover,
.lp-header--badge .lp-nav__item:not(.is-current).is-open > .lp-nav__link,
.lp-header--badge .lp-nav__item--parent:not(.is-current):hover > .lp-nav__link {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--lp-border-strong);
}

/* ---- Dropdowns ---- */
.lp-nav__panel {
	position: absolute;
	top: calc(100% + var(--lp-s-2));
	z-index: 70;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-4px);
	border: 1px solid var(--lp-border);
	background: var(--lp-bg);
	box-shadow: var(--lp-shadow-2);
	transition: opacity var(--lp-ease), transform var(--lp-ease), visibility 0s linear 0.15s;
}

/* Bridges the gap so the panel doesn't close on the way down. */
.lp-nav__panel::before {
	content: "";
	position: absolute;
	inset: calc(-1 * var(--lp-s-3)) 0 auto;
	height: var(--lp-s-3);
}

.lp-nav__item--parent:hover > .lp-nav__panel,
.lp-nav__item--parent:focus-within > .lp-nav__panel,
.lp-nav__item.is-open > .lp-nav__panel {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition-delay: 0s;
}

/* JS adds .is-closed after Escape so hover/focus don't immediately reopen it. */
.lp-nav__item.is-closed > .lp-nav__panel {
	visibility: hidden;
	opacity: 0;
}

.lp-nav__panel--mega {
	left: 50%;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--lp-s-1);
	width: 560px;
	max-width: 90vw;
	padding: var(--lp-s-3);
	border-radius: var(--lp-radius-md);
	transform: translate(-50%, -4px);
}

.lp-nav__item--parent:hover > .lp-nav__panel--mega,
.lp-nav__item--parent:focus-within > .lp-nav__panel--mega,
.lp-nav__item.is-open > .lp-nav__panel--mega {
	transform: translateX(-50%);
}

.lp-nav__sublink {
	display: block;
	padding: var(--lp-s-3) var(--lp-s-4);
	border-radius: var(--lp-radius-sm);
}

.lp-nav__sublink:hover { background: var(--lp-bg-alt); }

.lp-nav__subtitle {
	display: block;
	color: var(--lp-text);
	font-size: var(--lp-fs-2);
	font-weight: var(--lp-weight-bold);
}

.lp-nav__subdesc {
	display: block;
	margin-top: var(--lp-s-1);
	color: var(--lp-text-muted);
	font-size: var(--lp-fs-1);
	line-height: var(--lp-lh-snug);
}

.lp-nav__viewall {
	display: flex;
	grid-column: 1 / -1;
	align-items: center;
	justify-content: space-between;
	min-height: var(--lp-tap);
	margin-top: var(--lp-s-1);
	padding: 0 var(--lp-s-4);
	border-top: 1px solid var(--lp-border);
	color: var(--lp-primary-text);
	font-size: var(--lp-fs-1);
	font-weight: var(--lp-weight-bold);
}

.lp-nav__viewall:hover { color: var(--lp-text); }

.lp-nav__panel--simple {
	left: 0;
	display: flex;
	flex-direction: column;
	gap: var(--lp-s-1);
	width: 240px;
	padding: var(--lp-s-2);
	border-radius: var(--lp-radius-md);
}

.lp-nav__panel--simple .lp-nav__subtitle { font-weight: var(--lp-weight-regular); }

/* ---- Actions ---- */
.lp-header__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: var(--lp-s-2);
}

/* The header and mobile "Get a quote" are the shared primary button. */
.lp-header__cta,
.lp-mobile__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--lp-s-2);
	min-height: var(--lp-tap);
	padding: 0 var(--lp-s-5);
	border-radius: var(--lp-radius-pill);
	background: var(--lp-primary);
	color: var(--lp-on-primary);
	font-size: var(--lp-fs-2);
	font-weight: var(--lp-weight-bold);
	white-space: nowrap;
	transition: background-color var(--lp-ease);
}

.lp-header__cta:hover,
.lp-mobile__cta:hover {
	background: var(--lp-primary-hover);
	color: var(--lp-on-primary);
}

.lp-header__cta:active,
.lp-mobile__cta:active { transform: translateY(1px); }

.lp-header__toggle {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--lp-tap);
	height: var(--lp-tap);
	border: 1px solid var(--lp-border);
	border-radius: var(--lp-radius-pill);
	background: var(--lp-bg);
	color: var(--lp-text);
	font-size: var(--lp-fs-3);
	cursor: pointer;
}

.lp-header__toggle:hover { background: var(--lp-bg-alt); }

.lp-header__toggle-icon::before { content: "\2630"; }
.lp-header__toggle[aria-expanded="true"] .lp-header__toggle-icon::before { content: "\2715"; }

/* ---- Mobile drawer ---- */
.lp-mobile {
	display: flex;
	flex-direction: column;
	padding: var(--lp-s-3) var(--lp-gutter) var(--lp-s-5);
	border-top: 1px solid var(--lp-border);
	background: var(--lp-bg);
}

.lp-mobile[hidden] { display: none; }

.lp-mobile__list,
.lp-mobile__sub {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lp-mobile__sub { padding: 0 0 var(--lp-s-2) var(--lp-s-4); }
.lp-mobile__sub[hidden] { display: none; }

.lp-mobile__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: var(--lp-tap);
	padding: 0 var(--lp-s-4);
	border: 0;
	border-radius: var(--lp-radius-sm);
	background: none;
	color: var(--lp-text);
	font-size: var(--lp-fs-2);
	text-align: left;
	cursor: pointer;
}

.lp-mobile__link:hover { background: var(--lp-bg-alt); }

.lp-mobile__link.is-current {
	background: var(--lp-accent);
	color: var(--lp-on-accent);
	font-weight: var(--lp-weight-bold);
}

.lp-mobile__chevron { transition: transform var(--lp-ease); }
.lp-mobile__parent[aria-expanded="true"] .lp-mobile__chevron { transform: rotate(180deg); }

.lp-mobile__sublink {
	display: flex;
	align-items: center;
	min-height: var(--lp-tap);
	padding: 0 var(--lp-s-4);
	color: var(--lp-text-muted);
	font-size: var(--lp-fs-2);
}

.lp-mobile__cta { margin-top: var(--lp-s-3); }

@media (max-width: 1023px) {
	.lp-nav,
	.lp-header__cta { display: none; }
	.lp-header__toggle { display: flex; }
}

@media (min-width: 1024px) {
	.lp-mobile { display: none !important; }
}
