/* CD Valet header – matched to www.cdvalet.com main site */

:root {
	--cdv-header-height: 70px;
	--cdv-cyan: #12B2CB;
	--cdv-cyan-dark: #097383;
	--cdv-cyan-border: #0E8FA4;
	--cdv-cyan-alt: #12A5BC;
	--cdv-nav-text: #333333;
	--cdv-border: #DFE9E9;
	--cdv-badge-bg: #005374;
	--cdv-placeholder: #6A8387;
}

body.has-cdvalet-header {
	padding-top: var(--cdv-header-height);
}

/* --- Fixed header shell --- */
.custom-header {
	background-color: #ffffff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	padding: 0;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	width: 100%;
	height: var(--cdv-header-height);
	contain: layout style;
}

.header-container {
	display: flex;
	align-items: center;
	gap: 3rem;
	width: 100%;
	max-width: 100%;
	height: 100%;
	padding: 0 1rem;
	margin: 0 auto;
	justify-content: space-between;
}

@media (min-width: 1500px) {
	.header-container {
		max-width: 1440px;
	}
}

@media (max-width: 1200px) {
	.header-container {
		gap: 1.5rem;
	}
}

/* --- Logo group --- */
.header-logo-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.header-logo-group a {
	margin: 0;
	display: flex;
	align-items: center;
}

.header-logo-group img {
	width: 192px;
	height: 40px;
	object-fit: cover;
}

.navbar-toggler-btn {
	border: none;
	padding: 0.5rem;
	background: none;
	cursor: pointer;
	display: none;
}

.navbar-toggler-btn:focus {
	box-shadow: none;
	outline: none;
}

