/* Cruise Parking — new site header (Figma). Isolated classes only. */

.cp-site-header {
	--cp-header-blue: #1a56db;
	--cp-header-text: #4a4a4a;
	--cp-header-black: #15172e;
	--cp-header-border: #e9eaec;
	--cp-header-bg: #ffffff;
	--cp-header-font: "Inter", "Roboto", "Helvetica Neue", Arial, sans-serif;
	position: sticky;
	top: 0;
	z-index: 1100;
	width: 100%;
	margin-bottom: 24px;
	background: var(--cp-header-bg);
	border-bottom: 1px solid var(--cp-header-border);
	font-family: var(--cp-header-font);
}

.cp-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 16px 48px;
	min-height: 72px;
	box-sizing: border-box;
}

.cp-site-header__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	flex-shrink: 0;
	line-height: 1;
}

.cp-site-header__logo-icon {
	display: block;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}

.cp-site-header__logo-text {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.cp-site-header__logo-cruise {
	color: var(--cp-header-black);
}

.cp-site-header__logo-parking {
	color: var(--cp-header-blue);
}

.cp-site-header__logo-img {
	display: block;
	height: 36px;
	width: auto !important;
	max-width: 200px;
	object-fit: contain;
}

.cp-site-header__right {
	display: flex;
	align-items: stretch;
	gap: 16px;
	flex: 1;
	justify-content: flex-end;
	min-width: 0;
}

.cp-site-header__search {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--cp-header-border);
	border-radius: 50%;
	background: var(--cp-header-bg);
	color: var(--cp-header-text);
	cursor: pointer;
	flex-shrink: 0;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.cp-site-header__search:hover,
.cp-site-header__search:focus {
	color: var(--cp-header-blue);
	border-color: var(--cp-header-blue);
	outline: none;
}

.cp-site-header__search-icon {
	display: block;
	width: 18px;
	height: 18px;
}

.cp-site-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--cp-header-text);
	cursor: pointer;
}

.cp-site-header__toggle-icon {
	display: block;
	width: 22px;
	height: 16px;
	position: relative;
}

.cp-site-header__toggle-icon span,
.cp-site-header__toggle-icon::before,
.cp-site-header__toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
}

.cp-site-header__toggle-icon span {
	top: 50%;
	margin-top: -1px;
}

.cp-site-header__toggle-icon::before {
	top: 0;
}

.cp-site-header__toggle-icon::after {
	bottom: 0;
}

.cp-site-header.is-mobile-open .cp-site-header__toggle-icon span {
	opacity: 0;
}

.cp-site-header.is-mobile-open .cp-site-header__toggle-icon::before {
	top: 50%;
	margin-top: -1px;
	transform: rotate(45deg);
}

.cp-site-header.is-mobile-open .cp-site-header__toggle-icon::after {
	bottom: 50%;
	margin-bottom: -1px;
	transform: rotate(-45deg);
}

.cp-site-header__nav {
	display: flex;
	align-items: stretch;
	align-self: stretch;
}

.cp-site-header__menu {
	display: flex;
	align-items: stretch;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cp-site-header__item {
	position: relative;
	display: flex;
	align-items: stretch;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cp-site-header__link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	/* Stretch to header edges so blue underline sits on the bottom border */
	margin-top: -16px;
	margin-bottom: -16px;
	padding: 16px 0 14px;
	color: var(--cp-header-text);
	font-size: 15px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	box-sizing: border-box;
	transition: color 0.15s ease, border-color 0.15s ease;
	/* Keep nav labels above full-width mega menus so sibling items stay hoverable */
	position: relative;
	z-index: 1103;
}

.cp-site-header__link:hover,
.cp-site-header__link:focus,
.cp-site-header__item.is-open > .cp-site-header__link,
.cp-site-header__item:hover > .cp-site-header__link {
	color: var(--cp-header-blue);
	text-decoration: none;
	border-bottom-color: var(--cp-header-blue);
}

.cp-site-header__chevron {
	display: inline-block;
	width: 6px;
	height: 6px;
	flex-shrink: 0;
	margin-left: 2px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-1px);
	transition: transform 0.15s ease;
}

.cp-site-header__item.is-open > .cp-site-header__link .cp-site-header__chevron,
.cp-site-header__item:hover > .cp-site-header__link .cp-site-header__chevron {
	transform: rotate(-135deg) translateY(0);
}

.cp-site-header__dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	min-width: 0;
	max-width: none;
	/* Figma: 24px space below header border before submenu links */
	padding: 24px 0;
	margin-top: 0;
	background: var(--cp-header-bg);
	border: 0;
	border-radius: 0;
	box-shadow: 0 12px 24px rgba(21, 23, 46, 0.06);
	box-sizing: border-box;
	transform: none;
	z-index: 1101;
}

/* Full-width mega menu: position against header, not the nav item */
.cp-site-header__item--mega {
	position: static;
}

.cp-site-header__item--mega .cp-site-header__dropdown {
	left: 0;
	right: 0;
	width: 100%;
	top: 100%;
	transform: none;
}

/* Hover bridge only under the active parent link (not full-width),
   so sibling menu items like Port Terminals stay hoverable */
.cp-site-header__item--has-dropdown > .cp-site-header__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 24px;
}

.cp-site-header__item:hover > .cp-site-header__dropdown,
.cp-site-header__item.is-open > .cp-site-header__dropdown {
	display: block;
}

@media (min-width: 1024px) {
	.cp-site-header__item--has-dropdown.is-open > .cp-site-header__link,
	.cp-site-header__item--has-dropdown:hover > .cp-site-header__link {
		color: var(--cp-header-blue);
		border-bottom-color: var(--cp-header-blue);
	}

	.cp-site-header__item--has-dropdown.is-open > .cp-site-header__link .cp-site-header__chevron,
	.cp-site-header__item--has-dropdown:hover > .cp-site-header__link .cp-site-header__chevron {
		transform: rotate(-135deg) translateY(-1px);
	}
}

