/* Main navigation — separators + larger hit areas */

.menu_header {
	font-family: "Nunito", "ProximaNova", sans-serif;
	background: #fff;
	box-shadow: 0 2px 10px rgba(28, 36, 24, 0.06);
	border-top: 1px solid rgba(0, 0, 0, 0.04);
	position: relative;
	z-index: 120;
}

.menu_header .wr {
	max-width: 1223px;
}

.menu_header .wr > ul.menu {
	display: flex;
	align-items: stretch;
	justify-content: center;
	flex-wrap: nowrap;
	width: 100%;
	max-width: 100%;
	height: auto;
	min-height: 58px;
	margin: 0;
	padding: 0;
	gap: 0;
	list-style: none;
	position: relative;
}

.menu_header .wr > ul.menu > li {
	display: flex;
	align-items: center;
	position: relative;
	flex: 1 1 auto;
	justify-content: center;
	margin: 0;
	padding: 0;
}

/* Mega-menu: dropdown spans full nav, not the narrow parent item */
.menu_header .wr > ul.menu > li.menu-item-has-children {
	position: static;
}

/* Vertical separators between items (on the link — parent may be position:static) */
.menu_header .wr > ul.menu > li:not(:last-child) > a {
	box-shadow: inset -1px 0 0 #d8ddd4;
}

.menu_header .wr > ul.menu > li:not(:last-child)::after {
	display: none;
}

.menu_header .wr > ul.menu > li > a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	min-height: 58px;
	padding: 14px 12px 16px;
	font-family: "Nunito", "ProximaNova", sans-serif !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	letter-spacing: -0.01em;
	text-transform: none;
	text-align: center;
	text-decoration: none;
	color: #2a3228 !important;
	position: relative;
	transition: color 0.2s ease, background-color 0.2s ease;
	white-space: normal;
}

.menu_header .wr > ul.menu > li > a:hover,
.menu_header .wr > ul.menu > li:hover > a {
	color: #319030 !important;
	background: rgba(49, 144, 48, 0.05);
}

/* Active / current underline */
.menu_header .wr > ul.menu > li.current-menu-item > a,
.menu_header .wr > ul.menu > li.current-menu-parent > a,
.menu_header .wr > ul.menu > li.current-menu-ancestor > a,
.menu_header .wr > ul.menu > li.current_page_item > a {
	color: #319030 !important;
}

.menu_header .wr > ul.menu > li.current-menu-item > a::before,
.menu_header .wr > ul.menu > li.current-menu-parent > a::before,
.menu_header .wr > ul.menu > li.current-menu-ancestor > a::before,
.menu_header .wr > ul.menu > li.current_page_item > a::before {
	content: "";
	display: block;
	width: calc(100% - 16px);
	max-width: 100%;
	height: 3px;
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	border-radius: 3px 3px 0 0;
	background: #319030;
}

/* Dropdown caret — keep clear of label */
.menu_header .wr > ul.menu > li.menu-item-has-children > a {
	padding-right: 18px;
}

.menu_header .wr > ul.menu > li.menu-item-has-children > a::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	position: absolute;
	right: 6px;
	top: 50%;
	margin-top: -2px;
	background: url(../i/arrow.svg) 0 0 no-repeat;
	opacity: 0.55;
	transform: none;
}

.menu_header .wr > ul.menu > li.menu-item-has-children:hover > a::after {
	opacity: 1;
}

/* Submenu — drop below the whole menu bar */
.menu_header .wr > ul.menu > li .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin-top: 0;
	padding: 12px 0 20px;
	border-radius: 0 0 12px 12px;
	z-index: 200;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 10px 28px rgba(28, 36, 24, 0.14);
}

@media screen and (min-width: 1001px) {
	.menu_header .wr > ul.menu > li.menu-item-has-children:hover > .sub-menu,
	.menu_header .wr > ul.menu > li.menu-item-has-children:focus-within > .sub-menu {
		display: block;
	}
}