.navbar-toggler-btn .navbar-toggler-icon {
	display: inline-block;
	width: 1.5em;
	height: 1.5em;
	vertical-align: middle;
	background-image: url('../images/toggle.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100%;
}

/* --- Center nav group (search + links) --- */
.header-nav-group {
	display: flex;
	align-items: center;
	gap: 2rem;
	margin-left: auto;
}

@media (max-width: 1200px) {
	.header-nav-group {
		gap: 1rem;
	}
}

@media (max-width: 768px) {
	.header-nav-group {
		display: none;
	}
}

/* --- Search --- */
.header-search-form {
	display: flex;
	align-items: center;
	position: relative;
	width: 100%;
	max-width: 500px;
}

.header-search-form input[type="search"] {
	border: none;
	outline: none;
	box-shadow: none;
	background-color: transparent;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 100%;
	padding-left: 49px;
	background-image: url('../images/textSearchIcon.svg');
	background-repeat: no-repeat;
	background-position: 15px center;
	background-size: 18px;
	width: 250px;
	height: 40px;
	color: var(--cdv-nav-text);
}

.header-search-form input[type="search"]::placeholder {
	color: var(--cdv-placeholder);
	font-family: 'Inter', sans-serif;
	font-size: 0.875rem;
}

.header-search-form input[type="search"]:focus {
	background-color: transparent;
	outline: none;
	box-shadow: none;
}

/* --- Nav links row --- */
.header-nav-links {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

@media (max-width: 1320px) {
	.header-nav-links {
		gap: 0.15rem;
	}
}

@media (max-width: 1200px) {
	.header-nav-links {
		gap: 0.25rem;
	}
}

@media (max-width: 1100px) {
	.header-nav-links {
		display: none;
	}
}

.header-nav-links .nav-link {
	color: var(--cdv-nav-text);
	font-weight: 600;
	padding: 0.75rem 0.875rem;
	text-decoration: none;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	font-size: 0.9rem;
	white-space: nowrap;
	border: none;
	background: none;
}

.header-nav-links .nav-link:hover {
	color: var(--cdv-cyan);
}

@media (max-width: 1320px) {
	.header-nav-links .nav-link {
		padding: 0.5rem 0.3rem;
		font-size: 0.9rem;
	}
}

@media (max-width: 1200px) {
	.header-nav-links .nav-link {
		padding: 0.5rem 0.4rem;
		font-size: 0.9rem;
	}
}

/* Dropdown arrow via pseudo-element */
.rates-nav > .nav-link.main-items,
.header-dropdown-wrap > .nav-link.dropdown-toggle {
	position: relative;
	padding-right: 1.5rem;
}

.rates-nav > .nav-link.main-items::after,
.header-dropdown-wrap > .nav-link.dropdown-toggle::after {
	content: '';
	position: absolute;
	right: 2px;
	top: 40%;
	transform: translateY(0);
	width: 12px;
	height: 12px;
	background-image: url('../images/downArrowThinNew.svg');
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	transition: transform 0.3s ease;
}

.rates-nav:hover > .nav-link.main-items::after,
.header-dropdown-wrap:hover > .nav-link.dropdown-toggle::after,
.header-dropdown-wrap.open > .nav-link.dropdown-toggle::after {
	background-image: url('../images/PrimaryUpArrowThin.svg');
}

/* --- Rates mega dropdown --- */
.rates-nav {
	position: relative;
}

.rates-dropdown {
	position: absolute;
	top: 100%;
	left: 4px;
	background: #ffffff;
	display: none;
	z-index: 999;
	min-width: 210px;
	margin-top: 12px;
	border: 1px solid var(--cdv-border);
	border-radius: 0 0 6px 6px;
}

.rates-dropdown::before {
	content: '';
	position: absolute;
	top: -20px;
	left: 0;
	right: 0;
	height: 20px;
	background: transparent;
}

.rates-nav:hover .rates-dropdown,
.rates-nav:focus-within .rates-dropdown {
	display: block;
}

.rates-dropdown-grid {
	width: 100%;
	display: grid;
	grid-template-columns: 208px 0fr;
	min-height: 187px;
	transition: grid-template-columns 0.2s ease;
	overflow: hidden;
}

.rates-dropdown-grid.term-open {
	grid-template-columns: 208px 1fr;
	min-width: 420px;
}

.rates-dropdown-col {
	padding: 0;
}

.rates-dropdown-grid.term-open .rates-dropdown-col {
	padding: 1rem 0;
}

.rates-sub-item {
	padding: 0.75rem 0.875rem;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--cdv-nav-text);
	background-color: transparent;
	border-left: 3px solid transparent;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
	text-decoration: none;
}

@media (max-width: 1320px) {
	.rates-sub-item {
		padding: 0.6rem 0.8rem;
		font-size: 0.85rem;
	}
}

.rates-sub-item:hover {
	background: #f5f5f5;
	color: var(--cdv-nav-text);
}

.rates-sub-item.featured {
	background-color: #f5f5f5;
	border-left: 3px solid var(--cdv-cyan-alt);
}

.rates-sub-item.featured:hover {
	background: #f5f5f5;
	color: var(--cdv-nav-text);
}

.rates-sub-item .badge-open-now {
	padding: 0.25rem 0.6rem;
	font-size: 0.75rem;
	font-family: 'Inter', sans-serif;
	background: var(--cdv-badge-bg);
	color: #ffffff;
	border: none;
	border-radius: 2px;
	cursor: pointer;
	transition: background 0.2s ease;
	margin-left: 0.5rem;
	font-weight: 700;
	white-space: nowrap;
	flex-shrink: 0;
}

.rates-term-trigger {
	padding: 0.75rem 0.875rem;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--cdv-nav-text);
	background-color: transparent;
	border-left: 3px solid transparent;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.rates-term-trigger:hover,
.rates-term-trigger.active {
	background: #f5f5f5;
}

.rates-term-trigger .dropdown-arrow {
	transform: rotate(270deg);
	width: 12px;
	height: 8px;
}

.rates-term-panel {
	padding: 0;
	overflow: hidden;
}

.rates-term-panel a {
	display: block;
	padding: 0.75rem 0.875rem;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--cdv-nav-text);
	background-color: transparent;
	border-left: 3px solid transparent;
	transition: all 0.2s ease;
	text-decoration: none;
	white-space: nowrap;
}

.rates-term-panel a:hover {
	background: #f5f5f5;
	border-left: 3px solid var(--cdv-cyan-alt);
}

