.slxh-header,
.slxh-header * {
	box-sizing: border-box;
}

.slxh-header {
	position: relative;
	z-index: 100;
	width: 100%;
}

.slxh-row {
	position: relative;
	z-index: 1;
	color: var(--slxh-row-text);
	background: var(--slxh-row-bg);
	border: var(--slxh-row-border);
	border-radius: var(--slxh-row-radius);
}

.slxh-row--shadow { box-shadow: 0 10px 32px rgba(15, 23, 42, .1); }

/* Верхние строки должны оставаться над следующими, когда раскрывается подменю. */
.slxh-row--top { z-index: 3; }
.slxh-row--middle { z-index: 2; }
.slxh-row--bottom { z-index: 1; }

.slxh-row--sticky {
	position: sticky;
	top: var(--slxh-sticky-top, 0px);
	z-index: 101;
}

.slxh-row--top.slxh-row--sticky { z-index: 103; }
.slxh-row--middle.slxh-row--sticky { z-index: 102; }
.slxh-row--bottom.slxh-row--sticky { z-index: 101; }

.slxh-row__inner {
	width: min(var(--slxh-container), 100% - calc(var(--spacing, 2rem) * 2));
	max-width: none;
	margin: 0 auto;
	padding: var(--slxh-row-padding) 0;
	min-height: var(--slxh-row-min-height);
	color: var(--slxh-row-text);
	background: transparent;
}

.slxh-grid {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--slxh-row-gap);
}

.slxh-row--layout-equal .slxh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slxh-row--layout-center_wide .slxh-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 2fr) minmax(0, 1fr); }

.slxh-column {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.slxh-column--center { justify-content: center; }
.slxh-column--right { justify-content: flex-end; }
.slxh-component { min-width: 0; }
.slxh-component:empty { display: none; }

.slxh-row a:not(.slxh-button) {
	color: var(--slxh-row-link);
}

.slxh-row a:not(.slxh-button):hover,
.slxh-row a:not(.slxh-button):focus-visible {
	color: var(--slxh-row-hover);
}

.slxh-contact {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
}

.slxh-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: currentColor;
}

.slxh-component--branding .site-header__branding {
	display: flex;
	align-items: center;
	margin: 0;
}

.slxh-component--branding .site-header__logo {
	display: block;
	width: auto;
	max-width: 190px;
	max-height: var(--slxh-logo-height);
	object-fit: contain;
}

.slxh-branding {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.slxh-branding__logo,
.slxh-branding__text { display: flex; min-width: 0; }
.slxh-branding__text { flex-direction: column; }
.slxh-branding__logo img { display: block; width: auto; max-width: 190px; max-height: var(--slxh-logo-height); object-fit: contain; }

.slxh-component--branding .site-title,
.slxh-site-title {
	font-size: var(--slxh-title-size);
	font-weight: var(--slxh-title-weight);
	line-height: 1.15;
	text-decoration: none;
}

.slxh-site-tagline {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.25;
	opacity: .72;
}

.slxh-nav__menu,
.slxh-nav__menu ul,
.slxh-mobile-nav__menu,
.slxh-mobile-nav__menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.slxh-nav__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--slxh-menu-gap);
}

.slxh-nav__menu > li { position: relative; }

.slxh-nav__menu a {
	display: block;
	padding: var(--slxh-menu-pad-y) var(--slxh-menu-pad-x);
	font-size: var(--slxh-menu-size);
	font-weight: var(--slxh-menu-weight);
	line-height: 1.25;
	text-decoration: none;
	border-radius: 10px;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}

.slxh-nav__menu a:hover,
.slxh-nav__menu a:focus-visible,
.slxh-nav__menu .current-menu-item > a {
	background: color-mix(in srgb, var(--slxh-row-hover) 10%, transparent);
}

.slxh-nav__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	display: grid;
	visibility: hidden;
	min-width: var(--slxh-submenu-width);
	padding: 8px;
	opacity: 0;
	background: var(--slxh-submenu-bg);
	border: 1px solid rgba(0,0,0,.08);
	border-radius: var(--slxh-submenu-radius);
	box-shadow: 0 16px 40px rgba(0,0,0,.14);
	transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.slxh-nav__menu .sub-menu .sub-menu {
	top: -8px;
	left: calc(100% + 6px);
}

