.navbar {
	display: grid;
    grid-template-columns: auto 1fr auto;
	justify-content: space-between;
	align-items: center;
	padding-inline: var(--spacing-4);
	-webkit-transition: all 0.3s ease-in-out;
	transition: all 0.3s ease-in-out;
	background: white;
	height: 8rem;
}

.hamburger {
	display: none;
	grid-column: 3;
}

.bar {
	display: block;
	width: 25px;
	height: 2px;
	margin: 5px auto;
	-webkit-transition: all 0.3s ease-in-out;
	transition: all 0.3s ease-in-out;
	background-color: black;
}

.nav-menu {
	grid-row: 1;
    grid-column: 1/-1;
	display: flex;
	gap: 2rem;
	justify-content: center;
	align-items: center;
}

.nav-item {
	font-weight: 400;
	list-style: none;
	padding: 1rem;
	position: relative;
}

.nav-link {
	font-size: var(--button);
	color: var(--colour-primary);
}

.nav-link:hover {
	color: var(--colour-primary-dark);
	-ms-transform: scale(1.1);
	-moz-transform: scale(1.1);
	-webkit-transform: scale(1.1);
	-o-transform: scale(1.1);
	transform: scale(1.1);
}

.nav-logo {
	grid-row: 1;
    grid-column: 1;
	z-index: 1;
}

.nav-logo img {
	max-height: 8rem;
	max-width: 20rem;
}

.nav-numbers {
	display: flex;
	position: relative;
	grid-row: 1;
    grid-column: 3;
}

/* ============================================================
   Mobile menu — slide-from-right drawer with light background,
   expandable Services submenu, sticky phone CTA at the bottom.
   ============================================================ */
@media only screen and (max-width: 991px) {

	.header .nav-logo {
		margin-right: auto;
	}

	/* Desktop primary CTA stays hidden on mobile (it's duplicated
	   inside the drawer as .nav-item--mobile-cta). */
	.navbar > .nav-numbers {
		display: none;
	}

	/* Hamburger button — visible on mobile, swaps to an X when menu is open */
	.hamburger {
		display: inline-flex;
		justify-content: center;
		align-items: center;
		background: none;
		border: none;
		padding: 0.8rem;
		cursor: pointer;
		z-index: 60;
		position: relative;
		width: 3rem;
		height: 3rem;
	}

	/* The two icon states stack on top of each other and fade between */
	.hamburger-icon,
	.close-icon {
		position: absolute;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: opacity 0.2s ease;
		color: var(--text-dark);
	}

	.hamburger-icon {
		flex-direction: column;
		gap: 3px;
		opacity: 1;
	}

	.hamburger-icon .bar {
		display: block;
		width: 22px;
		height: 2px;
		background-color: var(--text-dark);
		border-radius: 1px;
	}

	.close-icon {
		font-size: 2.2rem;
		line-height: 1;
		font-weight: 300;
		opacity: 0;
	}

	.hamburger.active .hamburger-icon { opacity: 0; }
	.hamburger.active .close-icon { opacity: 1; }

	.hamburger.active {
		position: fixed;
		top: 1.5rem;
		right: 1.5rem;
	}

	/* Backdrop behind the drawer */
	.nav-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		z-index: 40;
		cursor: pointer;
	}

	.nav-backdrop.active {
		opacity: 1;
		visibility: visible;
	}

	/* Drawer — slides in from the right */
	.nav-menu {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		height: 100vh;
		width: min(86vw, 380px);
		background: var(--bg-light);
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		padding: 6rem 2rem 3rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		transform: translateX(100%);
		transition: transform 0.3s ease;
		z-index: 50;
		box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
		text-align: left;
	}

	.nav-menu.active {
		transform: translateX(0);
	}

	/* Each top-level item — hairline dividers, generous tap targets */
	.nav-menu > .nav-item {
		margin: 0;
		padding: 0;
		border-bottom: 1px solid rgba(0, 0, 0, 0.08);
		position: relative;
		font-weight: 400;
	}

	.nav-menu > .nav-item > .nav-link {
		display: block;
		padding: 1.1rem 0;
		font-family: 'Montserrat', 'Inter', sans-serif;
		font-size: var(--text);
		font-weight: 500;
		color: var(--text-dark);
		background-image: none;
	}

	.nav-menu > .nav-item > .nav-link:hover {
		color: var(--colour-primary);
		transform: none;
		background-image: none;
	}

	/* Services caret — rotates when expanded */
	.nav-item--has-dropdown > .nav-link {
		padding-right: 2.5rem !important;
	}

	.nav-item--has-dropdown .nav-caret {
		position: absolute;
		right: 0.4rem;
		top: 1.4rem;
		display: inline-block;
		font-size: 0.9em;
		color: var(--colour-primary);
		transition: transform 0.25s ease;
	}

	.nav-item--has-dropdown.expanded .nav-caret {
		transform: rotate(180deg);
	}

	/* Submenu — expandable in place */
	.nav-sub-menu {
		display: block;
		list-style: none;
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: transparent;
		box-shadow: none;
		min-width: 0;
		max-height: 0;
		overflow: hidden;
		margin: 0;
		padding: 0 0 0 1rem;
		transition: max-height 0.3s ease, padding 0.3s ease;
		pointer-events: none;
	}

	.nav-item--has-dropdown.expanded .nav-sub-menu {
		max-height: 500px;
		padding-bottom: 0.75rem;
		pointer-events: auto;
	}

	.nav-sub-menu li {
		list-style: none;
	}

	.nav-sub-link {
		display: block;
		padding: 0.7rem 0;
		font-family: 'Inter', sans-serif;
		font-size: var(--text);
		font-weight: 400;
		color: var(--text-dark);
		text-decoration: none;
		background: none !important;
		white-space: normal;
	}

	.nav-sub-link:hover,
	.nav-sub-link:focus-visible {
		color: var(--colour-primary);
		background: none;
	}

	/* Mobile phone CTA — sits below the menu items, full width */
	.nav-item--mobile-cta {
		margin-top: auto;
		padding-top: 2.5rem;
		padding-bottom: 1rem;
		border-bottom: none !important;
	}

	.nav-item--mobile-cta .button {
		display: block;
		width: 100%;
		text-align: center;
		padding: 1rem 1.25rem;
		font-size: var(--text);
		background-color: var(--colour-primary);
		color: #fff;
		border-color: var(--colour-primary);
	}

	/* Body scroll lock when menu is open */
	body.nav-open {
		overflow: hidden;
	}
}