/* --- Tools / About dropdown --- */
.header-dropdown-wrap {
	position: relative;
	display: inline-block;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.header-dropdown-wrap .dropdown-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	width: auto;
	margin-top: 0;
	border-radius: 0 0 4px 4px;
	border: 1px solid var(--cdv-border);
	padding: 0;
	display: none;
	background: #fff;
	z-index: 999;
	list-style: none;
}

.header-dropdown-wrap:hover .dropdown-menu,
.header-dropdown-wrap.open .dropdown-menu,
.header-dropdown-wrap:focus-within .dropdown-menu {
	display: block;
}

.header-dropdown-wrap .dropdown-menu .dropdown-item {
	padding: 0.75rem 0.875rem;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--cdv-nav-text);
	border-left: 3px solid transparent;
	transition: all 0.2s ease;
	text-decoration: none;
	display: block;
	white-space: nowrap;
}

.header-dropdown-wrap .dropdown-menu .dropdown-item:hover {
	border-left: 3px solid var(--cdv-cyan-alt);
	background: #f5f5f5;
}

.header-nav-links .nav-link.main-items.is-active {
	color: var(--cdv-cyan);
}

/* --- Desktop action buttons --- */
.header-actions-desktop {
	gap: 0.75rem;
	margin-left: 0;
	display: none;
	align-items: center;
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.header-actions-desktop {
		display: flex;
	}
}

.header-actions-desktop .action-btn {
	min-height: 48px;
	height: 48px;
	padding: 0.5rem 1.5rem;
	font-weight: 500;
	border-radius: 6px;
	white-space: nowrap;
	font-size: 14px;
	line-height: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}

.header-actions-desktop .btn.btn-light,
.header-actions-desktop .btn.btn-primary {
	box-shadow: none;
}

@media (max-width: 1320px) {
	.header-actions-desktop .action-btn {
		min-height: 40px;
		height: 40px;
		padding: 0.5rem 0.9rem;
		font-size: 0.85rem;
	}
}

@media (max-width: 992px) {
	.header-actions-desktop .action-btn {
		min-height: 40px;
		height: 40px;
		padding: 0.5rem 1rem;
		font-size: 0.9rem;
	}
}

@media (max-width: 500px) {
	.header-actions-desktop .action-btn {
		min-height: 28px;
		height: 28px;
		padding: 0.25rem 0.75rem;
		font-size: 0.8rem;
	}
}

.header-actions-desktop .action-btn.log-in {
	border-radius: 4px;
	border: 1px solid #0E8FA4;
	font-weight: 700;
	color: #12A5BC;
	background: #ffffff;
	font-size: 1rem;
	line-height: 1.25rem;
	letter-spacing: -0.02em;
}

@media (max-width: 1320px) {
	.header-actions-desktop .action-btn.log-in {
		font-size: 1rem;
	}
}

@media (max-width: 992px) {
	.header-actions-desktop .action-btn.log-in {
		font-size: 1rem;
	}
}

@media (max-width: 500px) {
	.header-actions-desktop .action-btn.log-in {
		font-size: 1rem;
	}
}

.header-actions-desktop .action-btn.log-in:hover,
.header-actions-desktop .action-btn.log-in:focus {
	border-color: #097383;
	color: #097383;
	background: #ffffff;
}

.header-actions-desktop .action-btn.btn-rate-alerts {
	color: #ffffff;
	font-weight: 700;
	border-radius: 0.25rem;
	background: #12B2CB;
	border: none;
}

.header-actions-desktop .action-btn.btn-rate-alerts:hover,
.header-actions-desktop .action-btn.btn-rate-alerts:focus {
	background: #097383;
	border-color: #097383;
	color: #ffffff;
}

/* --- Mobile header icons --- */
.header-mobile-actions {
	gap: 0.5rem;
	margin-left: auto;
	display: flex;
	align-items: center;
}

@media (min-width: 768px) {
	.header-mobile-actions {
		display: none;
	}
}

