/* Мобильная версия: нижняя панель, строка города, компактная карточка товара, липкая панель покупки.
   Только экраны до 767px, компьютерная версия не меняется. */
.m-nav,
.m-buybar {
	display: none;
}

@media (max-width: 767px) {
	/* ---------- нижняя панель ---------- */
	body.m-has-nav {
		padding-bottom: calc(62px + env(safe-area-inset-bottom));
	}
	.m-nav {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 900;
		height: calc(62px + env(safe-area-inset-bottom));
		padding-bottom: env(safe-area-inset-bottom);
		background: #fff;
		border-top: 1px solid #e3e6ec;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
		transition: transform .2s ease;
	}
	.m-nav__item {
		flex: 1 1 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		position: relative;
		color: #4a5160;
		font-size: 11px;
		line-height: 1.2;
		text-decoration: none;
		background: none;
		border: 0;
		padding: 0;
		font-family: inherit;
		text-transform: none;
		letter-spacing: 0;
		cursor: pointer;
	}
	.m-nav__item:hover,
	.m-nav__item:focus {
		color: #1f3a6e;
		text-decoration: none;
	}
	.m-nav__item.is-active {
		color: #1f3a6e;
		font-weight: 600;
	}
	.m-nav__item svg {
		width: 24px;
		height: 24px;
		stroke: currentColor;
		fill: none;
		stroke-width: 1.7;
		stroke-linecap: round;
		stroke-linejoin: round;
	}
	.m-nav__count {
		position: absolute;
		top: 6px;
		left: 50%;
		margin-left: 6px;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		border-radius: 9px;
		background: #e2231a;
		color: #fff;
		font-size: 10px;
		font-weight: 700;
		line-height: 17px;
		text-align: center;
		box-sizing: border-box;
	}
	.m-nav__count:empty,
	.m-nav__count[data-count="0"] {
		display: none;
	}
	/* на карточке нижнюю панель заменяет панель покупки */
	body.m-buybar-on .m-nav {
		transform: translateY(110%);
	}

	/* кнопка «наверх» мешает панели — на телефоне не нужна */
	.scroll-to-top {
		display: none !important;
	}
	/* кнопка чата — над панелью, а не поверх неё */
	body.m-has-nav [class*="__jivoMobi"] {
		bottom: calc(66px + env(safe-area-inset-bottom)) !important;
		transition: opacity .2s ease;
	}
	/* на карточке чат не закрывает «В корзину» на первом экране — появляется при прокрутке */
	body.m-card:not(.m-buybar-on) [class*="__jivoMobi"] {
		opacity: 0 !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}

	/* поле поиска в шапке — по кнопке «Поиск» в нижней панели */
	body.m-ui .mobile-search-wrap {
		display: none;
	}
	body.m-ui.m-search-open .mobile-search-wrap {
		display: block;
	}

	/* ---------- строка города: вопрос прямо в строке, без всплывающего окна ---------- */
	.c-regions-select {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		min-height: 28px;
	}
	.c-regions-select.m-city-asking .regions-select-region {
		display: none !important;
	}
	.c-regions-select.m-city-asking {
		padding-top: 4px !important;
		padding-bottom: 4px !important;
	}
	.c-regions-select.m-city-asking .regions-select-question {
		display: flex !important;
	}
	.c-regions-select .regions-select-question {
		position: static !important;
		align-items: center;
		gap: 8px;
		width: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		background: none !important;
		border: 0 !important;
		box-shadow: none !important;
		transform: none !important;
	}
	.c-regions-select .regions-select-question-text {
		margin: 0 !important;
		padding: 0 !important;
		font-size: 13px;
		font-weight: 600;
		white-space: nowrap;
	}
	.c-regions-select .regions-select-question-buttons {
		display: flex;
		gap: 6px;
		margin: 0 !important;
		padding: 0 !important;
	}
	.c-regions-select .regions-select-question-button {
		margin: 0 !important;
		padding: 2px 12px !important;
		min-height: 0 !important;
		height: auto !important;
		font-size: 13px !important;
		line-height: 20px !important;
		border-radius: 4px;
	}

	/* ---------- компактная плашка cookie ---------- */
	.cookies_attention {
		padding: 10px 14px !important;
		font-size: 12px !important;
		line-height: 1.35 !important;
	}
	.cookies_attention .text {
		margin-bottom: 8px !important;
	}
	.cookies_attention .btn,
	.cookies_attention button {
		padding: 8px 12px !important;
		min-height: 0 !important;
	}
	body.m-has-nav .cookies_attention {
		bottom: calc(62px + env(safe-area-inset-bottom)) !important;
	}

	/* ---------- карточка товара ---------- */
	.m-card .catalog_detail h1,
	body.m-card h1 {
		font-size: 19px !important;
		line-height: 1.25 !important;
		margin: 4px 0 8px !important;
		text-align: left !important;
	}
	body.m-card .middle_info.main_item_wrapper {
		padding-top: 12px !important;
	}
	body.m-card .breadcrumbs {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	/* логотип бренда — лишний на телефоне; избранное, сравнение и артикул — одной строкой */
	.m-card .item_main_info .top_info .brand {
		display: none !important;
	}
	.m-card .item_main_info .top_info {
		padding-top: 6px !important;
		padding-bottom: 6px !important;
	}
	.m-card .item_main_info .top_info .wrap_md {
		align-items: center;
		min-height: 0;
	}
	/* без лишних отступов над фото */
	.m-card .item_main_info {
		padding-top: 0 !important;
	}
	/* избранное и сравнение — поверх фото справа сверху, артикул есть в характеристиках */
	.m-card .item_main_info .top_info {
		position: absolute !important;
		top: 8px !important;
		right: 8px !important;
		left: auto !important;
		width: auto !important;
		padding: 0 !important;
		margin: 0 !important;
		border: 0 !important;
		background: none !important;
		z-index: 3;
	}
	.m-card .item_main_info .top_info .wrap_md {
		padding: 0 !important;
		border: 0 !important;
	}
	.m-card .item_main_info .top_info .article {
		display: none !important;
	}
	.m-card .item_main_info .top_info .like_icons button {
		background: rgba(255, 255, 255, .92) !important;
	}
	/* фото не выше 300px */
	.m-card .item_slider .slides,
	.m-card .item_slider .slides li {
		height: 300px !important;
	}
	.m-card .item_slider .slides li img {
		max-height: 300px !important;
	}
	.m-card .img_wrapper {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
	.m-card .item_slider .slides {
		padding-top: 0 !important;
		margin-bottom: 0 !important;
	}
	.m-card .item_slider .flex-control-nav {
		position: absolute !important;
		left: 0;
		right: 0;
		bottom: 6px !important;
		margin: 0 !important;
		padding: 0 !important;
		height: auto !important;
		z-index: 2;
	}
	.m-card .img_wrapper,
	.m-card .item_slider {
		height: auto !important;
	}
	.m-card .item_slider .flex-viewport {
		height: auto !important;
	}
	/* ярлыки — маленькими плашками в одну строку */
	.m-card .img_wrapper .new-stickers {
		flex-direction: row !important;
		flex-wrap: wrap;
		gap: 4px;
		max-width: calc(100% - 110px);
	}
	.m-card .img_wrapper .new-stickers .sticker {
		width: auto !important;
		margin: 0 !important;
		padding: 2px 8px !important;
		font-size: 11px !important;
		line-height: 16px !important;
	}
	/* порядок: цена и кнопка сразу под фото, потом оттенки и остальное */
	.m-card .middle_info.main_item_wrapper {
		display: flex !important;
		flex-direction: column;
	}
	.m-card .middle_info.main_item_wrapper > * {
		order: 5;
	}
	.m-card .middle_info.main_item_wrapper > .prices_block {
		order: 1;
		width: 100% !important;
		margin-top: 0 !important;
	}
	/* блок покупки раскладываем: кнопка сразу под ценой, ссылка на магазины и акции — после оттенков */
	.m-card .middle_info.main_item_wrapper > .buy_block {
		display: contents !important;
	}
	.m-card .middle_info.main_item_wrapper > .buy_block > * {
		order: 4;
	}
	.m-card .middle_info.main_item_wrapper > .buy_block > .offer_buy_block,
	.m-card .middle_info.main_item_wrapper > .buy_block > .counter_wrapp,
	.m-card .middle_info.main_item_wrapper > .buy_block > .wrapp_one_click {
		order: 2;
		padding-top: 8px !important;
	}
	.m-card .middle_info.main_item_wrapper > .sku_props {
		order: 3;
		margin-top: 14px;
	}
	.m-card .middle_info.main_item_wrapper > .buy_block > .current-discounts {
		order: 4;
		margin: 6px 0 10px !important;
	}
	body.m-card .middle_info.main_item_wrapper {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
	.m-card .prices_block .item-stock {
		margin-top: 2px !important;
	}
	.m-card .prices_block .tabs_list {
		margin-bottom: 4px !important;
	}
	.m-card .prices_block .rating {
		display: none;
	}
	/* «Цена за» — без подписи, единицы маленькими переключателями */
	.m-card .prices_block .prices_wrapper_title {
		display: none !important;
	}
	.m-card .prices_block .prices_container_tabs_title {
		margin: 0 0 6px !important;
	}
	.m-card .prices_block .tabs_title_list {
		display: flex !important;
		justify-content: flex-start !important;
		gap: 6px;
		margin: 0 !important;
		padding: 0 !important;
	}
	.m-card .prices_block .tabs_title_list_items {
		flex: 0 0 auto !important;
		width: auto !important;
		min-height: 0 !important;
		height: auto !important;
		margin: 0 !important;
		padding: 3px 12px !important;
		font-size: 13px !important;
		line-height: 20px !important;
	}
	/* кнопки маркетплейсов на телефоне скрыты (решение владельца 25.09.2026) */
	body.m-ui .marketplace-buttons-wrapper,
	.m-card .marketplace-buttons-wrapper {
		display: none !important;
	}
	/* оттенки: два ряда, остальные по кнопке */
	.m-card .sku_props .bx_scu ul.m-sku-collapsed {
		max-height: 112px;
		overflow: hidden;
	}
	.m-sku-more {
		display: block;
		margin: 6px 0 4px;
		padding: 0;
		background: none;
		border: 0;
		color: #1f3a6e;
		font-size: 14px;
		text-decoration: underline;
		font-family: inherit;
		cursor: pointer;
	}

	/* ---------- липкая панель покупки ---------- */
	.m-buybar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 901;
		align-items: center;
		gap: 10px;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid #e3e6ec;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, .08);
		transform: translateY(110%);
		transition: transform .2s ease;
	}
	body.m-buybar-on .m-buybar {
		transform: none;
	}
	.m-buybar__swatch {
		flex: 0 0 40px;
		width: 40px;
		height: 40px;
		border-radius: 4px;
		background: #f2f3f5 center / cover no-repeat;
		border: 1px solid #e3e6ec;
	}
	.m-buybar__swatch:empty[style=""],
	.m-buybar__swatch:not([style]) {
		display: none;
	}
	.m-buybar__info {
		flex: 1 1 auto;
		min-width: 0;
	}
	.m-buybar__price {
		font-size: 17px;
		font-weight: 700;
		line-height: 1.2;
		color: #222;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.m-buybar__name {
		font-size: 12px;
		color: #6b7280;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.m-buybar__btn {
		flex: 0 0 auto;
		height: 44px;
		padding: 0 18px;
		border: 0;
		border-radius: 4px;
		background: #1f3a6e;
		color: #fff;
		font-size: 14px;
		font-weight: 700;
		text-transform: uppercase;
		font-family: inherit;
		cursor: pointer;
	}
	.m-buybar__btn.is-in-cart {
		background: #2e7d32;
	}
	/* ---------- этап 2: вкладки → раскрывающиеся блоки ---------- */
	.m-card .tabs_section ul.tabs-head.m-acc-hidden {
		display: none !important;
	}
	.m-card .tabs_section ul.tabs_content.m-acc > li {
		display: none !important;
	}
	.m-card .tabs_section ul.tabs_content.m-acc > li.m-acc-head {
		display: block !important;
	}
	/* открытый блок удерживает плавающее содержимое, иначе оно наезжает на следующие заголовки */
	.m-card .tabs_section ul.tabs_content.m-acc > li.m-open {
		display: flow-root !important;
		float: none !important;
		width: auto !important;
		height: auto !important;
	}
	.m-card .tabs_section ul.tabs_content.m-acc > li.m-open {
		padding: 4px 0 16px !important;
	}
	.m-card .tabs_section ul.tabs_content.m-acc > li.m-open #reviews_content {
		display: block !important;
	}
	.m-acc-head {
		list-style: none;
		margin: 0 !important;
		padding: 0 !important;
		border-top: 1px solid #e3e6ec;
	}
	.m-acc-head button {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 15px 4px;
		background: none;
		border: 0;
		color: #222;
		font-size: 16px;
		font-weight: 600;
		text-align: left;
		text-transform: none !important;
		letter-spacing: 0 !important;
		font-family: inherit;
		cursor: pointer;
	}
	.m-acc-head button::after {
		content: "";
		width: 9px;
		height: 9px;
		margin-right: 4px;
		border-right: 2px solid #6b7280;
		border-bottom: 2px solid #6b7280;
		transform: rotate(45deg);
		transition: transform .2s ease;
	}
	.m-acc-head.is-open button::after {
		transform: rotate(-135deg);
	}
	.m-acc-head .m-acc-count {
		margin-left: 6px;
		color: #6b7280;
		font-weight: 400;
	}
	.m-acc-head .m-acc-title {
		flex: 1 1 auto;
	}

	/* ---------- этап 2: «Собираем комплект» — одной кнопкой ---------- */
	body.m-sets-closed .catalog_detail .sets-block {
		display: none !important;
	}
	.m-sets-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		margin: 12px 0;
		padding: 14px 16px;
		background: #f3f5f9;
		border: 1px solid #dfe3ea;
		border-radius: 6px;
		color: #1f3a6e;
		font-size: 15px;
		font-weight: 600;
		text-align: left;
		text-transform: none !important;
		letter-spacing: 0 !important;
		font-family: inherit;
		cursor: pointer;
		box-sizing: border-box;
	}
	.m-sets-toggle::after {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
	}
	.m-sets-toggle.is-open::after {
		transform: rotate(-135deg);
	}

	/* ---------- этап 2: каталог эффектов, калькулятор, идеи — в один ряд ---------- */
	.m-card .block_subs.block_subs_mobile {
		display: flex !important;
		gap: 6px;
		margin: 12px 0 !important;
	}
	.m-card .block_subs.block_subs_mobile .block_sub {
		flex: 1 1 0;
		min-width: 0;
		margin: 0 !important;
		padding: 10px 4px !important;
		justify-content: center;
		border-radius: 6px;
	}
	.m-card .block_subs.block_subs_mobile .block_sub a {
		flex-direction: column;
		align-items: center;
		gap: 4px;
		text-align: center;
		font-size: 12px !important;
		line-height: 1.2;
	}
	.m-card .block_subs.block_subs_mobile .block_sub a img {
		margin: 0 !important;
	}
	/* поделиться, магазины, доставка — компактно в строку */
	.m-card .element_detail_text .iblock.sh {
		display: flex !important;
		flex-wrap: wrap;
		gap: 6px;
		width: 100% !important;
	}
	.m-card .element_detail_text .iblock.sh > * {
		margin: 0 !important;
	}
	.m-card .element_detail_text {
		padding-top: 6px !important;
		padding-bottom: 6px !important;
	}

	/* ---------- удобство по всему сайту ---------- */
	/* поля ввода 16px: иначе iPhone увеличивает страницу при нажатии в поле */
	body.m-ui input[type="text"],
	body.m-ui input[type="email"],
	body.m-ui input[type="tel"],
	body.m-ui input[type="search"],
	body.m-ui input[type="password"],
	body.m-ui input[type="number"],
	body.m-ui input:not([type]),
	body.m-ui textarea,
	body.m-ui select {
		font-size: 16px !important;
	}
	/* надписи на кнопках не мельче 13px */
	body.m-ui a.button,
	body.m-ui button.button,
	body.m-ui .button > span,
	body.m-ui .big_btn,
	body.m-ui .vbig_btn,
	body.m-ui .vbig_btn > span,
	body.m-ui button.small,
	body.m-ui button.small > span,
	body.m-ui .to-cart,
	body.m-ui .to-cart > span {
		font-size: 13px !important;
	}
	body.m-ui label.license,
	body.m-ui label.license a {
		font-size: 12px !important;
	}
	/* «Да / Нет» в строке города — удобная высота для пальца */
	.c-regions-select .regions-select-question-button {
		min-height: 32px !important;
		padding: 5px 14px !important;
	}
	.c-regions-select.m-city-asking {
		padding-top: 2px !important;
		padding-bottom: 2px !important;
	}
	/* телефоны и почта в подвале — больше область нажатия */
	body.m-ui footer a[href^="tel:"],
	body.m-ui footer a[href^="mailto:"],
	body.m-ui .footer a[href^="tel:"],
	body.m-ui .footer a[href^="mailto:"] {
		display: inline-block;
		padding: 8px 0;
	}
	/* хлебные крошки — больше область нажатия */
	body.m-ui .breadcrumbs a {
		display: inline-block;
		padding: 6px 0;
	}
	/* вид «таблица» на телефоне нечитаем — переключатель не показываем */
	body.m-ui .sort_header .sort_btn.table {
		display: none !important;
	}

	/* метки разделов («В спальню», «В гостиную») — в одну строку */
	body.m-ui .tags a.button {
		width: auto !important;
		max-width: none !important;
		flex: 0 0 auto !important;
		white-space: nowrap;
		font-size: 12px !important;
		padding: 8px 12px !important;
		height: auto !important;
		min-height: 0 !important;
		line-height: 1.2 !important;
	}
	/* ряды, которые листаются пальцем (крошки, метки разделов), — без видимой полосы прокрутки */
	body.m-ui .breadcrumbs,
	body.m-ui .tags {
		scrollbar-width: none;
		-ms-overflow-style: none;
	}
	body.m-ui .breadcrumbs::-webkit-scrollbar,
	body.m-ui .tags::-webkit-scrollbar {
		display: none;
		height: 0;
	}
	/* ярлыки в списках товаров — маленькими плашками в строку, не закрывают фото */
	body.m-ui .ajax_load .new-stickers {
		flex-direction: row !important;
		flex-wrap: wrap;
		gap: 4px;
		max-width: calc(100% - 50px);
	}
	body.m-ui .ajax_load .new-stickers .sticker {
		width: auto !important;
		margin: 0 !important;
		padding: 2px 8px !important;
		font-size: 11px !important;
		line-height: 16px !important;
	}

	/* согласие под подпиской в подвале — в потоке, а не поверх меню подвала */
	.subscribe-form_footer .subscribe-form-top form .subscribe-licence {
		position: static !important;
		height: auto !important;
	}
	.subscribe-form_footer .subscribe-form-top form .subscribe-licence label {
		height: auto !important;
	}
	.subscribe-form_footer .subscribe-form-top,
	.subscribe-form_footer .subscribe-form-top form {
		height: auto !important;
	}
	.subscribe-form_footer {
		padding-bottom: 0 !important;
	}
	.subscribe-form_footer .subscribe-form-top {
		margin-bottom: 0 !important;
	}
}
