/* =========================================================
   MIR DESIGN – Header & Top Bar Pro
   Независим от UX Builder и ограничен до .mdh-site-header.
   ========================================================= */

:root {
	--mdhh-navy: #142b4a;
	--mdhh-navy-dark: #0b1d33;
	--mdhh-gold: #e3b23c;
	--mdhh-gold-hover: #f0c557;
	--mdhh-white: #fff;
	--mdhh-text: #1d2a3b;
	--mdhh-muted: #6b7788;
	--mdhh-border: #e3e8ef;
	--mdhh-container: 1180px;
}

/* Скрива само стария theme header. При деактивиране всичко се възстановява. */
body.mirdesign-header-pro-active #header {
	display: none !important;
}

/*
 * Старото заглавие на WordPress страницата не трябва да стои между header-а
 * и новия HTML hero. Правилата са ограничени само до началната страница —
 * заглавията в каталога, продуктите, портфолиото и другите страници остават.
 */
body.home .entry-header,
body.home .page-header,
body.home .page-title,
body.home h1.entry-title,
body.home .entry-title {
	display: none !important;
}

body.mirdesign-header-pro-active .mdh-legacy-home-title {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
}

.mdh-head-skip {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 100001;
	padding: 11px 16px;
	border-radius: 8px;
	background: var(--mdhh-white);
	box-shadow: 0 12px 35px rgba(11, 29, 51, 0.2);
	color: var(--mdhh-navy) !important;
	font-size: 13px;
	font-weight: 700;
	transform: translateY(-160%);
	transition: transform 0.2s ease;
}

.mdh-head-skip:focus {
	transform: translateY(0);
}

.mdh-site-header {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 99990;
	width: 100%;
	background: var(--mdhh-white);
	color: var(--mdhh-text);
	font-family: inherit;
}

body.admin-bar .mdh-site-header {
	top: 32px;
}

.mdh-site-header *,
.mdh-site-header *::before,
.mdh-site-header *::after,
.mdh-head-nav,
.mdh-head-nav *,
.mdh-head-nav *::before,
.mdh-head-nav *::after {
	box-sizing: border-box;
}

.mdh-site-header a,
.mdh-head-nav a {
	color: inherit;
	text-decoration: none;
}

.mdh-head-container {
	width: min(calc(100% - 40px), var(--mdhh-container));
	margin-inline: auto;
}

/* Top bar */
.mdh-head-topbar {
	min-height: 34px;
	background: var(--mdhh-navy-dark);
	color: rgba(255, 255, 255, 0.86);
}

.mdh-head-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 34px;
}

.mdh-head-topbar__benefits,
.mdh-head-topbar__contacts {
	display: flex;
	align-items: center;
	gap: 22px;
}

.mdh-head-topbar__benefits span,
.mdh-head-topbar__contacts a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0.015em;
	line-height: 1;
}

.mdh-head-topbar__contacts a {
	color: var(--mdhh-white) !important;
	transition: color 0.2s ease;
}

.mdh-head-topbar__contacts a:hover,
.mdh-head-topbar__contacts a:focus-visible {
	color: var(--mdhh-gold) !important;
}

.mdh-head-topbar svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: var(--mdhh-gold);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.9;
}