.slxh-nav__menu li:hover > .sub-menu,
.slxh-nav__menu li:focus-within > .sub-menu {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.slxh-nav__menu .sub-menu a {
	color: var(--slxh-submenu-text) !important;
	white-space: normal;
}

.slxh-nav__menu > .menu-item-has-children > a::after {
	display: inline-block;
	margin-left: 7px;
	font-size: .75em;
	content: '▾';
}

.slxh-socials {
	display: flex;
	align-items: center;
	gap: 8px;
}

.slxh-social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	font-size: 11px;
	font-weight: 800;
	text-decoration: none;
	background: #fff;
	border: 1px solid rgba(0,0,0,.1);
	border-radius: 12px;
	transition: transform .18s ease, border-color .18s ease;
}

.slxh-social:hover { transform: translateY(-2px); }
.slxh-social--telegram { color: #27a7e7 !important; }
.slxh-social--vk { color: #0077ff !important; }
.slxh-social--dzen { color: #111 !important; }
.slxh-social--max { color: #6c55f5 !important; }

.slxh-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	color: #fff !important;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	background: var(--slxh-accent);
	border-radius: 10px;
	box-shadow: 0 8px 20px color-mix(in srgb, var(--slxh-accent) 24%, transparent);
	transition: filter .18s ease, transform .18s ease;
}

.slxh-button:hover,
.slxh-button:focus-visible {
	color: #fff !important;
	filter: brightness(.93);
	transform: translateY(-1px);
}

.slxh-component--search .search-form {
	display: flex;
	align-items: stretch;
	margin: 0;
}

.slxh-component--search .search-field {
	min-width: 150px;
	max-width: 220px;
	min-height: 42px;
	padding: 8px 12px;
	border: 1px solid rgba(0,0,0,.14);
	border-radius: 10px 0 0 10px;
}

.slxh-component--search .search-submit {
	min-height: 42px;
	padding: 8px 12px;
	color: #fff;
	background: var(--slxh-accent);
	border: 0;
	border-radius: 0 10px 10px 0;
}

.slxh-menu-placeholder {
	font-size: 13px;
	text-decoration: underline;
}

.slxh-mobile-bar,
.slxh-mobile-drawer {
	display: none;
}

@media (min-width: 901px) {
	.slxh-row--hide-desktop { display: none; }
	body.slxh-menu-open { overflow: visible; }
}

@media (max-width: 1100px) and (min-width: 901px) {
	.slxh-row__inner { width: min(var(--width-mid, 800px), 100% - 4rem); }
	.slxh-grid { grid-template-columns: auto minmax(260px, 1fr) auto; gap: 14px; }
	.slxh-nav__menu a { padding-inline: 8px; font-size: 14px; }
	.slxh-social { width: 38px; height: 38px; }
}

@media (max-width: 900px) {
	body.slxh-menu-open { overflow: hidden; }
	.slxh-row--hide-mobile { display: none; }
	.slxh-row__inner { width: 100%; padding-inline: var(--slxh-mobile-padding); border-radius: 0; }
	.slxh-row--middle .slxh-grid { display: none; }
	.slxh-row:not(.slxh-row--middle) .slxh-grid {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px 16px;
	}
	.slxh-row:not(.slxh-row--middle) .slxh-column {
		justify-content: center;
		flex-wrap: wrap;
	}
	.slxh-row:not(.slxh-row--middle) .slxh-component--primary-menu,
	.slxh-row:not(.slxh-row--middle) .slxh-component--secondary-menu,
	.slxh-row:not(.slxh-row--middle) .slxh-component--utility-menu { display: none; }
	.slxh-mobile-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-height: var(--slxh-mobile-height);
	}
	.slxh-mobile-bar__side { display: flex; align-items: center; gap: 10px; min-width: 0; }
	.slxh-mobile-bar__side--left { flex: 1 1 auto; }
	.slxh-mobile-bar__side--right { flex: 0 0 auto; justify-content: flex-end; }
	.slxh-mobile-bar .slxh-contact span { display: none; }
	.slxh-mobile-bar .slxh-socials { gap: 4px; }
	.slxh-mobile-bar .slxh-social { width: 38px; height: 38px; }
	.slxh-mobile-bar .slxh-button {
		min-height: 42px;
		padding: 9px 14px;
		font-size: 14px;
		white-space: nowrap;
	}
	.slxh-mobile-bar .slxh-component--branding .site-header__logo,
	.slxh-mobile-bar .slxh-branding__logo img { max-width: 150px; max-height: min(var(--slxh-logo-height), 52px); }
	.slxh-mobile-bar .slxh-site-title { font-size: min(var(--slxh-title-size), 20px); }
	.slxh-mobile-bar .slxh-site-tagline { display: none; }
	.slxh-mobile-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		flex: 0 0 auto;
		padding: 0;
		color: var(--slxh-row-link);
		background: transparent;
		border: 1px solid currentColor;
		border-radius: 12px;
	}
	.slxh-mobile-toggle__icon,
	.slxh-mobile-toggle__icon::before,
	.slxh-mobile-toggle__icon::after {
		display: block;
		width: 22px;
		height: 2px;
		background: currentColor;
		border-radius: 2px;
	}
	.slxh-mobile-toggle__icon { position: relative; }
	.slxh-mobile-toggle__icon::before,
	.slxh-mobile-toggle__icon::after { position: absolute; left: 0; content: ''; }
	.slxh-mobile-toggle__icon::before { top: -7px; }
	.slxh-mobile-toggle__icon::after { top: 7px; }
	.slxh-mobile-drawer {
		position: fixed;
		inset: 0;
		z-index: 99999;
		display: block;
		visibility: hidden;
		pointer-events: none;
	}
	.slxh-mobile-drawer.is-open { visibility: visible; pointer-events: auto; }
	.slxh-mobile-overlay {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		padding: 0;
		opacity: 0;
		background: rgba(15,23,42,.55);
		border: 0;
		transition: opacity .25s ease;
	}
	.slxh-mobile-drawer.is-open .slxh-mobile-overlay { opacity: 1; }
	.slxh-mobile-panel {
		position: absolute;
		top: 0;
		right: 0;
		width: min(88vw, var(--slxh-mobile-width));
		height: 100%;
		padding: 72px 24px 30px;
		overflow-y: auto;
		color: var(--slxh-mobile-text);
		background: var(--slxh-mobile-bg);
		box-shadow: -18px 0 50px rgba(0,0,0,.2);
		transform: translateX(104%);
		transition: transform .25s ease;
	}
	.slxh-mobile-drawer--left .slxh-mobile-panel { right: auto; left: 0; box-shadow: 18px 0 50px rgba(0,0,0,.2); transform: translateX(-104%); }
	.slxh-mobile-drawer--left .slxh-mobile-close { right: auto; left: 16px; }
	.slxh-mobile-drawer.is-open .slxh-mobile-panel { transform: translateX(0); }
	.slxh-mobile-close {
		position: absolute;
		top: 16px;
		right: 16px;
		width: 42px;
		height: 42px;
		padding: 0;
		font-size: 32px;
		line-height: 1;
		color: var(--slxh-mobile-text);
		background: #f2f4f7;
		border: 0;
		border-radius: 12px;
	}
	.slxh-mobile-nav__menu a {
		display: block;
		padding: 13px 0;
		color: var(--slxh-mobile-text);
		font-size: 17px;
		font-weight: 600;
		line-height: 1.3;
		text-decoration: none;
		border-bottom: 1px solid #e8ebef;
	}
	.slxh-mobile-nav__menu li { position: relative; }
	.slxh-mobile-nav__menu .menu-item-has-children > a {
		padding-right: 54px;
		cursor: pointer;
	}
	.slxh-mobile-nav__menu .menu-item-has-children.is-submenu-open > a {
		color: var(--slxh-accent);
	}
	.slxh-mobile-nav__menu .sub-menu { padding-left: 16px; }
	.slxh-mobile-nav__menu .sub-menu[hidden] { display: none; }
	.slxh-submenu-toggle {
		position: absolute;
		top: 0;
		right: 0;
		width: 50px;
		height: 49px;
		padding: 0;
		color: var(--slxh-mobile-text);
		background: transparent;
		border: 0;
		cursor: pointer;
	}
	.slxh-submenu-toggle::after {
		display: block;
		width: 10px;
		height: 10px;
		margin: -4px auto 0;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		content: '';
		transform: rotate(45deg);
		transition: transform .18s ease, margin .18s ease;
	}
	.slxh-submenu-toggle[aria-expanded="true"]::after {
		margin-top: 4px;
		transform: rotate(-135deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.slxh-header *, .slxh-mobile-drawer * { scroll-behavior: auto !important; transition: none !important; }
}