/* Desktop: hide the mobile-only CTA list item */
@media (min-width: 992px) {
	.nav-item--mobile-cta {
		display: none;
	}
}

/* Desktop nav — top-level link underline hover + dropdown */
@media only screen and (min-width: 768px) {

	/* Subtle underline-grow on top-level nav links */
	.nav-menu > li > a {
		position: relative;
		background-image: linear-gradient(90deg, black, black);
		background-size: 0% 2px;
		background-repeat: no-repeat;
		background-position: left bottom;
		transition: background-size 0.25s ease;
		text-decoration: none;
		padding-bottom: 4px;
	}

	.nav-menu > li > a:hover {
		background-size: 100% 2px;
	}

	/* Small caret on the dropdown trigger */
	.nav-caret {
		display: inline-block;
		font-size: 0.7em;
		margin-left: 0.2em;
		vertical-align: middle;
		transition: transform 0.2s ease;
	}

	.nav-item--has-dropdown:hover .nav-caret,
	.nav-item--has-dropdown:focus-within .nav-caret {
		transform: rotate(180deg);
	}

	/* ---------- Dropdown panel ---------- */

	.nav-sub-menu {
		list-style: none;
		position: absolute;
		left: 50%;
		top: calc(100% - 0.25rem);
		transform: translate(-50%, 6px);
		min-width: 240px;
		margin: 0;
		padding: 0.5rem 0;
		background: #fff;
		border-radius: 8px;
		box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 2px 4px rgba(0, 0, 0, 0.06);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	}

	/* Reveal on hover or keyboard focus within the parent item */
	.nav-item--has-dropdown:hover .nav-sub-menu,
	.nav-item--has-dropdown:focus-within .nav-sub-menu {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translate(-50%, 0);
	}

	/* Invisible hover bridge — keeps dropdown open as the mouse travels
	   from the trigger down to the panel. */
	.nav-item--has-dropdown::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		height: 0.75rem;
	}

	.nav-sub-menu li {
		display: block;
		margin: 0;
		padding: 0;
	}

	.nav-sub-link {
		display: block;
		padding: 0.75rem 1.25rem;
		font-family: 'Inter', sans-serif;
		font-size: var(--text);
		font-weight: 500;
		color: var(--text-dark);
		text-decoration: none;
		white-space: nowrap;
		/* Reset the underline-grow background from the global nav-link rule */
		background-image: none !important;
		transition: background-color 0.15s ease, color 0.15s ease;
	}

	.nav-sub-link:hover,
	.nav-sub-link:focus-visible {
		background-color: #f7f3f0;
		color: var(--colour-primary);
		/* Override the global a:hover scale(1.1) that looks broken here */
		transform: none !important;
	}
}

@media only screen and (max-width: 991px) {
	.navbar {
		padding-inline: var(--spacing-3);
	}
}