/**
 * Стили листинга каталога (/products/).
 * Чистый слой — без легаси из stylesheet.css / custom.css.
 */

.page-catalog,
.page-catalog .main-content {
	background-color: #f7f8fa;
}

.page-home,
.page-home .main-content {
	background-color: #fff;
}

.page-home #rev_slider_1_1_wrapper {
	background-color: #fff !important;
}

.page-home .popular-products,
.page-home .product-faq.product-about {
	padding: 0;
}

.page-home .product-faq {
	margin-top: 24px;
	margin-bottom: 24px;
	max-width: none;
}

/* Статичное меню категорий на корне /products/ */
.catalog-static-menu {
	box-sizing: border-box;
	margin-top: 24px;
	border-radius: 20px;
	background-color: #fff;
	overflow: visible;
	min-height: 688px;
}

.catalog-static-menu__nav {
	--header-catalog-col-width: min(344px, calc((100vw - 48px) / 4));
	position: relative;
	width: var(--header-catalog-col-width);
	min-height: 688px;
	overflow: visible;
}

@media only screen and (max-width: 992px) {
	.catalog-static-menu {
		overflow: hidden;
		min-height: 688px;
	}

	.catalog-static-menu__nav {
		width: 100%;
		--header-catalog-col-width: 100%;
		min-height: 688px;
		overflow: hidden;
	}

	.catalog-static-menu .header-catalog-menu {
		width: 100%;
	}

	.catalog-static-menu .header-catalog-menu__item--back {
		display: list-item;
	}

	/* На узких экранах только .is-open, без hover/focus-within */
	.catalog-static-menu .header-catalog-menu__item:hover > .header-catalog-menu__list,
	.catalog-static-menu .header-catalog-menu__item:focus-within > .header-catalog-menu__list {
		display: block;
		transform: translateX(100%);
		visibility: hidden;
		pointer-events: none;
	}

	.catalog-static-menu .header-catalog-menu__list {
		display: block;
		left: 0;
		width: 100%;
		transform: translateX(100%);
		transition: transform 0.28s ease, visibility 0.28s ease;
		visibility: hidden;
		pointer-events: none;
		z-index: 2;
		background-color: #fff;
	}

	.catalog-static-menu .header-catalog-menu__item.is-open > .header-catalog-menu__list {
		transform: translateX(0);
		visibility: visible;
		pointer-events: auto;
	}

	.catalog-static-menu .header-catalog-menu__list .header-catalog-menu__list {
		left: 0;
		z-index: 3;
	}
}

@media only screen and (max-width: 768px) {
	.products-cart__image {
		padding: 2px;
		border-radius: 19px;
	}

	/* Как на карточке товара: только «назад» к родителю */
	.breadcrumb--catalog > li {
		display: none;
	}

	.breadcrumb--catalog > li.breadcrumb__item--parent {
		display: inline-block;
	}

	.breadcrumb--catalog > li.breadcrumb__item--parent::before {
		transform: rotate(-135deg);
	}
}

/* ——— Заголовок + табы категорий ——— */

.catalog-heading {
	box-sizing: border-box;
	width: 100%;
	padding: 16px;
	border-radius: 20px;
	background-color: #fff;
}

.catalog-heading__title {
	margin: 0;
	font-family: Gilroy, sans-serif;
	font-weight: 700;
	font-size: 28px;
	line-height: 32px;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.catalog-heading__toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 12px;
	min-width: 0;
}

.catalog-heading__sort {
	flex: 0 0 auto;
}

.catalog-heading__tabs {
	flex: 1 1 auto;
	min-width: 0;
	margin-top: 0;
	overflow: hidden;
}

.catalog-heading__tabs .swiper-slide {
	width: auto;
	height: auto;
}

.catalog-heading__tab {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	padding: 0 16px;
	border-radius: 16px;
	background-color: #f7f8fa;
	font-family: Gilroy, sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	color: #626c77;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.catalog-heading__tab:hover,
.catalog-heading__tab:focus {
	background-color: #e8eaed;
	color: #626c77;
	text-decoration: none;
	outline: none;
}

/* Порядок блоков в колонке контента: товары → описание раздела */
.page-catalog .catalog-content {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	overflow-x: hidden;
}

.page-catalog .catalog-content > * {
	min-width: 0;
	max-width: 100%;
}

.page-catalog .catalog-categories,
.page-home .catalog-categories {
	order: 1;
	box-sizing: border-box;
	margin-top: 24px;
	padding: 16px;
	border-radius: 20px;
	background-color: #fff;
}

.container > .catalog-categories:first-child {
	margin-top: 0;
}

.catalog-categories__title {
	margin: 0;
	font-family: Gilroy, sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 24px;
	text-transform: none;
	letter-spacing: normal;
}

.catalog-categories__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	row-gap: 24px;
	column-gap: 16px;
	margin-top: 12px;
}

