/* Header: logo left, menu right */
.ies-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--ies-dark);
	color: #fff;
	border-bottom: 3px solid var(--ies-primary);
	transition: box-shadow .2s ease;
}
.admin-bar .ies-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ies-header { top: 46px; } }
.ies-header.is-scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }

.ies-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 12px 24px;
}

/* Brand */
.ies-header__brand { flex: 0 0 auto; }
.ies-header__brand .custom-logo-link { display: block; line-height: 0; }
.ies-header__brand .custom-logo {
	width: auto;
	max-height: 56px;
}
.ies-header__title {
	font-family: var(--ies-font-heading);
	font-weight: 800;
	font-size: 1.6rem;
	color: var(--ies-primary);
	text-decoration: none;
}

/* Menu */
.ies-nav { margin-left: auto; }
.ies-nav__list,
.ies-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ies-nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
}
.ies-nav li { position: relative; }
.ies-nav a {
	display: block;
	padding: 5px 10px;
	font-family: var(--ies-font-heading);
	font-weight: 700;
	font-size: 1rem;
	color: #fff;
	text-decoration: none;
	border-radius: 50px;
	transition: color .2s ease, background-color .2s ease;
}
.ies-nav a:hover,
.ies-nav a:focus,
.ies-nav .current-menu-item > a,
.ies-nav .current-menu-ancestor > a,
.ies-nav .current_page_item > a {
	color: var(--ies-primary);
}

/* Optional: add CSS class "menu-cta" to a menu item (Appearance > Menus) for an orange button */
.ies-nav .menu-cta > a {
	background: var(--ies-primary);
	color: var(--ies-dark);
}
.ies-nav .menu-cta > a:hover,
.ies-nav .menu-cta > a:focus {
	background: var(--ies-primary-dark);
	color: var(--ies-dark);
}

/* Desktop dropdowns */
.ies-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}
.ies-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	padding: 8px;
	background: var(--ies-dark);
	border-top: 3px solid var(--ies-primary);
	border-radius: 0 0 10px 10px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.ies-nav li:hover > .sub-menu,
.ies-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.ies-nav .sub-menu a { border-radius: 8px; font-weight: 600; }
.ies-nav .sub-menu .sub-menu { top: 0; left: 100%; border-radius: 10px; }
.ies-nav__sub-toggle { display: none; }

/* Hamburger (hidden on desktop) */
.ies-header__toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 8px;
	position: relative;
}
.ies-header__toggle-bar,
.ies-header__toggle-bar::before,
.ies-header__toggle-bar::after {
	content: "";
	position: absolute;
	left: 10px;
	width: 24px;
	height: 3px;
	background: var(--ies-primary);
	border-radius: 3px;
	transition: transform .25s ease, top .25s ease;
}
.ies-header__toggle-bar { top: 20px; }
.ies-header__toggle-bar::before { top: -8px; left: 0; }
.ies-header__toggle-bar::after  { top: 8px;  left: 0; }
.ies-header.is-open .ies-header__toggle-bar { background: transparent; }
.ies-header.is-open .ies-header__toggle-bar::before { top: 0; transform: rotate(45deg); }
.ies-header.is-open .ies-header__toggle-bar::after  { top: 0; transform: rotate(-45deg); }
.ies-header__toggle:hover,
.ies-header__toggle:focus { background: rgba(255, 255, 255, .08); }

/* Mobile / tablet */
@media (max-width: 991px) {
	.ies-header__toggle { display: block; }

	.ies-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - 80px);
		overflow-y: auto;
		background: var(--ies-dark);
		border-top: 1px solid rgba(255, 255, 255, .1);
		padding: 8px 24px 20px;
		display: none;
	}
	.ies-header.is-open .ies-nav { display: block; }

	.ies-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.ies-nav a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
	.ies-nav .menu-item-has-children > a::after { display: none; }
	.ies-nav .menu-cta > a { margin-top: 12px; text-align: center; border-radius: 50px; border-bottom: 0; }

	.ies-nav .sub-menu {
		position: static;
		display: none;
		min-width: 0;
		padding: 0 0 0 16px;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
	.ies-nav .is-sub-open > .sub-menu { display: block; }

	.ies-nav .menu-item-has-children { display: flex; flex-wrap: wrap; align-items: center; }
	.ies-nav .menu-item-has-children > a { flex: 1 1 0; }
	.ies-nav .menu-item-has-children > .sub-menu { flex: 0 0 100%; }
	.ies-nav__sub-toggle {
		display: block;
		width: 44px;
		height: 44px;
		background: transparent;
		border: 0;
		position: relative;
	}
	.ies-nav__sub-toggle::after {
		content: "";
		position: absolute;
		top: 16px;
		left: 17px;
		width: 8px;
		height: 8px;
		border-right: 2px solid var(--ies-primary);
		border-bottom: 2px solid var(--ies-primary);
		transform: rotate(45deg);
		transition: transform .2s ease;
	}
	.ies-nav .is-sub-open > .ies-nav__sub-toggle::after { transform: rotate(-135deg); top: 20px; }
}

/* Top bar */
.ies-topbar {
	background: var(--ies-primary-tint);
	color: var(--ies-navy);
	font-family: var(--ies-font-body);
	font-size: .875rem;
	line-height: 1;
}
.ies-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px 24px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 8px 24px;
}
.ies-topbar ul {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ies-topbar a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ies-navy);
	text-decoration: none;
	font-weight: 600;
	transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.ies-topbar i { font-size: 1rem; line-height: 1; }
.ies-topbar__contact i { color: var(--ies-primary-dark); }
.ies-topbar__social i { font-size: 1.05rem; }
.ies-topbar__contact a:hover,
.ies-topbar__contact a:focus { opacity: .7; }

.ies-topbar__social { gap: 6px; }
.ies-topbar__social a {
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
}
.ies-topbar__social a:hover,
.ies-topbar__social a:focus {
	background: var(--ies-navy);
	color: #fff;
}

@media (max-width: 575px) {
	.ies-topbar { font-size: .8125rem; }
	.ies-topbar__inner { justify-content: center; padding: 8px 16px; gap: 8px 16px; }
	.ies-topbar__contact { justify-content: center; gap: 6px 16px; }
}

/* Mobile: hide the top bar (email/phone/social) to keep the header compact. */
@media (max-width: 767px) {
	.ies-topbar { display: none; }
}