.cp-site-header__dropdown-grid {
	display: grid;
	grid-template-columns: repeat(3, max-content);
	grid-template-rows: repeat(7, auto);
	grid-auto-flow: column;
	column-gap: 40px;
	row-gap: 24px;
	justify-content: start;
	list-style: none;
	/* Align first column with logo (same as .cp-site-header__inner) */
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 48px;
	box-sizing: border-box;
}

.cp-site-header__dropdown-grid li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cp-site-header__dropdown-link {
	display: block;
	padding: 0;
	color: #6b7280;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
}

.cp-site-header__dropdown-grid > li:first-child .cp-site-header__dropdown-link {
	font-weight: 700;
	color: var(--cp-header-text);
}

.cp-site-header__dropdown-link:hover,
.cp-site-header__dropdown-link:focus {
	color: var(--cp-header-blue);
	text-decoration: none;
}

.cp-site-header__mobile-close {
	display: none;
}

@media (max-width: 1023.98px) {
	.cp-site-header__inner {
		padding: 12px 16px;
		min-height: 60px;
	}

	.cp-site-header__logo-text {
		flex-direction: row;
		align-items: baseline;
		gap: 5px;
		font-size: 16px;
		line-height: 1.2;
	}

	.cp-site-header__logo-parking {
		font-size: 16px;
	}

	.cp-site-header__logo-icon {
		width: 28px;
		height: 28px;
	}

	.cp-site-header__right {
		flex: 0 0 auto;
		align-items: center;
		gap: 8px;
	}

	.cp-site-header__search {
		width: 36px;
		height: 36px;
	}

	.cp-site-header__toggle {
		display: inline-flex;
	}

	.cp-site-header__nav {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 1200;
		flex-direction: column;
		align-items: stretch;
		background: var(--cp-header-bg);
		overflow-x: hidden;
		overflow-y: auto;
		padding: 0 0 32px;
	}

	.cp-site-header.is-mobile-open .cp-site-header__nav {
		display: flex;
	}

	.cp-site-header__mobile-close {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 16px;
		border-bottom: 1px solid var(--cp-header-border);
		min-height: 64px;
		box-sizing: border-box;
		flex-shrink: 0;
	}

	.cp-site-header__mobile-close .cp-site-header__logo {
		min-width: 0;
	}

	.cp-site-header__mobile-close-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		color: #15172e;
		font-size: 28px;
		line-height: 1;
		cursor: pointer;
		flex-shrink: 0;
	}

	.cp-site-header__menu {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	/* Stack parent link above submenu (not side-by-side) */
	.cp-site-header__item,
	.cp-site-header__item--mega,
	.cp-site-header__item--has-dropdown {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		border-bottom: 1px solid var(--cp-header-border);
	}

	.cp-site-header__link {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		gap: 10px;
		width: 100%;
		margin-top: 0;
		margin-bottom: 0;
		padding: 18px 16px;
		font-size: 16px;
		line-height: 22px;
		border-bottom: 0;
		box-sizing: border-box;
	}

	.cp-site-header__link:hover,
	.cp-site-header__link:focus,
	.cp-site-header__item.is-open > .cp-site-header__link,
	.cp-site-header__item:hover > .cp-site-header__link {
		border-bottom-color: transparent;
	}

	.cp-site-header__item.is-open > .cp-site-header__link {
		color: var(--cp-header-blue);
		font-weight: 700;
	}

	.cp-site-header__dropdown,
	.cp-site-header__item--mega .cp-site-header__dropdown {
		position: static;
		display: none;
		width: 100%;
		min-width: 0;
		max-width: none;
		padding: 0 16px 16px;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		transform: none;
		left: auto;
		right: auto;
		top: auto;
	}

	.cp-site-header__item--has-dropdown > .cp-site-header__link::after {
		display: none;
	}

	.cp-site-header__item.is-open > .cp-site-header__dropdown {
		display: block;
	}

	.cp-site-header__item:hover > .cp-site-header__dropdown {
		display: none;
	}

	.cp-site-header__item.is-open:hover > .cp-site-header__dropdown {
		display: block;
	}

	.cp-site-header__dropdown-grid {
		display: flex;
		flex-direction: column;
		grid-template-columns: none;
		grid-template-rows: none;
		grid-auto-flow: row;
		column-gap: 0;
		row-gap: 0;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 0;
	}

	.cp-site-header__dropdown-grid > li {
		width: 100%;
	}

	.cp-site-header__dropdown-link,
	.cp-site-header__dropdown-grid > li:first-child .cp-site-header__dropdown-link {
		display: block;
		width: 100%;
		padding: 10px 0;
		font-size: 15px;
		font-weight: 400;
		line-height: 22px;
		color: #6b7280;
		white-space: normal;
	}
}

@media (min-width: 1024px) and (max-width: 1279.98px) {
	.cp-site-header__inner {
		padding: 16px 24px;
	}

	.cp-site-header__menu {
		gap: 18px;
	}

	.cp-site-header__link {
		font-size: 14px;
	}

	.cp-site-header__dropdown {
		padding: 24px 0;
	}

	.cp-site-header__dropdown-grid {
		column-gap: 40px;
		row-gap: 24px;
		padding: 0 24px;
	}
}

body.cp-header-mobile-open {
	overflow: hidden;
}

/* Search popup: sit above sticky header; keep close button visible */
.search-popup {
	z-index: 1300;
}

.search-popup .btn-close {
	margin-top: 80px;
}