/* Main header */
.mdh-head-main {
	position: relative;
	border-bottom: 1px solid rgba(20, 43, 74, 0.09);
	background: rgba(255, 255, 255, 0.78);
	-webkit-backdrop-filter: blur(16px) saturate(135%);
	backdrop-filter: blur(16px) saturate(135%);
	transition: box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.mdh-site-header.is-scrolled .mdh-head-main {
	border-bottom-color: rgba(20, 43, 74, 0.13);
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 12px 34px rgba(20, 43, 74, 0.12);
}

.mdh-site-header.is-menu-open .mdh-head-main {
	border-bottom-color: rgba(20, 43, 74, 0.13);
	background: rgba(255, 255, 255, 0.97);
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	box-shadow: 0 12px 34px rgba(20, 43, 74, 0.12);
}

.mdh-head-main__inner {
	display: flex;
	align-items: center;
	min-height: 78px;
}

/* Brand */
.mdh-head-brand {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 12px;
	margin-right: auto;
	color: var(--mdhh-navy) !important;
}

.mdh-head-brand__logo {
	display: grid;
	flex: 0 0 50px;
	width: 50px;
	height: 50px;
	place-items: center;
	overflow: hidden;
	border: 1px solid #e5e9ef;
	border-radius: 13px;
	background: #fff;
}

.mdh-head-brand__image {
	display: block;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 4px;
	object-fit: contain;
}

.mdh-head-brand__fallback {
	color: var(--mdhh-navy);
	font-size: 16px;
	font-weight: 850;
	letter-spacing: -0.06em;
}

.mdh-head-brand__copy {
	display: grid;
	gap: 2px;
}

.mdh-head-brand__copy strong {
	color: var(--mdhh-navy);
	font-size: 16px;
	font-weight: 850;
	letter-spacing: 0.035em;
	line-height: 1.15;
}

.mdh-head-brand__copy small {
	color: var(--mdhh-muted);
	font-size: 9px;
	font-weight: 600;
	line-height: 1.2;
}

/* Desktop navigation */
.mdh-head-nav {
	display: flex;
	align-items: center;
	margin-left: 28px;
}

.mdh-head-nav__list,
.mdh-head-nav__submenu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mdh-head-nav__list {
	display: flex;
	align-items: center;
	gap: 3px;
}

.mdh-head-nav__list > li {
	position: relative;
	margin: 0;
}

.mdh-head-nav__list > li > a,
.mdh-head-nav__list > li > button {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 44px;
	margin: 0;
	padding: 0 10px;
	border: 0;
	background: transparent;
	color: #344156 !important;
	font-family: inherit;
	font-size: 11px;
	font-weight: 750;
	letter-spacing: 0.025em;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.2s ease;
}

.mdh-head-nav__list > li > a::after,
.mdh-head-nav__list > li > button::after {
	position: absolute;
	right: 10px;
	bottom: 6px;
	left: 10px;
	height: 2px;
	border-radius: 999px;
	background: var(--mdhh-gold);
	content: "";
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.2s ease;
}

.mdh-head-nav__list > li > a:hover,
.mdh-head-nav__list > li > a:focus-visible,
.mdh-head-nav__list > li > button:hover,
.mdh-head-nav__list > li > button:focus-visible,
.mdh-head-nav__list > li > a[aria-current="page"] {
	color: var(--mdhh-navy) !important;
}

.mdh-head-nav__list > li > a:hover::after,
.mdh-head-nav__list > li > a:focus-visible::after,
.mdh-head-nav__list > li > button:hover::after,
.mdh-head-nav__list > li > button:focus-visible::after,
.mdh-head-nav__list > li > a[aria-current="page"]::after {
	transform: scaleX(1);
}

.mdh-head-nav__list > li > button svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
	transition: transform 0.2s ease;
}

.mdh-head-nav__dropdown.is-open > button svg {
	transform: rotate(180deg);
}

