/* =====================================================
   Mobile menu (offcanvas) — modern redesign
   Используется только на мобильных/планшетных разрешениях
   (десктопное меню — header-nav в header.php).
   ===================================================== */

.mobile-menu.offcanvas {
	/* Перекрываем общее правило `.offcanvas.show { position: absolute }`
	   из style.css: на абсолюте оффканвас тянулся под высоту контента
	   (с раскрытым каталогом), и внутренний скролл тела не работал.
	   Фиксируем меню к вьюпорту и поднимаем над сторонними виджетами. */
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	height: 100vh !important;
	height: 100dvh !important;
	max-height: 100vh !important;
	max-height: 100dvh !important;
	z-index: 2147483647 !important; /* max int32 — выше любого виджета */
	width: min(92vw, 420px);
	background: #ffffff;
	color: #1f2933;
	border: none;
	box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
	display: flex !important;
	flex-direction: column !important;
	overflow: hidden !important;
}

.mobile-menu.offcanvas.show {
	overflow: hidden !important; /* скролл уходит в .mobile-menu__body */
}

/* Подложка тоже должна перекрывать виджеты, но быть под самим меню */
.offcanvas-backdrop.show {
	z-index: 2147483646 !important;
}

/* Жёсткий lock прокрутки сайта, пока меню открыто.
   Дублирует стандартный bootstrap-lock body на случай, если кастомные
   CSS-правила его перекрывают (например, .offcanvas.show{position:absolute}). */
html.mobile-menu-open,
body.mobile-menu-open {
	overflow: hidden !important;
	overscroll-behavior: contain;
	touch-action: none;
}

body.mobile-menu-open {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
}

/* ---------- Header ---------- */

.mobile-menu__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	border-bottom: 1px solid #eef0f3;
	background: #ffffff;
	flex: 0 0 auto;
}

.mobile-menu__logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.mobile-menu__logo img {
	display: block;
	height: 36px;
	width: auto;
}

.mobile-menu__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	background: #ffffff;
	color: #4b5563;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mobile-menu__close:hover,
.mobile-menu__close:focus {
	background: #006400;
	color: #ffffff;
	border-color: #006400;
}

.mobile-menu__close:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.18);
}

/* ---------- Body (scroll area) ---------- */

.mobile-menu__body {
	flex: 1 1 0 !important; /* basis 0, иначе содержимое каталога раздувает блок */
	min-height: 0;
	height: 100%;
	overflow-y: auto !important;
	overflow-x: hidden;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 14px 14px 24px;
	background: #f7f8fa;
	transform: translateZ(0); /* iOS: форсим аппаратный слой для скролла */
}

