/*
 * Shomooa Header Polish
 * Scoped to the existing Shomoo Light header markup.
 * No theme files, content, URLs, menus, or SEO metadata are changed.
 */

.site-header .main-header__inner {
	grid-template-columns: minmax(160px, 245px) minmax(0, 1fr) auto;
	gap: clamp(12px, 1.4vw, 22px);
}

.site-header .branding {
	display: flex;
	align-items: center;
	min-width: 0;
}

.site-header .site-logo-link--header {
	max-width: 100%;
	align-items: center;
}

.site-header .site-logo--header {
	width: auto;
	max-width: 240px;
	max-height: 48px;
	object-fit: contain;
}

.site-header .primary-navigation {
	min-width: 0;
}

.site-header .primary-menu {
	flex-wrap: nowrap;
	gap: clamp(10px, 1.25vw, 22px);
}

.site-header .primary-menu > li {
	flex: 0 0 auto;
}

.site-header .primary-menu > li > a {
	padding-block: 10px;
	border-radius: 8px;
	font-size: clamp(.82rem, .9vw, .94rem);
	line-height: 1.5;
	white-space: nowrap;
	transition: color .18s ease, background-color .18s ease;
}

.site-header .primary-menu > li > a:hover {
	color: var(--brand-dark);
	background: var(--muted);
}

.site-header .header-cta {
	min-height: 44px;
	padding: 9px 16px;
	border-radius: 10px;
	transition: background-color .18s ease, transform .18s ease;
}

.site-header .header-cta:hover {
	transform: translateY(-1px);
}

.site-header .menu-toggle {
	border: 1px solid var(--line);
	transition: background-color .18s ease, border-color .18s ease;
}

.site-header .menu-toggle:hover {
	background: #ece8df;
	border-color: var(--brand);
}

.site-header a:focus-visible,
.site-header button:focus-visible {
	outline: 3px solid var(--brand);
	outline-offset: 3px;
}

@media (max-width: 1100px) {
	.site-header .main-header__inner {
		grid-template-columns: minmax(0, 1fr) auto auto;
		gap: 14px;
	}

	.site-header .menu-toggle {
		position: relative;
		z-index: 1003;
		display: block;
	}

	/*
	 * The original theme puts a fixed menu inside .main-header, which
	 * has backdrop-filter. That can make the fixed panel use the header
	 * as its containing block. An absolute panel anchored to the header
	 * avoids that positioning conflict.
	 */
	.site-header .primary-navigation {
		position: absolute;
		inset: auto 0 auto 0;
		top: 100%;
		width: auto;
		max-height: calc(100vh - 124px);
		max-height: calc(100dvh - 124px);
		overflow-y: auto;
		padding: 16px clamp(18px, 3vw, 30px) 24px;
		background: #fff;
		border-top: 1px solid var(--line);
		box-shadow: 0 20px 40px rgba(14, 28, 45, .12);
		transform: translateY(-130%);
		opacity: 0;
		visibility: hidden;
		transition: transform .24s ease, opacity .24s ease, visibility .24s ease;
		z-index: 1002;
	}

	.site-header .primary-navigation.is-open {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
	}

	.site-header .primary-menu {
		display: block;
	}

	.site-header .primary-menu > li > a {
		display: flex;
		min-height: 48px;
		align-items: center;
		padding: 12px 10px;
		border-bottom: 1px solid var(--line);
		font-size: 1rem;
	}

	.site-header .primary-menu > li > a:hover,
	.site-header .primary-menu .current-menu-item > a {
		background: var(--muted);
		color: var(--brand-dark);
	}

	body.menu-is-open::before {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(8, 20, 34, .42);
		z-index: 999;
	}
}

@media (max-width: 680px) {
	.site-header .main-header__inner {
		min-height: 74px;
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 12px;
	}

	.site-header .branding {
		overflow: hidden;
	}

	.site-header .site-logo-link--header {
		width: auto;
		max-width: 100%;
	}

	.site-header .site-logo--header {
		max-width: min(205px, 100%);
		max-height: 48px;
	}

	.site-header .header-cta {
		display: none;
	}

	.site-header .primary-navigation {
		inset: auto 0 auto auto;
		top: 100%;
		bottom: auto;
		width: min(88vw, 380px);
		height: calc(100vh - 112px);
		height: calc(100dvh - 112px);
		max-height: calc(100vh - 112px);
		max-height: calc(100dvh - 112px);
		overflow-y: auto;
		padding: 18px 16px 26px;
		border-top: 0;
		border-left: 1px solid var(--line);
		box-shadow: -18px 0 40px rgba(14, 28, 45, .14);
		transform: translateX(105%);
		overscroll-behavior: contain;
	}

	.site-header .primary-navigation.is-open {
		transform: translateX(0);
	}

	.site-header .primary-menu {
		display: block;
		margin: 0;
		padding: 0;
	}

	.site-header .primary-menu > li {
		margin: 0;
	}

	.site-header .primary-menu > li + li {
		margin-top: 4px;
	}

	.site-header .primary-menu > li > a {
		min-height: 50px;
		padding: 12px 13px;
		border: 0;
		border-bottom: 1px solid var(--line);
		border-radius: 10px;
		font-size: 1rem;
		line-height: 1.45;
	}

	.site-header .primary-menu > li > a:hover,
	.site-header .primary-menu .current-menu-item > a {
		background: var(--muted);
		color: var(--brand-dark);
	}

	.site-header .menu-toggle {
		width: 46px;
		height: 44px;
		border-radius: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header .primary-navigation,
	.site-header .primary-menu a,
	.site-header .header-cta,
	.site-header .menu-toggle {
		transition: none !important;
	}
}