.catalog-categories__card {
	text-decoration: none;
	color: inherit;
	height: auto;
}

.catalog-categories__card:hover,
.catalog-categories__card:focus {
	text-decoration: none;
	color: inherit;
	outline: none;
}

.catalog-categories__card .products-cart__image {
	pointer-events: none;
}

.catalog-categories__card .products-cart__title {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 14px 12px;
	border: 0;
	border-radius: 12px;
	font-family: Gilroy, sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 20px;
	text-align: center;
	overflow: visible;
	-webkit-line-clamp: unset;
	-webkit-box-orient: unset;
}

.page-catalog .popular-products {
	order: 2;
}

/* Пока JS не перенёс сортировку в heading — скрываем дубль в контенте */
.page-catalog:has([data-catalog-sort-slot]) .catalog-sort {
	display: none;
}

.page-catalog .catalog-heading__sort .catalog-sort {
	display: flex;
}

.page-catalog .catalog-content .popular-products {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	box-sizing: border-box;
}

.page-catalog .catalog-content .popular-products__body,
.page-catalog .catalog-content .popular-products__slider-wrap {
	overflow: hidden;
}

.page-catalog .catalog-content .popular-products__nav--prev {
	left: 0;
}

.page-catalog .catalog-content .popular-products__nav--next {
	right: 0;
}

.page-catalog .catalog-products {
	order: 3;
}

.page-catalog .product-faq {
	order: 4;
	margin-top: 24px;
	max-width: none;
}

.catalog-seo {
	order: 5;
	box-sizing: border-box;
	margin-top: 24px;
	padding: 16px;
	border-radius: 20px;
	background-color: #fff;
}

.catalog-seo__title {
	margin: 0 0 12px;
	font-family: Gilroy, sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 24px;
}

.catalog-seo__text {
	font-family: Gilroy, sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	color: inherit;
}

.catalog-seo__text h2 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
	font-family: Gilroy, sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 24px;
	text-transform: none;
	letter-spacing: normal;
}

.catalog-seo__text span {
	font-size: 14px !important;
}

.catalog-seo__text p:first-child {
	margin-top: 0;
}

.catalog-seo__text p:last-child {
	margin-bottom: 0;
}

/* ——— Сортировка ——— */

.catalog-sort {
	position: relative;
	display: flex;
	justify-content: flex-end;
	margin-bottom: 16px;
}

.catalog-heading__sort .catalog-sort {
	justify-content: flex-start;
	margin-bottom: 0;
}

.catalog-sort__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	box-sizing: border-box;
	min-width: 150px;
	height: 40px;
	padding: 0 16px;
	margin: 0;
	border: none;
	border-radius: 16px;
	background-color: #f7f8fa;
	cursor: pointer;
	font-family: Gilroy, 'Gilroy-Medium', Arial, sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	color: #626c77;
	text-align: left;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.catalog-sort__toggle:hover,
.catalog-sort__toggle:focus {
	background-color: #e8eaed;
	color: #626c77;
	outline: none;
}

.catalog-sort__label {
	white-space: nowrap;
}

.catalog-sort__chevron {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-left: 4px;
	border-right: 1px solid #a1a7ad;
	border-bottom: 1px solid #a1a7ad;
	border-radius: 1px;
	transform: rotate(45deg) translateY(-1px);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.catalog-sort.is-open .catalog-sort__chevron {
	transform: rotate(-135deg) translate(-2px, -2px);
}

.catalog-sort__dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 20;
	box-sizing: border-box;
	min-width: 360px;
	margin: 0;
	padding: 8px 16px;
	list-style: none;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 8px 24px rgba(14, 8, 15, 0.1);
}

.catalog-heading__sort .catalog-sort__dropdown {
	right: auto;
	left: 0;
}

.catalog-sort.is-open .catalog-sort__dropdown {
	display: block;
}

.catalog-sort__option {
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	height: 44px;
	margin: 0 -8px;
	padding: 0 8px;
	border-radius: 12px;
	font-family: Gilroy, 'Gilroy-Medium', Arial, sans-serif;
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	color: #000;
	text-decoration: none;
	cursor: pointer;
}

.catalog-sort__option:hover,
.catalog-sort__option:focus {
	color: #000;
	text-decoration: none;
	outline: none;
	background: #f7f8fa;
}

.catalog-sort__radio {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	border: 2px solid #000;
	border-radius: 16px;
}