.mobile-menu__section {
	background: #ffffff;
	border-radius: 14px;
	padding: 6px;
	margin-bottom: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ---------- Login / личный кабинет блок ---------- */

.mobile-menu__login {
	margin-bottom: 12px;
	background: #ffffff;
	border-radius: 14px;
	padding: 4px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Враппер компонента sale.basket.basket.line[login] */
.mobile-menu__login > div.b-main-menu__user,
.mobile-menu__login > div {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 10px;
	height: auto;
	position: relative;
	transition: background-color 0.2s ease;
}

.mobile-menu__login > div:hover {
	background: #f3f4f6;
}

.mobile-menu__login .header-nav__login_icon {
	width: 22px;
	height: 22px;
	object-fit: contain;
	flex-shrink: 0;
}

.mobile-menu__login .header-nav__login_link {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	color: #1f2933;
	text-decoration: none;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.mobile-menu__login .header-nav__login_link:hover {
	color: #006400;
}

/* Внутри мобильного меню hover-меню кабинета не нужно */
.mobile-menu__login .user_top_menu_hover {
	display: none !important;
}

/* ---------- Каталог: активатор ---------- */

.mobile-menu .offcanvas-catalog-activator {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	height: auto;
	padding: 14px 16px;
	border-radius: 10px;
	background: linear-gradient(135deg, #006400 0%, #028b03 100%);
	color: #ffffff;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
	letter-spacing: 0.2px;
	text-decoration: none;
	transition: filter 0.2s ease, transform 0.2s ease;
}

.mobile-menu .offcanvas-catalog-activator:hover,
.mobile-menu .offcanvas-catalog-activator:focus,
.mobile-menu .offcanvas-catalog-activator:active {
	color: #ffffff;
	filter: brightness(1.05);
}

.mobile-menu .offcanvas-catalog-activator span {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.mobile-menu .offcanvas-catalog-activator span::before {
	content: "";
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='3' y1='6' x2='21' y2='6'/><line x1='3' y1='12' x2='21' y2='12'/><line x1='3' y1='18' x2='21' y2='18'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	flex-shrink: 0;
}

.mobile-menu .offcanvas-catalog-activator::after {
	content: "";
	width: 14px;
	height: 14px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	transform: rotate(-90deg);
	transition: transform 0.25s ease;
}

.mobile-menu .offcanvas-catalog-activator[aria-expanded="true"]::after {
	transform: rotate(0deg);
}

#collapseCatalog {
	background-color: transparent;
	margin-top: 6px;
}

/* ---------- Каталог: пункты ---------- */

.mobile-menu .offcanvas-item {
	border-bottom: 1px solid #eef0f3;
}

.mobile-menu .offcanvas-item:last-child {
	border-bottom: none;
}

.mobile-menu .offcanvas-link {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 12px 14px !important;
	margin: 0;
	color: #1f2933;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.3;
	border: none;
	border-left: none;
	border-radius: 8px;
	transition: background-color 0.2s ease, color 0.2s ease;
	text-decoration: none;
}

.mobile-menu .offcanvas-link:hover,
.mobile-menu .offcanvas-link:focus {
	background-color: #f3f4f6;
	color: #006400;
}

.mobile-menu .offcanvas-link__small {
	font-size: 14px;
	font-weight: 400;
	color: #4b5563;
	padding: 10px 14px !important;
}

/* кастомизируем стрелку у активатора подкатегории */
.mobile-menu .offcanvas-link__activator {
	font-weight: 500;
}

.mobile-menu .offcanvas-link__activator::after {
	content: "";
	width: 14px;
	height: 14px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006400' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	transform: rotate(0deg);
	transition: transform 0.25s ease;
	margin-left: auto;
}

.mobile-menu .offcanvas-link__activator[aria-expanded="true"] {
	background-color: #f1f6f1;
	color: #006400;
	border-left: none;
}

.mobile-menu .offcanvas-link__activator[aria-expanded="true"]::after {
	transform: rotate(90deg);
}

.mobile-menu .offcanvas-link-collapse {
	border-left: none;
	padding: 4px 8px 8px 18px;
	margin-top: 2px;
	background: #fafbfc;
	border-radius: 8px;
}

/* ---------- Дополнительные пункты меню ---------- */

.mobile-menu__section--nav {
	padding: 4px 6px;
}

.mobile-menu__nav-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 12px;
	border-radius: 10px;
	color: #1f2933;
	font-weight: 500;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu__nav-item + .mobile-menu__nav-item {
	margin-top: 2px;
}

.mobile-menu__nav-item:hover,
.mobile-menu__nav-item:focus {
	background-color: #f3f4f6;
	color: #006400;
}

.mobile-menu__nav-item:hover .mobile-menu__nav-icon,
.mobile-menu__nav-item:focus .mobile-menu__nav-icon {
	background: #006400;
	color: #ffffff;
	border-color: #006400;
}

.mobile-menu__nav-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 10px;
	background: #f1f6f1;
	color: #006400;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mobile-menu__nav-icon svg {
	display: block;
}

.mobile-menu__nav-label {
	flex: 1 1 auto;
	min-width: 0;
}

.mobile-menu__nav-arrow {
	color: #9ca3af;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-menu__nav-item:hover .mobile-menu__nav-arrow,
.mobile-menu__nav-item:focus .mobile-menu__nav-arrow {
	color: #006400;
	transform: translateX(2px);
}

/* ---------- Город (collapse-селектор) ---------- */

.mobile-menu__city {
	margin-top: 4px;
	background: #ffffff;
	border: 1px solid #eef0f3;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	overflow: hidden;
}

.mobile-menu__city-trigger {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	background: transparent;
	border: none;
	color: #1f2933;
	text-align: left;
	cursor: pointer;
	font: inherit;
	transition: background-color 0.2s ease;
}

.mobile-menu__city-trigger:hover,
.mobile-menu__city-trigger:focus-visible {
	background: #f8faf8;
	outline: none;
}

.mobile-menu__city-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 10px;
	background: #f1f6f1;
	color: #006400;
}

.mobile-menu__city-icon svg {
	display: block;
}

.mobile-menu__city-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.2;
}

.mobile-menu__city-hint {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #9ca3af;
}

.mobile-menu__city-value {
	margin-top: 2px;
	font-size: 15px;
	font-weight: 600;
	color: #1f2933;
}

.mobile-menu__city-chevron {
	color: #9ca3af;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	transition: transform 0.25s ease, color 0.2s ease;
}

.mobile-menu__city-trigger[aria-expanded="true"] .mobile-menu__city-chevron {
	color: #006400;
	transform: rotate(180deg);
}

.mobile-menu__city-collapse {
	border-top: 1px solid #eef0f3;
	background: #f7f8fa;
}

.mobile-menu__city-list-title {
	padding: 10px 14px 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #9ca3af;
}

.mobile-menu__city-list {
	list-style: none;
	margin: 0;
	padding: 0 6px 8px;
}

.mobile-menu__city-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 8px;
	color: #1f2933;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu__city-option:hover,
.mobile-menu__city-option:focus-visible {
	background: #ffffff;
	color: #006400;
	outline: none;
}

.mobile-menu__city-option.is-active {
	background: #eaf3ea;
	color: #006400;
}

.mobile-menu__city-option-name {
	flex: 1 1 auto;
	min-width: 0;
}

.mobile-menu__city-option-mark {
	color: #006400;
	display: inline-flex;
	align-items: center;
}

/* ---------- Footer (sticky) ---------- */

.mobile-menu__footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #ffffff;
	border-top: 1px solid #eef0f3;
	flex: 0 0 auto;
}

.mobile-menu__phone {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	background: #f1f6f1;
	color: #006400;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu__phone:hover,
.mobile-menu__phone:focus {
	background: #006400;
	color: #ffffff;
}

.mobile-menu__phone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: #ffffff;
	color: #006400;
	flex-shrink: 0;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu__phone:hover .mobile-menu__phone-icon,
.mobile-menu__phone:focus .mobile-menu__phone-icon {
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
}

.mobile-menu__phone-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	min-width: 0;
}

.mobile-menu__phone-number {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.2px;
}

.mobile-menu__phone-hint {
	font-size: 11px;
	color: inherit;
	opacity: 0.75;
	margin-top: 2px;
}

.mobile-menu__telegram {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 12px;
	background: #f1f6f1;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.mobile-menu__telegram:hover,
.mobile-menu__telegram:focus {
	background: #e6f1e6;
	transform: translateY(-1px);
}

.mobile-menu__telegram img {
	width: 22px;
	height: 22px;
}

/* ---------- Адаптация под совсем маленькие экраны ---------- */

@media (max-width: 360px) {
	.mobile-menu.offcanvas {
		width: 100vw;
	}

	.mobile-menu__body {
		padding: 12px 10px 20px;
	}

	.mobile-menu__phone-hint {
		display: none;
	}
}

/* =====================================================
   Селектор города на десктопе (.header-nav__info)
   ===================================================== */

.city-picker {
	position: relative;
}

.city-picker__btn {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 6px 12px;
	margin: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	color: #1f2933;
	font-weight: 500;
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	/* Явно перечисляем свойства, иначе глобальное `button { transition: all }`
	   анимирует все подряд (включая transform у потомков) и контент
	   «плывёт» при открытии дропдауна. */
	transition-property: background-color, border-color, color;
	transition-duration: 0.18s;
	transition-timing-function: ease;
}

.city-picker__btn:hover,
.city-picker__btn:focus-visible,
.city-picker__btn[aria-expanded="true"] {
	background: #f3f4f6;
	color: #006400;
	outline: none;
}

.city-picker__pin {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: #006400;
	flex-shrink: 0;
}

.city-picker__pin svg {
	display: block;
}

.city-picker__name {
	white-space: nowrap;
	transition: none; /* отключаем глобальный transition: all у наследников */
}

.city-picker__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	color: #9ca3af;
	transform-origin: 50% 50%;
	transition: transform 0.18s ease, color 0.18s ease;
	will-change: transform;
}

.city-picker__chevron svg {
	display: block;
}

.city-picker__btn[aria-expanded="true"] .city-picker__chevron {
	color: #006400;
	transform: rotate(-180deg);
}

.city-picker__menu {
	min-width: 240px;
	margin-top: 8px;
	padding: 8px;
	border-radius: 12px;
	border: 1px solid #eef0f3;
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
	background: #ffffff;
}

.city-picker__menu-title {
	padding: 6px 10px 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #9ca3af;
}

.city-picker__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.city-picker__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 8px;
	color: #1f2933;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.city-picker__option:hover,
.city-picker__option:focus-visible {
	background: #f3f4f6;
	color: #006400;
	outline: none;
}

.city-picker__option.is-active {
	background: #eaf3ea;
	color: #006400;
}

.city-picker__option-mark {
	color: #006400;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}
