/**
 * #15065/9: единая sticky-полоска шапки для корзины и поиска на мобиле.
 */
@media screen and (max-width: 1024px) {
	/* Шапка с кнопками всегда поверх поиска/корзины */
	body.task-15065-mobile-header.fx-mobile-menu .center_block.responsive-red {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: 40px !important;
		z-index: 10003 !important;
		/* Тень иначе ложится поверх контента модалок (пустая корзина и т.п.) */
		box-shadow: none !important;
	}

	/* Пока открыто меню/поиск/корзина — логотип под полоской не должен просвечивать */
	body.task-15065-mobile-header.open-mobile-essence .responsive-logo-wrapper {
		visibility: hidden !important;
	}

	/*
	 * JivoChat: в репозитории отдельной правки не нашли; виджет грузится из headCounters.
	 * Наши z-index модалок (~10000) ниже типичного z-index Jivo, поэтому кнопка могла
	 * оставаться поверх. При открытых модалках прячем/опускаем виджет.
	 */
	body.task-15065-mobile-header.open-mobile-essence jdiv,
	body.task-15065-mobile-header.task-15065-cart-open jdiv,
	body.task-15065-mobile-header.task-15065-search-open jdiv,
	body.task-15065-mobile-header.open-mobile-essence #jivo_custom_widget,
	body.task-15065-mobile-header.open-mobile-essence #jivo-iframe-container,
	body.task-15065-mobile-header.open-mobile-essence .globalClass_ET {
		z-index: 1 !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}

	body.task-15065-mobile-header.fx-mobile-menu .responsive-red .md-menu-trigger,
	body.task-15065-mobile-header.fx-mobile-menu .responsive-red .header-columns.h-column-2,
	body.task-15065-mobile-header.fx-mobile-menu .responsive-red .header-columns.h-column-4 > .signin-block,
	body.task-15065-mobile-header.fx-mobile-menu .responsive-red .header-columns.h-column-4 > .loup-wrapper,
	body.task-15065-mobile-header.fx-mobile-menu .responsive-red .header-columns.h-column-4 > #cart_line {
		position: relative !important;
		z-index: 10005 !important;
	}

	body.task-15065-mobile-header.site-search-active header.main {
		position: relative !important;
		z-index: 10002 !important;
	}

	/* Мобильный поиск: затемнение (.ss-overlay) убираем — иначе затемняется панель кнопок */
	body.task-15065-mobile-header .ss-overlay,
	body.task-15065-mobile-header.site-search-active .ss-overlay,
	body.task-15065-mobile-header.task-15065-search-open .ss-overlay {
		display: none !important;
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}

	/* Поиск — только в режиме поиска, не при открытом каталоге */
	body.task-15065-mobile-header.task-15065-search-open .after_header .right_part.search-wrapper {
		top: 40px !important;
		left: 0 !important;
		width: 100% !important;
		height: calc(100dvh - 40px) !important;
		max-height: calc(100dvh - 40px) !important;
		position: fixed !important;
		z-index: 10001 !important;
		box-sizing: border-box;
	}

	body.task-15065-mobile-header.task-15065-search-open .after_header .right_part.search-wrapper .site-search .search-result {
		height: calc(100dvh - 40px - 54px) !important;
		max-height: calc(100dvh - 40px - 54px) !important;
	}

	/* Каталог: вплотную под полоской; зазор только внутри (белый padding), без просвета */
	body.task-15065-mobile-header.fx-mobile-menu nav.catalog_left,
	body.task-15065-mobile-header.open-mobile-essence nav.catalog_left {
		position: fixed !important;
		top: 40px !important;
		bottom: 0 !important;
		left: 0 !important;
		width: 100% !important;
		max-height: none !important;
		height: auto !important;
		padding-top: 16px !important;
		margin-top: 0 !important;
		background: #fff !important;
		z-index: 10001 !important;
		box-sizing: border-box;
		overflow-y: auto !important;
	}

	/*
	 * Корзина: на весь экран, контент ниже полоски через padding-top.
	 * Дополнительный внутренний отступ, чтобы контент не сливался с кнопками.
	 */
	body.task-15065-mobile-header.task-15065-cart-open .dynamic-cart.show-cart,
	body.task-15065-mobile-header .dynamic-cart.show-cart {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		top: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 56px 0 0 0 !important; /* 40px полоска + 16px зазор под тень/контент */
		background: #fff !important;
		z-index: 10000 !important;
		overflow: hidden;
		box-sizing: border-box;
	}

	body.task-15065-mobile-header.task-15065-cart-open .dynamic-cart.show-cart .bx_cart_block,
	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block {
		position: relative !important;
		left: auto !important;
		right: auto !important;
		top: auto !important;
		bottom: auto !important;
		width: 100% !important;
		max-width: none !important;
		max-height: none !important;
		height: 100% !important;
		padding-top: 0 !important;
		margin: 0 !important;
		background: #fff !important;
		z-index: auto !important;
		display: flex !important;
		flex-direction: column;
		box-sizing: border-box;
		overflow: hidden;
		border: none;
		box-shadow: none;
	}

	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .bx_item_listincart {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		min-height: 0;
		overflow: hidden;
		width: 100%;
	}

	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .bx_itemlist_container {
		flex: 1 1 auto;
		overflow-y: auto;
		min-height: 0;
		height: auto !important;
		max-height: none !important;
		-webkit-overflow-scrolling: touch;
	}

	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .empty-cart-info {
		flex-shrink: 0;
		background: #fff;
		margin-top: 0 !important;
		padding-top: 16px !important;
	}

	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block > .clearfix,
	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .total-price,
	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .bx_button_container,
	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .empty-cart-button {
		flex-shrink: 0;
		background: #fff;
	}

	body.task-15065-mobile-header .dynamic-cart.show-cart .bx_cart_block .cart-close-button {
		display: none;
	}

	body.task-15065-mobile-header #cart_line.open {
		background: #a21e54;
	}

	body.task-15065-mobile-header #cart_line.open .cart-block a:before {
		background: url(../images/mobile/white_close.svg) 0 0 no-repeat;
		background-size: contain;
	}

	body.task-15065-mobile-header #cart_line.open .md-inline {
		display: none;
	}
}