.menu_header .wr > ul.menu > li .sub-menu > .wr {
	max-width: 1223px;
	margin: 0 auto;
	box-sizing: border-box;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0;
	max-width: 100% !important;
	width: 100%;
	flex-wrap: unset;
	align-items: stretch;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box > li {
	width: auto !important;
	max-width: 100%;
	float: none;
	position: relative;
	display: block;
	padding: 0;
	margin: 0;
	min-width: 0;
	border-bottom: 1px solid #d8ddd4;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box > li:nth-child(3n + 1),
.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box > li:nth-child(3n + 2) {
	border-right: 1px solid #d8ddd4;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a {
	font-family: "Nunito", "ProximaNova", sans-serif !important;
	font-size: 16px !important;
	line-height: 1.35 !important;
	font-weight: 800 !important;
	letter-spacing: -0.01em;
	padding: 12px 16px;
	border-radius: 0;
	display: flex !important;
	align-items: center;
	gap: 12px;
	position: relative;
	white-space: normal;
	overflow-wrap: anywhere;
	box-sizing: border-box;
	min-height: 68px;
	color: #2a3228 !important;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a .sub_menu_thumb {
	display: block;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	object-fit: cover;
	border-radius: 8px;
	background: #f3f1ed;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a .sub_menu_text {
	display: block;
	position: static !important;
	top: auto !important;
	left: auto !important;
	margin: 0 !important;
	min-width: 0;
	flex: 1 1 auto;
	color: #2a3228 !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	line-height: 1.35 !important;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a:hover .sub_menu_text {
	color: #319030 !important;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a span.sub {
	position: static !important;
	display: block;
	margin-top: 2px;
	line-height: 1.35;
	font-weight: 600;
	font-size: 12px;
	color: #7a8276;
}

.menu_header .wr > ul.menu > li .sub-menu .sub_menu_box li a:hover {
	background: rgba(49, 144, 48, 0.07);
	color: #319030 !important;
}

/* Short dropdowns («О компании», «Услуги») — compact list, not a 3-col grid */
.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu {
	left: auto;
	right: auto;
	top: 100%;
	width: max-content;
	min-width: 260px;
	max-width: min(360px, 90vw);
	padding: 6px 0;
	margin-top: 0;
	border-radius: 0 0 12px 12px;
	border: 1px solid #e4e8e1;
	border-top: none;
	box-shadow: 0 10px 28px rgba(28, 36, 24, 0.14);
	overflow: visible;
	background: #fff;
}

/* Invisible hover bridge — cursor can travel from parent to dropdown */
.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -12px;
	height: 12px;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact {
	position: relative;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box {
	display: flex !important;
	flex-direction: column;
	gap: 0;
	grid-template-columns: none;
	max-width: none !important;
	width: 100%;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box > li {
	padding: 0;
	border: none;
	width: 100% !important;
	border-bottom: 1px solid #eef1ec;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box > li:last-child {
	border-bottom: none;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box li a {
	padding: 16px 22px !important;
	min-height: 0;
	display: block !important;
	gap: 0;
	font-family: "Nunito", "ProximaNova", sans-serif !important;
	font-size: 16px !important;
	font-weight: 800 !important;
	line-height: 1.3 !important;
	letter-spacing: -0.01em;
	color: #2a3228 !important;
	border-radius: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box li a:hover {
	background: rgba(49, 144, 48, 0.08) !important;
	color: #319030 !important;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box li a .sub_menu_thumb {
	display: none !important;
}

.menu_header .wr > ul.menu > li.gsc_menu_compact .sub-menu .sub_menu_box li a .sub_menu_text {
	display: block;
	position: static !important;
	margin: 0 !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	color: inherit !important;
	line-height: inherit !important;
}

/* Contacts — slightly stronger CTA feel */
.menu_header .wr > ul.menu > li a[href*="kontakty"] {
	color: #1f2a1c;
}

/* Wider desktop: a bit more air */
@media screen and (min-width: 1200px) {
	.menu_header .wr > ul.menu > li > a {
		font-size: 17px !important;
		padding-left: 14px;
		padding-right: 14px;
	}

	.menu_header .wr > ul.menu > li.menu-item-has-children > a {
		padding-right: 22px;
	}
}

/* Compact desktop / large tablet */
@media screen and (max-width: 1100px) and (min-width: 1001px) {
	.menu_header .wr > ul.menu > li > a {
		font-size: 14px !important;
		padding-left: 8px;
		padding-right: 8px;
		letter-spacing: -0.01em;
	}

	.menu_header .wr > ul.menu > li:not(:last-child)::after {
		height: 16px;
	}
}

/* Mobile open menu */
.menu_header.open {
	font-family: "Nunito", "ProximaNova", sans-serif;
}

.menu_header.open > .wr > ul.menu {
	display: block;
	height: auto;
}

.menu_header.open > .wr > ul.menu > li {
	display: block;
	padding: 0;
	border-top: 1px solid #e8e8e8;
	flex: none;
	justify-content: flex-start;
}

.menu_header.open > .wr > ul.menu > li:not(:last-child)::after {
	display: none;
}

.menu_header.open > .wr > ul.menu > li:not(:last-child) > a {
	box-shadow: none;
}

.menu_header.open > .wr > ul.menu > li.menu-item-has-children,
.menu_header.open > .wr > ul.menu > li.gsc_menu_compact {
	position: relative;
}

.menu_header.open > .wr > ul.menu > li .sub-menu {
	position: static !important;
	top: auto !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	box-shadow: none;
	padding: 0 0 8px;
	border-radius: 0;
	overflow: visible;
}

.menu_header.open > .wr > ul.menu > li .sub-menu .sub_menu_box {
	display: block !important;
	grid-template-columns: none;
}

.menu_header.open > .wr > ul.menu > li .sub-menu .sub_menu_box > li {
	border-right: none !important;
	border-bottom: none;
}

.menu_header.open > .wr > ul.menu > li .sub-menu .sub_menu_box li a {
	min-height: 0;
	padding: 10px 30px 10px 48px;
}

.menu_header.open .sub_menu_thumb {
	width: 36px;
	height: 36px;
	flex-basis: 36px;
}

.menu_header.open > .wr > ul.menu > li > a {
	display: block;
	width: auto;
	min-height: 0;
	padding: 16px 30px;
	font-size: 17px !important;
	text-align: left;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.35 !important;
	background: transparent !important;
}

.menu_header.open > .wr > ul.menu > li.current-menu-item > a::before,
.menu_header.open > .wr > ul.menu > li.current-menu-parent > a::before,
.menu_header.open > .wr > ul.menu > li.current-menu-ancestor > a::before,
.menu_header.open > .wr > ul.menu > li.current_page_item > a::before {
	display: none;
}

.menu_header.open > .wr > ul.menu > li.current-menu-item > a,
.menu_header.open > .wr > ul.menu > li.current-menu-parent > a,
.menu_header.open > .wr > ul.menu > li.current_page_item > a {
	color: #319030 !important;
	background: rgba(49, 144, 48, 0.06) !important;
}

.menu_header.open > .wr > ul.menu > li.menu-item-has-children > a {
	padding-right: 48px;
}

.menu_header.open > .wr > ul.menu > li.menu-item-has-children > a::after {
	right: 28px;
	top: 22px;
	margin-top: 0;
	width: 8px;
	height: 5px;
	background: url(../i/carret.svg) 0 0 no-repeat;
	opacity: 1;
}