.header-mobile-actions .btn-search-icon,
.header-mobile-actions .btn-profile-menu {
	height: 30px;
	width: auto;
	text-align: center;
	align-items: center;
	display: flex;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.header-mobile-actions .btn-search-icon img,
.header-mobile-actions .btn-profile-menu img {
	width: 18px;
	height: 18px;
}

.header-mobile-actions .btn-profile-menu img {
	width: 25px;
	height: 25px;
}

/* --- Mobile offcanvas menu --- */
.mobile-offcanvas {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	max-width: 320px;
	height: 100%;
	background: #fff;
	z-index: 10001;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.mobile-offcanvas.open {
	transform: translateX(0);
}

.mobile-offcanvas-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 10000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-offcanvas-backdrop.open {
	opacity: 1;
	visibility: visible;
}

.mobile-offcanvas-header {
	padding: 20px 10px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	border-bottom: 1px solid var(--cdv-border);
}

.mobile-offcanvas-header .btn-close-menu {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--cdv-nav-text);
	padding: 0.25rem 0.5rem;
}

.mobile-offcanvas .menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: none;
}

.mobile-offcanvas .menu-list > li > a,
.mobile-offcanvas .menu-list > li > button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 14px 16px;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 14px;
	color: #141723;
	border: none;
	border-bottom: 1px solid #dfecef;
	background: #fff;
	text-decoration: none;
	cursor: pointer;
	text-align: left;
}

.mobile-offcanvas .submenu {
	display: none;
	background-color: #f8f9fa;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-offcanvas .submenu.open {
	display: block;
}

.mobile-offcanvas .submenu .submenu-item a {
	display: block;
	padding: 12px 16px 12px 32px;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 14px;
	color: #141723;
	text-decoration: none;
	border-bottom: 1px solid #dfecef;
}

.mobile-offcanvas .nested-submenu {
	padding-left: 3rem;
	padding-right: 2rem;
	background: #ffffff;
	list-style: none;
	margin: 0;
	display: none;
}

.mobile-offcanvas .nested-submenu.open {
	display: block;
}

.mobile-offcanvas .nested-submenu a {
	display: block;
	padding: 10px 0;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 14px;
	color: #141723;
	text-decoration: none;
}

.mobile-offcanvas .arrow-icon {
	width: 12px;
	height: 12px;
	background-image: url('../images/downArrowThinNew.svg');
	background-size: contain;
	background-repeat: no-repeat;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.mobile-offcanvas .arrow-icon.rotate {
	transform: rotate(180deg);
}

/* --- Mobile search overlay --- */
.mobile-search-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.mobile-search-overlay.active {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.mobile-search-overlay::before {
	content: "";
	position: absolute;
	top: var(--cdv-header-height);
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
}

.mobile-search-overlay .mobile-search-inner {
	position: relative;
	margin: 0 auto;
	max-width: 600px;
	background: #fff;
	border-bottom: 1px solid #ddd;
	padding: 12px 16px;
	transform: translateY(-120%);
	transition: transform 0.3s ease;
	z-index: 1;
	margin-top: var(--cdv-header-height);
	display: flex;
	gap: 10px;
	align-items: center;
}

.mobile-search-overlay.active .mobile-search-inner {
	transform: translateY(0);
}

.mobile-search-overlay form {
	flex: 1;
	display: flex;
	position: relative;
}

.mobile-search-overlay input[type="search"] {
	width: 100%;
	padding: 10px 14px 10px 40px;
	border-radius: 8px;
	border: 1px solid #ddd;
	font-size: 15px;
	font-family: 'Inter', sans-serif;
}

.mobile-search-overlay .search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	background-image: url('../images/textSearchIcon.svg');
	background-size: contain;
	background-repeat: no-repeat;
	pointer-events: none;
}

.mobile-search-overlay .close-modal {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #444;
	margin-right: 6px;
}

/* --- Responsive header height --- */
@media (max-width: 992px) {
	:root {
		--cdv-header-height: 60px;
	}

	.custom-header {
		height: 60px;
	}

	.header-logo-group img {
		width: 127.55px;
		height: auto;
	}

	.navbar-toggler-btn {
		display: inline-block;
	}

	.header-dropdown-wrap .dropdown-menu {
		top: 100%;
	}
}

@media (max-width: 500px) {
	.header-container {
		gap: 0.5rem;
		padding: 0 11px;
	}
}