/* Services dropdown */
.mdh-head-nav__submenu {
	position: absolute;
	top: calc(100% + 2px);
	right: -80px;
	z-index: 5;
	width: 365px;
	padding: 10px;
	border: 1px solid var(--mdhh-border);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 22px 60px rgba(11, 29, 51, 0.16);
	opacity: 0;
	pointer-events: none;
	transform: translateY(9px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mdh-head-nav__submenu::before {
	position: absolute;
	top: -9px;
	right: 118px;
	width: 18px;
	height: 18px;
	border-top: 1px solid var(--mdhh-border);
	border-left: 1px solid var(--mdhh-border);
	background: #fff;
	content: "";
	transform: rotate(45deg);
}

.mdh-head-nav__dropdown:hover .mdh-head-nav__submenu,
.mdh-head-nav__dropdown:focus-within .mdh-head-nav__submenu,
.mdh-head-nav__dropdown.is-open .mdh-head-nav__submenu {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.mdh-head-nav__submenu li {
	position: relative;
	margin: 0;
}

.mdh-head-nav__submenu a {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 12px;
	border-radius: 12px;
	transition: background 0.18s ease, transform 0.18s ease;
}

.mdh-head-nav__submenu a:hover,
.mdh-head-nav__submenu a:focus-visible {
	background: #f7f4eb;
	transform: translateX(2px);
}

.mdh-head-nav__submenu-icon {
	display: grid;
	flex: 0 0 39px;
	width: 39px;
	height: 39px;
	place-items: center;
	border-radius: 11px;
	background: #fff5da;
	color: var(--mdhh-navy);
}

.mdh-head-nav__submenu-icon svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.mdh-head-nav__submenu strong,
.mdh-head-nav__submenu small {
	display: block;
}

.mdh-head-nav__submenu strong {
	margin-bottom: 3px;
	color: var(--mdhh-navy);
	font-size: 13px;
	font-weight: 750;
	line-height: 1.25;
}

.mdh-head-nav__submenu small {
	color: var(--mdhh-muted);
	font-size: 10px;
	line-height: 1.35;
}

.mdh-head-nav__mobile-contact {
	display: none;
}

/* CTA */
.mdh-head-cta {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 42px;
	margin-left: 12px;
	padding: 0 17px;
	border-radius: 999px;
	background: var(--mdhh-gold);
	box-shadow: 0 9px 22px rgba(227, 178, 60, 0.23);
	color: var(--mdhh-navy-dark) !important;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.025em;
	line-height: 1;
	text-transform: uppercase;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mdh-head-cta:hover,
.mdh-head-cta:focus-visible {
	background: var(--mdhh-gold-hover);
	box-shadow: 0 12px 28px rgba(227, 178, 60, 0.32);
	transform: translateY(-2px);
}

.mdh-head-cta svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

/* Mobile toggle */
.mdh-head-toggle {
	display: none;
	width: 44px;
	height: 44px;
	margin: 0 0 0 10px;
	padding: 0;
	border: 1px solid var(--mdhh-border);
	border-radius: 12px;
	background: #fff;
	place-items: center;
	cursor: pointer;
}

.mdh-head-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	margin: 3px auto;
	border-radius: 999px;
	background: var(--mdhh-navy);
	transition: transform 0.22s ease, opacity 0.22s ease;
}

.mdh-head-toggle[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(5px) rotate(45deg);
}

.mdh-head-toggle[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.mdh-head-toggle[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-5px) rotate(-45deg);
}

.mdh-head-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99980;
	background: rgba(7, 20, 36, 0.44);
	overscroll-behavior: none;
	touch-action: none;
	backdrop-filter: blur(2px);
}

.mdh-head-backdrop[hidden] {
	display: none;
}

.mdh-site-header a:focus-visible,
.mdh-site-header button:focus-visible,
.mdh-head-nav a:focus-visible,
.mdh-head-nav button:focus-visible {
	outline: 3px solid rgba(227, 178, 60, 0.55);
	outline-offset: 3px;
}

@media (max-width: 1120px) {
	.mdh-head-brand__copy small {
		display: none;
	}

	.mdh-head-nav {
		margin-left: 16px;
	}

	.mdh-head-nav__list > li > a,
	.mdh-head-nav__list > li > button {
		padding-inline: 7px;
		font-size: 10px;
	}

	.mdh-head-cta {
		padding-inline: 14px;
	}
}

@media (max-width: 920px) {
	html.mdh-head-menu-open,
	body.mdh-head-menu-open {
		overscroll-behavior: none;
	}

	.mdh-head-container {
		width: min(calc(100% - 28px), var(--mdhh-container));
	}

	.mdh-head-topbar__benefits span:nth-child(2),
	.mdh-head-topbar__contacts a:first-child {
		display: none;
	}

	.mdh-head-main__inner {
		min-height: 70px;
	}

	.mdh-head-brand__logo {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
		border-radius: 11px;
	}

	.mdh-head-brand__copy strong {
		font-size: 14px;
	}

	.mdh-head-nav {
		position: fixed;
		top: var(--mdh-mobile-nav-top, 104px);
		right: max(14px, env(safe-area-inset-right));
		left: max(14px, env(safe-area-inset-left));
		z-index: 99995;
		display: block;
		max-height: calc(100vh - var(--mdh-mobile-nav-top, 104px) - 14px);
		max-height: var(--mdh-mobile-nav-max-height, calc(100dvh - var(--mdh-mobile-nav-top, 104px) - 14px));
		margin: 0;
		padding: 14px;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-y;
		border: 1px solid var(--mdhh-border);
		border-radius: 20px;
		background: #fff;
		box-shadow: 0 24px 70px rgba(7, 20, 36, 0.22);
		opacity: 0;
		pointer-events: none;
		transform: translateY(-12px) scale(0.98);
		transform-origin: top center;
		transition: opacity 0.22s ease, transform 0.22s ease;
	}

	.mdh-head-nav.is-open {
		opacity: 1;
		pointer-events: auto;
		transform: translateY(0) scale(1);
	}

	.mdh-head-nav__list {
		display: grid;
		gap: 3px;
	}

	.mdh-head-nav__list > li > a,
	.mdh-head-nav__list > li > button {
		justify-content: space-between;
		width: 100%;
		min-height: 48px;
		padding: 0 13px;
		border-radius: 10px;
		font-size: 12px;
		text-align: left;
	}

	.mdh-head-nav__list > li > a::after,
	.mdh-head-nav__list > li > button::after {
		display: none;
	}

	.mdh-head-nav__list > li > a:hover,
	.mdh-head-nav__list > li > a:focus-visible,
	.mdh-head-nav__list > li > button:hover,
	.mdh-head-nav__list > li > button:focus-visible {
		background: #f7f4eb;
	}

	.mdh-head-nav__submenu {
		position: static;
		display: none;
		width: auto;
		margin: 2px 0 7px;
		padding: 6px;
		border: 0;
		border-radius: 12px;
		background: #f6f8fb;
		box-shadow: none;
		opacity: 1;
		pointer-events: auto;
		transform: none;
	}

	.mdh-head-nav__submenu::before {
		display: none;
	}

	.mdh-head-nav__dropdown:hover .mdh-head-nav__submenu,
	.mdh-head-nav__dropdown:focus-within .mdh-head-nav__submenu {
		display: none;
	}

	.mdh-head-nav__dropdown.is-open .mdh-head-nav__submenu {
		display: block;
	}

	.mdh-head-nav__submenu a {
		padding: 10px;
	}

	.mdh-head-nav__mobile-contact {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		margin-top: 10px;
		padding-top: 12px;
		border-top: 1px solid var(--mdhh-border);
	}

	.mdh-head-nav__mobile-contact a {
		padding: 11px 8px;
		border-radius: 10px;
		background: #f2f5f8;
		color: var(--mdhh-navy) !important;
		font-size: 11px;
		font-weight: 700;
		text-align: center;
	}

	.mdh-head-cta {
		margin-left: auto;
	}

	.mdh-head-toggle {
		display: grid;
	}
}

@media (max-width: 782px) {
	body.admin-bar .mdh-site-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	body.admin-bar .mdh-site-header {
		top: 0;
	}

	.mdh-head-topbar__benefits {
		display: none;
	}

	.mdh-head-topbar__inner {
		justify-content: center;
	}

	.mdh-head-topbar__contacts {
		width: 100%;
		justify-content: center;
	}

	.mdh-head-main__inner {
		min-height: 66px;
	}

	.mdh-head-brand {
		gap: 8px;
	}

	.mdh-head-brand__logo {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
	}

	.mdh-head-brand__copy strong {
		font-size: 12px;
		letter-spacing: 0.02em;
	}

	.mdh-head-cta {
		min-height: 38px;
		margin-left: 8px;
		padding: 0 12px;
		font-size: 9px;
	}

	.mdh-head-cta svg {
		display: none;
	}

	.mdh-head-toggle {
		width: 40px;
		height: 40px;
		margin-left: 7px;
	}

	.mdh-head-nav {
		border-radius: 18px;
	}

	.mdh-head-nav__mobile-contact {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 390px) {
	.mdh-head-brand__copy {
		display: none;
	}

	.mdh-head-cta {
		margin-left: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mdh-site-header *,
	.mdh-site-header *::before,
	.mdh-site-header *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

@media print {
	.mdh-site-header,
	.mdh-head-backdrop,
	.mdh-head-skip {
		display: none !important;
	}
}
