/* iDanny unified mobile header. Matches the approved front-page layout site-wide. */

.idanny-home-search-link,
.idanny-home-account-link { display: none; }

@media only screen and (max-width: 768px) {
	body #header .header_mid_outer { padding: 0 !important; background: #fff !important; }
	body #header .header_mid_inner {
		position: relative !important; display: block !important;
		width: 100% !important; max-width: none !important;
		height: 78px !important; min-height: 78px !important;
		margin: 0 !important; padding: 0 !important; box-sizing: border-box !important;
	}
	body #header .resp_mid_nav_wrap,
	body #header .mid_search_but_wrap_resp,
	body #header .idanny-home-search-link,
	body #header .logo_wrap,
	body #header .cmsmasters_header_cart_link,
	body #header .idanny-home-account-link {
		position: absolute !important; top: 50% !important;
		margin: 0 !important; padding: 0 !important; float: none !important;
		transform: translateY(-50%) !important;
	}
	body #header .resp_mid_nav_wrap {
		left: 12px !important; display: flex !important; width: 42px !important; height: 48px !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .resp_mid_nav_outer,
	body #header .responsive_nav.resp_mid_nav {
		display: flex !important; width: 42px !important; height: 48px !important; margin: 0 !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .mid_search_but_wrap_resp,
	body #header .idanny-home-search-link {
		left: 58px !important; display: flex !important; width: 42px !important; height: 48px !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .mid_search_but_wrap_resp { display: none !important; }
	body #header .idanny-home-search-link,
	body #header .idanny-home-account-link {
		border: 0 !important; outline: 0 !important; background: transparent !important;
		color: #17171b !important; text-decoration: none !important; cursor: pointer !important;
		box-shadow: none !important; z-index: 100002 !important;
	}
	body #header .idanny-home-search-link svg,
	body #header .idanny-home-account-link svg {
		display: block !important; width: 28px !important; height: 28px !important;
		fill: none !important; stroke: currentColor !important; stroke-width: 2.2 !important;
		stroke-linecap: round !important; stroke-linejoin: round !important;
	}
	body #header .mid_search_but_wrap_resp .mid_search_but {
		position: relative !important; display: flex !important; width: 42px !important; height: 48px !important;
		margin: 0 !important; align-items: center !important; justify-content: center !important;
		inset: auto !important; transform: none !important;
	}
	body #header .mid_search_but_wrap_resp .mid_search_but::before {
		position: static !important; inset: auto !important; margin: 0 !important; transform: none !important;
	}
	body #header .logo_wrap {
		left: 50% !important; display: flex !important; width: 76px !important; height: 58px !important;
		align-items: center !important; justify-content: center !important;
		transform: translate(-50%, -50%) !important; pointer-events: auto !important;
	}
	body #header .logo_wrap .logo {
		display: flex !important; width: 76px !important; height: 58px !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .logo_wrap img:not(.logo_retina) {
		display: block !important; width: auto !important; max-width: 68px !important;
		height: auto !important; max-height: 48px !important; margin: 0 !important;
	}
	body #header .logo_wrap img.logo_retina { display: none !important; width: 0 !important; height: 0 !important; }
	body #header .cmsmasters_header_cart_link {
		right: 66px !important; display: flex !important; width: 38px !important; height: 48px !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .idanny-home-account-link {
		right: 14px !important; display: flex !important; width: 38px !important; height: 48px !important;
		align-items: center !important; justify-content: center !important;
	}
	body #header .cmsmasters_header_cart_link .count_wrap {
		display: flex !important; align-items: center !important; justify-content: center !important;
	}
	body #header .cmsmasters_dynamic_cart_wrap,
	body #header .mid_search_but_wrap,
	body #header .mid_nav_wrap { display: none !important; }

	/* Blog archives previously hid the store header on phones. */
	html body.blog #page #header,
	html body.category #page #header {
		display: block !important;
		background: #fff !important;
	}

	/* The shared site burger replaces the duplicate blog-only catalog button. */
	body.blog .idanny-media__menu,
	body.category .idanny-media__menu {
		display: none !important;
	}

	body.blog .idanny-media__masthead,
	body.category .idanny-media__masthead {
		justify-content: center !important;
	}

	/* Мобильный каталог: JS добавляет класс после нажатия штатного бургера. */
	body.idanny-mobile-menu-open {
		overflow: hidden !important;
	}
	body.idanny-mobile-menu-open #header .mid_nav_wrap {
		display: block !important;
		position: fixed !important;
		top: 78px !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: calc(100dvh - 78px) !important;
		max-height: calc(100dvh - 78px) !important;
		margin: 0 !important;
		padding: 14px 18px 30px !important;
		box-sizing: border-box !important;
		overflow-x: hidden !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		background: #fff !important;
		box-shadow: 0 12px 28px rgba(24, 24, 35, .14) !important;
		z-index: 100000 !important;
	}
	body.idanny-mobile-menu-open #header .mid_nav_wrap nav,
	body.idanny-mobile-menu-open #header .mid_nav_wrap .navigation {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
}

@media only screen and (max-width: 370px) {
	body #header .resp_mid_nav_wrap { left: 6px !important; }
	body #header .mid_search_but_wrap_resp,
	body #header .idanny-home-search-link { left: 46px !important; }
	body #header .cmsmasters_header_cart_link { right: 45px !important; }
	body #header .idanny-home-account-link { right: 4px !important; }
	body #header .logo_wrap img:not(.logo_retina) { max-width: 60px !important; }
}
