/* Дополнения к style.css для страниц каталога (классы, которых нет на старом сайте) */

/* Кнопка «Купить» стилизуется родным .popular-card_list-basket_btn (оранжевый) из style.css */

.product-page .top_block-price h2 {
	margin: 0;
	font-size: 1.5rem;
	white-space: nowrap;
}

.card-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.passport-link {
	position: relative;
	z-index: 2;
	pointer-events: auto;
}

input[type="number"].cs_amount::-webkit-outer-spin-button,
input[type="number"].cs_amount::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

input[type="number"].cs_amount {
	-moz-appearance: textfield;
	appearance: textfield;
}

.pagination {
	display: flex;
	gap: 0.5rem;
	justify-content: center;
	padding: 1rem 0;
	flex-wrap: wrap;
}

.pagination .page-item {
	list-style: none;
}

.pagination .page-item a {
	padding: 0.4rem 0.9rem;
	border-radius: 50px;
	display: inline-block;
}

@media (min-width: 1281px) {
	.product-page .item-info {
		min-height: 365px;
	}
}

@media (min-width: 1281px) and (max-width: 1400px) {
	.product-page-chrome > section:first-child .info-links_group {
		flex-direction: column;
	}

	.product-page-chrome > section:first-child .info-links_column,
	.product-page-chrome > section:first-child .info-links_color {
		width: 100%;
	}
}

@media (min-width: 791px) and (max-width: 1280px) {
	.product-page .item-info {
		min-height: 322px;
	}

	.product-page .item-top > .item-img {
		flex: 0 0 203px;
		width: 203px;
	}

	.product-page .item-top > .item-img .popular-card__image-wrapper {
		justify-content: center;
	}

	.product-page .item-top > .item-img .product-main-image {
		width: 200px;
		height: 200px;
	}
}

@media (min-width: 791px) and (max-width: 1248px) {
	.product-page .item-top {
		flex-direction: column-reverse;
	}

	.product-page .item-top > .item-img {
		flex: 0 1 auto;
		width: 100px;
	}

	.product-page .item-options {
		flex-wrap: wrap;
		gap: 1.5rem;
		padding-top: 1rem;
	}

	.product-page-chrome .partners-links_group {
		flex-direction: column;
	}

	.product-page-chrome .partners-links,
	.product-page-chrome .partners-links_color {
		width: 100%;
	}
}

.product-page table td {
	line-height: 18px;
}

.product-related {
	padding-bottom: 2rem;
}

.product-related__mobile .popular-card_list-basket_btn {
	width: 150px;
}

@media (max-width: 790px) {
	.product-related__mobile .popular-card__item {
		width: 100%;
	}
}

.catalog-page {
	width: 100%;
	min-width: 0;
	padding-bottom: 1rem;
}

.catalog-layout {
	display: grid;
	grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
	align-items: start;
	gap: 1rem;
	width: 100%;
}

.catalog-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	width: 100%;
	min-width: 0;
	padding: 0;
	border-radius: 0;
	background-color: transparent;
	position: static;
	top: auto;
	max-height: none;
}

.catalog-content,
.catalog-products {
	width: 100%;
	min-width: 0;
}

/* Блок разделов каталога (зелёный, как на старом сайте): заголовок = текущая
   страница, список = прямые дочерние разделы, клик по заголовку сворачивает. */
.catalog-sidebar-block {
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	padding: 2rem;
}

.catalog-sidebar-block--nav {
	background-color: #69a74f;
}

.catalog-sidebar-block__toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.catalog-sidebar-block__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	color: #ffffff;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.438rem;
	cursor: pointer;
	user-select: none;
}

.catalog-sidebar-block__header::after {
	content: "";
	width: 0.65rem;
	height: 0.65rem;
	border-right: 2px solid #ffffff;
	border-bottom: 2px solid #ffffff;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.catalog-sidebar-block__toggle:checked ~ .catalog-sidebar-block__header::after {
	transform: rotate(-135deg);
}

.catalog-sidebar-block__toggle:not(:checked) ~ .catalog-sidebar-list {
	display: none;
}

.catalog-sidebar-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.catalog-sidebar-list__link {
	display: block;
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.438rem;
}

.catalog-sidebar-list__link:hover {
	text-decoration: underline;
}

/* Фильтры: тёмный блок сразу под разделами, как на старом сайте. */
.catalog-filters {
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
	margin-top: 0;
	background-color: #595959;
	border-radius: 20px;
	padding: 2rem;
}

.catalog-filter-group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.catalog-filter-group legend {
	margin-bottom: 0.75rem;
	padding: 0;
	color: #ffffff;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.438rem;
}

.catalog-filter-option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.15rem 0;
	color: #ffffff;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.438rem;
	cursor: pointer;
}

.catalog-filter-option input {
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: #ffffff;
	cursor: pointer;
}

/* Как на старом сайте: после шестого значения идёт стрелка раскрытия.
   Атрибут hidden должен перевесить display:flex самого значения. */
.catalog-filter-option[hidden] {
	display: none;
}

.catalog-filter-more {
	display: block;
	margin-top: 0.75rem;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
}

