/* =========================================================================
   Мобильное меню — современное оформление.
   Подключается последним. Управление (открытие/закрытие, аккордеон
   подменю, табы) остаётся прежним — меняется только внешний вид.

   Работает только на мобильных (<= 991px), десктоп не затрагивается.
   ========================================================================= */

@media screen and (max-width: 991px) {

	/* ---------- Панель меню ---------- */
	.mobile-header {
		background: #fff !important;
		box-shadow: 0 20px 40px -18px rgba(28, 27, 26, .35);
		padding-bottom: 20px !important;
		top: 48px !important;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Табы (КЕРАМИКА / ИНФОРМАЦИЯ / САНТЕХНИКА) — как сегментированный контрол */
	.mobile-header .tabs__caption {
		display: flex !important;
		gap: 6px;
		margin: 0 0 14px;
		padding: 6px !important;
		list-style: none;
		background: var(--kc-bg-soft);
		border-radius: 12px;
	}

	.mobile-header .tabs__caption li {
		flex: 1 1 0;
		margin: 0 !important;
		padding: 9px 6px !important;
		border: 0 !important;
		border-radius: 8px;
		text-align: center;
		font-size: 11px !important;
		font-weight: 600;
		letter-spacing: .03em;
		line-height: 1.2 !important;
		color: var(--kc-ink-mute) !important;
		background: transparent !important;
		cursor: pointer;
		transition: background .2s var(--kc-ease), color .2s var(--kc-ease);
	}

	.mobile-header .tabs__caption li.active {
		background: #fff !important;
		color: var(--kc-ink) !important;
		box-shadow: 0 1px 3px rgba(28, 27, 26, .12);
	}

	.mobile-header .tabs__content {
		padding: 0 14px !important;
	}

	/* ---------- Пункты первого уровня ---------- */
	.mobile-header .submenu {
		margin: 0 !important;
		padding: 0 !important;
		list-style: none;
	}

	.mobile-header .submenu > li {
		position: relative;
		margin: 0 !important;
		padding: 0 !important;
		border-bottom: 1px solid var(--kc-line);
		font-size: 14px !important;
		line-height: 1.35 !important;
		font-family: inherit !important;
	}

	.mobile-header .submenu > li > a {
		display: block !important;
		width: 100%;
		padding: 14px 34px 14px 2px !important;
		box-sizing: border-box;
		color: var(--kc-ink) !important;
		font-size: 14px !important;
		font-weight: 500;
		text-decoration: none;
		transition: color .18s var(--kc-ease);
	}

	.mobile-header .submenu > li > a:hover {
		color: var(--kc-accent) !important;
	}

	/* Стрелка-шеврон вместо картинки, справа */
	.mobile-header .submenu > li.menu-item-has-children > a::after {
		content: "" !important;
		position: absolute;
		right: 6px;
		top: 50%;
		width: 8px !important;
		height: 8px !important;
		margin: -6px 0 0 !important;
		background: transparent !important;
		border-right: 1.5px solid var(--kc-ink-mute);
		border-bottom: 1.5px solid var(--kc-ink-mute);
		transform: rotate(45deg);
		transition: transform .22s var(--kc-ease), border-color .18s var(--kc-ease);
	}

	.mobile-header .submenu > li.menu-item-has-children > a.current-a::after {
		transform: rotate(-135deg);
		margin-top: -2px !important;
		border-color: var(--kc-accent);
	}

	/* ---------- Подменю ---------- */
	.mobile-header .submenu .submenu {
		margin: 0 !important;
		padding: 0 0 10px 12px !important;
		border-left: 2px solid var(--kc-accent-soft);
	}

	.mobile-header .submenu .submenu li {
		border-bottom: 0 !important;
		padding: 0 !important;
		font-size: 13px !important;
		line-height: 1.35 !important;
	}

	.mobile-header .submenu .submenu li a {
		display: block;
		padding: 8px 2px !important;
		color: var(--kc-ink-soft) !important;
		font-size: 13px !important;
		text-decoration: none;
		transition: color .18s var(--kc-ease);
	}

	.mobile-header .submenu .submenu li a:hover {
		color: var(--kc-accent) !important;
		text-decoration: none !important;
	}

	/* ---------- «АКЦИИ» ---------- */
	.mobile-header-link {
		margin-top: 6px !important;
		border-bottom: 1px solid var(--kc-line);
	}

	.mobile-header-link a {
		display: block;
		padding: 14px 2px !important;
		font-size: 14px !important;
		font-weight: 600;
		letter-spacing: .03em;
		color: var(--kc-accent) !important;
		text-decoration: none;
	}

	/* ---------- Контакты в меню ---------- */
	.mobile-header-contacts {
		padding: 14px 2px 0 !important;
	}

	.mobile-header-contacts a {
		color: var(--kc-ink) !important;
		font-size: 14px;
		text-decoration: none;
	}

	/* ---------- Верхняя панель мобильной шапки ---------- */
	.mobile-version {
		padding: 0 12px;
		background: #fff;
		box-shadow: 0 1px 0 var(--kc-line);
	}

	.mobile-logo img {
		max-height: 30px;
		width: auto;
	}

	.mobile-nav-button,
	.mobile-phone,
	.search-button {
		position: relative;
	}

	/* Кнопка «меню» — понятная иконка-«бургер» */
	.mobile-nav-button {
		width: 40px;
		height: 40px;
		cursor: pointer;
	}

	.mobile-nav-button::before,
	.mobile-nav-button::after {
		content: "";
		position: absolute;
		left: 10px;
		width: 20px;
		height: 2px;
		border-radius: 2px;
		background: var(--kc-ink);
		box-shadow: 0 0 0 0 transparent;
		transition: transform .22s var(--kc-ease), opacity .18s var(--kc-ease);
	}

	/* Три полосы: верх и низ рисуем псевдоэлементами, середину — box-shadow */
	.mobile-nav-button::before {
		top: 15px;
		box-shadow: 0 5px 0 var(--kc-ink);
	}

	.mobile-nav-button::after {
		top: 25px;
	}

	/* При открытом меню — «крестик» */
	.mobile-nav-button.active::before,
	.mobile-nav-button.back::before {
		top: 20px;
		box-shadow: none;
		transform: rotate(45deg);
	}

	.mobile-nav-button.active::after,
	.mobile-nav-button.back::after {
		top: 20px;
		transform: rotate(-45deg);
	}
}
