/* Moshaverr 50 — deterministic header + search layer.
   Physical layout is intentionally LTR at the grid level, while all content stays RTL:
   [left actions] [center navigation] [right brand]. */

@media (min-width: 1181px) {
	body .site-header .site-header__inner {
		direction: ltr !important;
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(190px, 270px) !important;
		grid-template-areas: "nav brand" !important;
		align-items: center !important;
		width: min(100% - 40px, 1680px) !important;
		gap: 28px !important;
		margin-inline: auto !important;
	}

	body .site-header .site-brand {
		grid-area: brand !important;
		direction: rtl !important;
		justify-self: end !important;
		min-width: 0 !important;
	}

	body .site-header .site-navigation {
		grid-area: nav !important;
		direction: ltr !important;
		display: grid !important;
		grid-template-columns: max-content minmax(0, 1fr) !important;
		grid-template-areas: "actions menu" !important;
		align-items: center !important;
		position: static !important;
		inset: auto !important;
		width: 100% !important;
		height: auto !important;
		min-width: 0 !important;
		overflow: visible !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
		background: transparent !important;
		box-shadow: none !important;
		gap: 20px !important;
	}

	body .site-header .site-navigation__menu {
		grid-area: menu !important;
		direction: rtl !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		min-width: 0 !important;
		overflow: visible !important;
	}

	body .site-header .site-navigation__menu > .msh-menu,
	body .site-header .site-navigation__menu > div > .msh-menu {
		justify-content: center !important;
		margin-inline: auto !important;
	}

	body .site-header .site-navigation__actions {
		grid-area: actions !important;
		direction: rtl !important;
		display: flex !important;
		align-items: center !important;
		justify-content: flex-start !important;
		justify-self: start !important;
		min-width: max-content !important;
		gap: 10px !important;
		white-space: nowrap !important;
	}

	body .site-header .mobile-menu-head,
	body .site-header .mobile-menu-contact,
	body .site-header .menu-toggle {
		display: none !important;
	}
}

/* Search overlay is owned by V50, independent of legacy body-version classes. */
body .msh-search-overlay[hidden] {
	display: none !important;
}

body .msh-search-overlay.is-open:not([hidden]) {
	position: fixed !important;
	inset: 0 !important;
	z-index: 100000 !important;
	display: grid !important;
	place-items: center !important;
	padding: clamp(12px, 3vw, 28px) !important;
	background: rgba(4, 10, 26, .58) !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

body .msh-search-overlay__backdrop {
	position: absolute !important;
	inset: 0 !important;
	cursor: default;
}

body .msh-search-overlay__panel {
	position: relative !important;
	z-index: 1 !important;
	width: min(760px, 100%) !important;
	max-height: min(760px, calc(100dvh - 32px)) !important;
	overflow: auto !important;
	border-radius: 24px !important;
	background: #fff !important;
	box-shadow: 0 28px 90px rgba(4, 10, 26, .28) !important;
}

body.search-is-open {
	overflow: hidden !important;
}

/* Mobile keeps the existing drawer model, but ensures logo right / toggle left. */
@media (max-width: 1180px) {
	body .site-header .site-header__inner {
		direction: ltr !important;
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
	}

	body .site-header .site-brand {
		order: 2 !important;
		direction: rtl !important;
		margin-inline-start: auto !important;
	}

	body .site-header .menu-toggle {
		order: 1 !important;
		margin-inline-end: auto !important;
	}

	body .site-header .site-navigation {
		direction: rtl !important;
	}
}

@media (max-width: 767px) {
	body .msh-search-overlay.is-open:not([hidden]) {
		align-items: start !important;
		padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)) !important;
	}

	body .msh-search-overlay__panel {
		width: 100% !important;
		max-height: calc(100dvh - 24px) !important;
		border-radius: 20px !important;
	}

	body .msh-search-overlay__panel form {
		grid-template-columns: 1fr !important;
	}

	body .msh-search-overlay__panel button[type="submit"] {
		width: 100% !important;
	}
}
