/* Rectangle 22 — серая pill на hover/active, ширина по тексту */

.menu--home .main-menu > li > a,
.menu--inner .main-menu > li > a,
.menu .main-menu > li > a {
	position: relative;
	z-index: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 0 18px;
	white-space: nowrap;
	box-sizing: border-box;
	color: #000000 !important;
}

/* Белый текст меню в шапке — главная (hero) и внутренние страницы */
:is(body.home-page, body.inner-page, body.inner-car-page, body.page-contacts) .wrap > header .menu--home .main-menu > li > a {
	color: #ffffff !important;
}

.menu--home .main-menu > li.is-active > a,
.menu--home .main-menu > li > a:hover,
.menu--inner .main-menu > li.is-active > a,
.menu--inner .main-menu > li > a:hover,
.menu .main-menu > li.is-active > a,
.menu .main-menu > li > a:hover {
	color: #000000 !important;
	background: none !important;
	border-color: transparent !important;
}

.menu--home .main-menu > li.is-active > a::before,
.menu--home .main-menu > li > a:hover::before,
.menu--inner .main-menu > li.is-active > a::before,
.menu--inner .main-menu > li > a:hover::before,
.menu .main-menu > li.is-active > a::before,
.menu .main-menu > li > a:hover::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 2px;
	background-color: rgba(217, 217, 217, 0.74);
	z-index: -1;
	box-sizing: border-box;
}

/* Фильтры каталога — Rectangle 22 на hover и active */
body.home-page .ap-catalog__filter:hover,
body.home-page .ap-catalog__filter.is-active,
body.inner-page.page-catalog .ap-catalog__filter:hover,
body.inner-page.page-catalog .ap-catalog__filter.is-active {
	color: #000000;
	background: none !important;
}

body.home-page .ap-catalog__filter:hover::before,
body.home-page .ap-catalog__filter.is-active::before,
body.inner-page.page-catalog .ap-catalog__filter:hover::before,
body.inner-page.page-catalog .ap-catalog__filter.is-active::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 2px;
	box-sizing: border-box;
	border: 1px solid rgba(0, 0, 0, 0.22);
	background-color: rgba(217, 217, 217, 0.74);
	z-index: -1;
}

/* Каталог — выпадающие плашки «Автомобили» / «Мотоциклы» */
:is(body.home-page, body.inner-page, body.inner-car-page, body.page-contacts) .menu--home,
:is(body.home-page, body.inner-page, body.inner-car-page, body.page-contacts) header {
	overflow: visible;
}

.menu .main-menu > li.has-submenu {
	position: relative;
	align-items: flex-start;
}

.menu .main-menu__submenu {
	position: absolute;
	top: 100%;
	left: 14px;
	margin: 0;
	padding: 4px 0 0;
	list-style: none;
	display: none;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	z-index: 500;
}

.menu .main-menu > li.has-submenu:hover .main-menu__submenu,
.menu .main-menu > li.has-submenu:focus-within .main-menu__submenu {
	display: flex;
}

.menu .main-menu__submenu > li {
	display: block;
	height: auto;
}

.menu .main-menu__submenu a {
	position: relative;
	z-index: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 135px;
	height: 30px;
	min-height: 30px;
	padding: 0;
	font-family: 'Manrope', 'Noto Sans Display', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 16px;
	color: #000000 !important;
	text-decoration: none;
	white-space: nowrap;
	background: none !important;
	border-color: transparent !important;
}

.menu .main-menu__submenu a::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 2px;
	box-sizing: border-box;
	border: 1px solid rgba(0, 0, 0, 0.22);
	background-color: rgba(217, 217, 217, 0.74);
	z-index: -1;
}

.menu .main-menu__submenu a:hover {
	text-decoration: underline;
}