.catalog-sort__option.is-selected .catalog-sort__radio::after {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #000;
}

/* ——— Сетка товаров ——— */

.catalog-products {
	box-sizing: border-box;
	margin-top: 24px;
	padding: 16px;
	border-radius: 20px;
	background-color: #fff;
}

.catalog-products__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	row-gap: 24px;
	column-gap: 16px;
}

/* ——— Пагинация ——— */

.catalog-pagination {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.catalog-pagination__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.catalog-pagination__btn {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 40px;
	border-radius: 16px;
	background-color: #f7f8fa;
	font-family: Gilroy, sans-serif;
	font-weight: 600;
	font-size: 18px;
	line-height: 20px;
	color: #626c77;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.catalog-pagination__btn:hover,
.catalog-pagination__btn:focus {
	background-color: #e8eaed;
	color: #626c77;
	text-decoration: none;
	outline: none;
	transform: translateY(-1px);
}

.catalog-pagination__item.is-active .catalog-pagination__btn {
	background-color: #ff0032;
	color: #fff;
}

.catalog-pagination__item.is-active .catalog-pagination__btn:hover,
.catalog-pagination__item.is-active .catalog-pagination__btn:focus {
	background-color: #e6002d;
	color: #fff;
}

/* ——— Карточка товара (отдельно от popular-products) ——— */

.products-cart {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	height: 100%;
	border: 1px solid #EDEEF2;
	border-radius: 16px;
	background-color: #fff;
}

.products-cart__image {
	box-sizing: border-box;
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	padding: 4px;
	border-radius: 15px;
	background-color: #fff;
	overflow: hidden;
	text-decoration: none;
}

.products-cart__labels {
	position: absolute;
	left: 4px;
	bottom: 4px;
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
}

.products-cart__label {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 20px;
	padding: 0 6px;
	border-radius: 8px;
	background-color: #f7f8fa;
	white-space: nowrap;
	font-family: Gilroy, sans-serif;
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
}

.products-cart__label--hit {
	color: #067276;
}

.products-cart__label--new {
	color: #0070cc;
}

.products-cart__label--sale {
	color: #8921e3;
}

.products-cart__image img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 10px;
}

.products-cart__prices {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	margin: 16px 16px 0;
	box-sizing: border-box;
}

.products-cart__price {
	font-family: Gilroy, sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 24px;
	color: inherit;
}

.products-cart__prices-row {
	display: inline-flex;
	align-items: baseline;
	column-gap: 6px;
}

.products-cart__price-old {
	margin-left: 8px;
	font-family: Gilroy, sans-serif;
	font-weight: 500;
	font-size: 14px;
	line-height: 20px;
	color: #a1a7ad;
	text-decoration: line-through;
}

.products-cart__discount {
	margin-left: 6px;
	font-family: Gilroy, sans-serif;
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	color: #00a8ae;
}

.products-cart__title {
	margin: 4px 16px 0;
	min-height: 30px;
	box-sizing: border-box;
	font-family: Gilroy, sans-serif;
	font-weight: 500;
	font-size: 14px;
	line-height: 16px;
	color: inherit;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.products-cart__cart {
	margin: auto 8px 8px;
	padding-top: 16px;
}

.products-cart__btn {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0;
	padding: 14px 12px;
	border: 0;
	border-radius: 12px;
	background-color: #F7F8FA;
	font-family: Gilroy, sans-serif;
	font-weight: 600;
	font-size: 16px;
	line-height: 20px;
	color: #626c77;
	cursor: pointer;
}

.products-cart__btn:hover,
.products-cart__btn:focus {
	color: #626c77;
}

@media only screen and (max-width: 768px) {
	.catalog-products__grid,
	.catalog-categories__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.catalog-pagination__btn {
		width: 60px;
	}

	.products-cart__labels {
		right: 4px;
		flex-wrap: wrap;
		gap: 2px;
	}

	.products-cart__prices {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: flex-start;
		margin: 12px 14px 0;
		row-gap: 4px;
	}

	.products-cart__price {
		width: 100%;
	}

	.products-cart__prices-row {
		display: flex;
		align-items: center;
		width: 100%;
		min-height: 20px;
	}

	.products-cart__price-old,
	.products-cart__discount {
		margin-left: 0;
	}

	.products-cart__title {
		margin-right: 14px;
		margin-left: 14px;
		min-height: 0;
	}

	.products-cart__cart {
		margin-right: 6px;
		margin-bottom: 6px;
		margin-left: 6px;
		padding-top: 12px;
	}

	.products-cart__btn {
		padding: 12px;
		font-size: 14px;
		line-height: 16px;
	}
}