.catalog-filter-more img {
	display: block;
	width: 60px;
	transition: transform 0.2s ease;
}

.catalog-filter-more[aria-expanded='true'] img {
	transform: rotate(180deg);
}

.catalog-filters__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.catalog-filters__show,
.catalog-filters__reset,
.catalog-toolbar__view-button,
.catalog-toolbar__filter-button,
.catalog-filter-panel__close {
	font: inherit;
	cursor: pointer;
}

.catalog-filters__show {
	padding: 0.5rem 1.5rem;
	border: 1px solid #ec9539;
	border-radius: 50px;
	background-color: #ec9539;
	color: #ffffff;
	font-weight: 700;
}

.catalog-filters__reset {
	padding: 0.5rem 1.5rem;
	border: 1px solid #ec9539;
	border-radius: 50px;
	background-color: #ec9539;
	color: #ffffff;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.catalog-filters__reset:hover {
	border-color: #ec9539;
	background-color: #ec9539;
	color: #ffffff;
}

/* Тулбар каталога живёт в той же строке, что и поиск (как на старом сайте).
   Только для страниц каталога: на карточке товара и в поиске старый сайт
   не переносит тулбар — там .info-nav_group с width:100% ужимается в строку. */
.info-nav--catalog {
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.catalog-toolbar {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 1.75rem;
	flex-wrap: wrap;
	width: auto;
	padding: 0;
}

.catalog-toolbar__views {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.catalog-toolbar__view-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	line-height: 0;
	cursor: pointer;
}

.catalog-toolbar__icon {
	display: block;
	width: 30px;
	height: auto;
}

.catalog-toolbar__filter-button {
	padding: 0.5rem 1rem;
	border: 1px solid #5ca6ed;
	border-radius: 50px;
	background-color: #ffffff;
	color: #595959;
	line-height: 1.25rem;
}

.catalog-toolbar__filter-button {
	display: none;
}

.catalog-toolbar__filter-button {
	border-color: #5ca6ed;
	background-color: #5ca6ed;
	color: #ffffff;
}

.catalog-toolbar__filter-button:hover,
.catalog-filters__show:hover {
	border-color: #ec9539;
	background-color: #ec9539;
}

.catalog-toolbar__back {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	margin-left: auto;
	color: #595959;
	font-size: 1.125rem;
	font-weight: 600;
	text-decoration: none;
}

.catalog-toolbar__back-arrow {
	display: block;
	width: 12px;
	height: 30px;
}

.catalog-products__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	width: 100%;
}

.catalog-products__grid-item,
.catalog-products__list-item {
	min-width: 0;
	width: 100%;
}

.catalog-products__grid-item .popular-card__item {
	width: 100%;
	height: 100%;
}

.catalog-products__list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

.catalog-products__list-item .popular-card__item-list {
	width: 100%;
}

.catalog-products__empty {
	grid-column: 1 / -1;
	padding: 2rem 1rem;
	color: #595959;
	text-align: center;
}

.catalog-filter-panel__close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0 0 0.75rem auto;
	border: 0;
	border-radius: 50%;
	background-color: #5ca6ed;
	color: #ffffff;
	font-size: 1.5rem;
	line-height: 1;
}

.catalog-filter-backdrop {
	display: none;
	border: 0;
	background: rgba(0, 0, 0, 0.4);
}

@media (min-width: 1200px) {
	.catalog-products__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 991px) {
	.catalog-layout {
		display: block;
	}

	.catalog-toolbar__filter-button {
		display: inline-flex;
	}

	.catalog-sidebar[data-catalog-filter-drawer] {
		position: fixed;
		top: 0;
		inset: 0 auto 0 0;
		z-index: 1003;
		width: min(320px, 88vw);
		height: 100dvh;
		max-height: none;
		overflow-y: auto;
		padding: 1rem;
		background-color: #ffffff;
		border-radius: 0 20px 20px 0;
		box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
		transform: translateX(-105%);
		transition: transform 250ms ease;
	}

	.catalog-sidebar[data-catalog-filter-drawer].is-open,
	.catalog-sidebar[data-catalog-filter-drawer][data-open="true"] {
		transform: translateX(0);
	}

	.catalog-filter-panel__close {
		display: flex;
	}

	.catalog-filter-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1002;
	}

	.catalog-filter-backdrop[hidden] {
		display: none;
	}

	body.catalog-filter-open {
		overflow: hidden;
	}
}

@media (max-width: 790px) {
	.catalog-toolbar {
		justify-content: space-between;
		gap: 0.5rem;
		width: 100%;
		padding: 0.5rem 0;
	}

	.catalog-toolbar__views {
		gap: 0.75rem;
	}

	.catalog-toolbar__view-button,
	.catalog-toolbar__filter-button {
		padding: 0.45rem 0.7rem;
		font-size: 0.8rem;
	}

	.catalog-toolbar__back {
		display: none;
	}

	.catalog-products__grid {
		grid-template-columns: 1fr;
	}

	.catalog-products__list-item .popular-card__item-list {
		padding-right: 0.5rem;
		padding-left: 0.5rem;
	}
}
