/**
 * AdGrantspilot Header — matches theme header.php / #masthead (scoped to .agp-header-widget).
 */

.agp-header-widget {
	--agp-teal: #1aa18c;
	--agp-teal-dark: #148a77;
	--agp-navy: #0d1b2a;
	--agp-gray: #6b7280;
	--agp-white: #ffffff;
	--agp-border: #e5e7eb;
	--agp-header-nav-h: 64px;
}

.agp-header-widget nav {
	z-index: 1200;
	background: var(--agp-white);
	border-bottom: 1px solid var(--agp-border);
	justify-content: space-between;
	align-items: center;
	min-height: 64px;
	height: auto;
	padding: 0 40px;
	display: flex;
	position: sticky;
	top: 0;
	flex-wrap: wrap;
	row-gap: 12px;
}

.agp-header-widget .nav-logo {
	color: var(--agp-navy);
	font-size: 17px;
	font-weight: 800;
	text-decoration: none;
	flex-shrink: 0;
	line-height: 1.2;
}

.agp-header-widget .nav-logo.nav-logo--image {
	display: flex;
	align-items: center;
	line-height: 0;
}

.agp-header-widget .nav-logo img.agp-header-logo-img {
	display: block;
	height: auto;
	width: auto;
	max-height: 40px;
}

.agp-header-widget .nav-logo:hover,
.agp-header-widget .nav-logo:focus {
	color: var(--agp-navy);
}

.agp-header-widget .nav-logo span {
	color: var(--agp-teal);
}

.agp-header-widget .agp-header-burger {
	display: none;
	width: 44px;
	height: 44px;
	border: 3px solid #6b7280;
	border-radius: 12px;
	background: transparent;
	padding: 0;
	justify-content: center;
	align-items: center;
	flex-shrink: 0;
	position: relative;
	z-index: 1101;
}

.agp-header-widget .agp-header-burger-icon {
	width: 22px;
	height: 2px;
	background: #6b7280;
	display: block;
	position: relative;
}

.agp-header-widget .agp-header-burger-icon::before,
.agp-header-widget .agp-header-burger-icon::after {
	content: '';
	width: 22px;
	height: 2px;
	background: #6b7280;
	position: absolute;
	left: 0;
}

.agp-header-widget .agp-header-burger-icon::before {
	top: -7px;
}

.agp-header-widget .agp-header-burger-icon::after {
	top: 7px;
}

.agp-header-widget .agp-header-panel {
	flex: 1;
	display: flex;
	justify-content: flex-end;
	min-width: 0;
}

/* Right side: menu + optional extra CTA list */
.agp-header-widget .agp-header-links {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 28px;
	flex: 1;
	min-width: 0;
}

.agp-header-widget ul.nav-links {
	align-items: center;
	gap: 28px;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	padding: 0;
	margin: 0;
}

.agp-header-widget ul.nav-links a {
	color: var(--agp-gray);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.15s ease;
}

.agp-header-widget ul.nav-links a:hover,
.agp-header-widget ul.nav-links a:focus {
	color: var(--agp-navy);
}

.agp-header-widget ul.nav-links a.nav-cta {
	background: var(--agp-teal);
	border-radius: 100px;
	padding: 9px 20px;
	color: #fff !important;
	font-weight: 600 !important;
}

.agp-header-widget ul.nav-links a.nav-cta:hover,
.agp-header-widget ul.nav-links a.nav-cta:focus {
	background: var(--agp-teal-dark) !important;
	color: #fff !important;
}

.agp-header-widget ul.nav-links li.nav-cta > a {
	background: var(--agp-teal);
	border-radius: 100px;
	padding: 9px 20px;
	color: #fff !important;
	font-weight: 600 !important;
}

.agp-header-widget ul.nav-links li.nav-cta > a:hover,
.agp-header-widget ul.nav-links li.nav-cta > a:focus {
	background: var(--agp-teal-dark) !important;
	color: #fff !important;
}

.agp-header-widget .agp-header-nav-empty {
	margin: 0;
	font-size: 13px;
	color: var(--agp-gray);
}

/* Dropdown (depth 2) */
.agp-header-widget ul.nav-links > li {
	position: relative;
}

.agp-header-widget ul.nav-links ul.sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	margin: 8px 0 0;
	padding: 8px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--agp-border);
	border-radius: 10px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	z-index: 200;
	flex-direction: column;
	gap: 0 !important;
	display: none;
}

.agp-header-widget ul.nav-links li:hover > ul.sub-menu,
.agp-header-widget ul.nav-links li:focus-within > ul.sub-menu {
	display: flex;
}

.agp-header-widget ul.nav-links ul.sub-menu a {
	display: block;
	padding: 8px 16px;
	border-radius: 0;
}

.agp-header-widget ul.nav-links ul.sub-menu a.nav-cta {
	border-radius: 100px;
	margin: 4px 10px;
	text-align: center;
}

@media (max-width: 900px) {
	.agp-header-widget nav {
		padding: 12px 20px;
	}

	.agp-header-widget {
		--agp-header-nav-h: 88px;
	}

	.agp-header-widget.agp-header--open .agp-header-burger-icon {
		background: transparent;
	}

	.agp-header-widget.agp-header--open .agp-header-burger-icon::before,
	.agp-header-widget.agp-header--open .agp-header-burger-icon::after {
		top: 0;
		background: var(--agp-navy);
	}

	.agp-header-widget.agp-header--open .agp-header-burger-icon::before {
		transform: rotate(45deg);
	}

	.agp-header-widget.agp-header--open .agp-header-burger-icon::after {
		transform: rotate(-45deg);
	}

	.agp-header-widget .agp-header-burger {
		display: inline-flex;
	}

	.agp-header-widget .agp-header-panel {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		bottom: auto;
		z-index: 1100;
		background: rgba(255, 255, 255, 0.98);
		backdrop-filter: blur(10px);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-8px);
		transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
		padding: 22px 20px 28px;
		max-height: calc(100vh - var(--agp-header-nav-h));
		overflow: auto;
		border-bottom: 1px solid var(--agp-border);
	}

	.agp-header-widget.agp-header--open .agp-header-panel {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}

	.agp-header-widget .agp-header-links {
		flex-direction: column;
		justify-content: flex-start;
		align-items: center;
		gap: 28px;
		width: 100%;
		max-width: 520px;
		margin: 0 auto;
	}

	.agp-header-widget ul.nav-links {
		flex-direction: column;
		gap: 24px;
		width: 100%;
		display: flex;
	}

	#masthead .agp-header-widget ul.nav-links,
	#masthead .agp-header-widget .nav-links {
		display: flex !important;
	}

	.agp-header-widget ul.nav-links a {
		font-size: 22px;
		font-weight: 500;
		color: var(--agp-navy);
		text-align: center;
		display: block;
		width: 100%;
	}

	.agp-header-widget ul.nav-links a.nav-cta,
	.agp-header-widget ul.nav-links li.nav-cta > a {
		font-size: 18px;
		padding: 14px 24px;
		width: 100%;
		max-width: 320px;
		margin: 0 auto;
	}

	.agp-header-widget ul.nav-links ul.sub-menu {
		position: static;
		min-width: 0;
		margin: 10px 0 0;
		padding: 0;
		border: 0;
		box-shadow: none;
		background: transparent;
		display: flex;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.agp-header-widget ul.nav-links ul.sub-menu a {
		font-size: 18px;
		color: var(--agp-gray);
		padding: 8px 0;
	}
}
