/* ссылки на подкатегории */
.products-categories__item {
  flex-direction: inherit;
}
.products-categories__item-image {
  margin: 0;
  height: auto;
}

.products-categories__item-title {
  margin: auto 0;
  width: 100%;
}

/*пагинация и кнопка показать еще*/
.container-pagination {
  display: block;
}

.pagination__action {
  display: block;
  margin: 0 0 2rem;
  text-align: center;
}

.pagination__action .show-more-prostore {
  width: 40%;
}

.pagination {
  display: block;
}

@media (max-width: 390px) {
  .pagination__action .show-more-prostore {
    width: 100%;
  }
}

/*страница поиска вывод сообщения что ничего не найдено */
.system.search {
  padding-top: 1rem;
}
/* Prostore: убрать плашку «Успей купить» с карточки (перекрывала «Купить»); грузится через addStyle mode.css */
.products__item .products__item-discount {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 0 !important;
	pointer-events: none !important;
}
.products__item:not(.products__item--min) .products__item-action {
	z-index: 5;
	position: relative !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	width: 100%;
	margin: 0;
}

/* Prostore: высота карточки по контенту, чтобы кнопка в потоке не обрезалась */
.products__list .products__item:not(.products__item--small):not(.products__item--min):not(.products__item--line),
.products-featured .products__item:not(.products__item--small):not(.products__item--min):not(.products__item--line),
.swiper-products .products__item:not(.products__item--small):not(.products__item--min):not(.products__item--line) {
	height: auto !important;
	min-height: 55.1rem;
}
/* Prostore: количество слева, шире; кнопка «В корзину» на оставшуюся ширину */
.ui-add-to-cart {
	width: 100%;
	box-sizing: border-box;
}
.ui-add-to-cart .ui-number {
	opacity: 1 !important;
	visibility: visible !important;
	position: relative !important;
	order: -1;
	flex: 0 0 auto !important;
	width: 12.5rem !important;
	min-width: 12.5rem !important;
	max-width: none;
	margin: 0 1rem 0 0 !important;
	box-sizing: border-box;
}
.ui-add-to-cart .ui-number__input {
	padding-left: 0.9rem !important;
	padding-right: 0.9rem !important;
	font-size: 1.6rem !important;
	letter-spacing: 0.02em;
}
.ui-add-to-cart .ui-btn--primary,
.ui-add-to-cart .comments__form-btn,
.ui-add-to-cart .brands__search-btn,
.ui-add-to-cart .details__comments-form-btn,
.ui-add-to-cart .reviews__form-btn {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
}
.ui-add-to-cart.is-active .ui-btn--primary,
.ui-add-to-cart.is-active .comments__form-btn,
.ui-add-to-cart.is-active .brands__search-btn,
.ui-add-to-cart.is-active .details__comments-form-btn,
.ui-add-to-cart.is-active .reviews__form-btn {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
}
.ui-add-to-cart .js-btn-preview,
.ui-add-to-cart .ui-btn--view {
	flex: 0 0 auto !important;
	width: auto !important;
	min-width: 0 !important;
}
.sku__action .ui-add-to-cart .ui-number {
	margin: 0 1rem 0 0 !important;
}
@media (min-width: 768px) {
	.sku__action .ui-add-to-cart .ui-btn--primary,
	.sku__action .ui-add-to-cart .comments__form-btn,
	.sku__action .ui-add-to-cart .brands__search-btn,
	.sku__action .ui-add-to-cart .details__comments-form-btn,
	.sku__action .ui-add-to-cart .reviews__form-btn {
		min-width: 0 !important;
		flex: 1 1 auto !important;
		width: auto !important;
		max-width: none !important;
	}
}

/* Мобилка: карточка каталога — цены не в одну строку, без обрезания кнопки; счётчик только после добавления в корзину */
@media (max-width: 767px) {
	.products__list .products__item,
	.products__item--responsive,
	.set .products__item--responsive {
		height: auto !important;
		min-height: unset !important;
	}
	.products__item .products__item-price del:after,
	.products__item .products__item-price .price-old:after {
		content: none !important;
		display: none !important;
	}
	.products__item .products__item-price del,
	.products__item .products__item-price .price-old {
		text-decoration: line-through !important;
		text-decoration-color: #F45656;
		text-decoration-thickness: 0.1em;
	}
	.products__item .products__item-price:not(:has(ins)) {
		display: block !important;
		text-align: center !important;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		margin: 0 auto !important;
		padding: 0 0.25rem;
		white-space: normal !important;
		font-size: 1.45rem !important;
		line-height: 1.45 !important;
		word-break: break-word;
		overflow-wrap: anywhere;
	}
	.products__item .products__item-price:has(ins):has(del) {
		display: grid !important;
		grid-template-columns: auto minmax(0, max-content);
		grid-template-rows: auto auto;
		align-items: start;
		column-gap: 0.75rem;
		row-gap: 0.35rem;
		width: max-content;
		max-width: 100%;
		box-sizing: border-box;
		margin: 0 auto !important;
		padding: 0 0.25rem 0.35rem;
		white-space: normal !important;
		font-size: 1.45rem !important;
		line-height: 1.35 !important;
		word-break: break-word;
		overflow-wrap: anywhere;
	}
	.products__item .products__item-price:has(ins):has(del) mark {
		grid-column: 1;
		grid-row: 1 / span 2;
		align-self: center;
		justify-self: start;
		margin: 0 !important;
		display: inline-block;
	}
	.products__item .products__item-price:has(ins):has(del) del {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
		align-self: start;
		text-align: right !important;
		width: 100%;
		margin: 0 !important;
		padding: 0 !important;
	}
	.products__item .products__item-price:has(ins):has(del) ins {
		grid-column: 2;
		grid-row: 2;
		justify-self: center;
		align-self: start;
		text-align: center !important;
		width: 100%;
		margin: 0 !important;
		text-decoration: none;
	}
	.products__item .products__item-price > span,
	.products__item .products__item-price > small,
	.products__item .products__item-price > div {
		grid-column: 1 / -1;
		width: 100%;
		max-width: 100%;
		text-align: center !important;
		font-size: 1.18rem;
		line-height: 1.45;
		font-weight: 400;
		margin: 0.45rem 0 0 !important;
	}
	.products__item .products__item-price ins *,
	.products__item .products__item-price del * {
		display: block !important;
		margin: 0.25rem auto 0 !important;
		text-align: center !important;
		max-width: 100%;
		box-sizing: border-box;
	}
	/* до добавления: только «В корзину» на всю ширину ряда */
	.products__item .ui-add-to-cart:not(.is-active) .ui-number {
		display: none !important;
	}
	.products__item .ui-add-to-cart:not(.is-active) .ui-btn--primary {
		flex: 1 1 auto !important;
		width: 100% !important;
		min-width: 0 !important;
		margin-right: 0.75rem !important;
	}
	.products__item .ui-add-to-cart:not(.is-active) .js-btn-preview {
		flex: 0 0 auto !important;
	}
	/* после добавления: вместо «В корзине» — только количество */
	.products__item .ui-add-to-cart.is-active .ui-btn--primary {
		display: none !important;
	}
	.products__item .ui-add-to-cart.is-active .ui-number {
		display: flex !important;
		flex: 1 1 100% !important;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		margin: 0 !important;
		opacity: 1 !important;
		visibility: visible !important;
		position: relative !important;
		order: 0 !important;
	}
	.products__item .ui-add-to-cart.is-active {
		flex-wrap: wrap;
	}
	.products__item .ui-add-to-cart.is-active .js-btn-preview {
		flex: 0 0 auto !important;
		margin-left: auto;
	}
	/* tap: no shrink on cart buttons */
	.products__item .products__item-action .ui-btn:active,
	.products__item .products__item-action .ui-btn:focus {
		transform: none !important;
	}
}


/* Мобилка: кнопка «Купить» / количество — ширина и высоты */
@media (max-width: 767px) {
	.products__item--responsive .products__item-action .ui-btn--primary {
		max-width: none !important;
		width: 100% !important;
	}
	.products__item .ui-add-to-cart:not(.is-active) {
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 0.5rem;
		min-height: 5.5rem;
	}
	.products__item .ui-add-to-cart:not(.is-active) .ui-btn--primary {
		margin-right: 0 !important;
		flex: 0 0 auto !important;
		width: 100% !important;
		min-height: 5rem !important;
		box-sizing: border-box !important;
	}
	.products__item .ui-add-to-cart:not(.is-active) .js-btn-preview {
		margin: 0 !important;
		align-self: center;
	}
	.products__item .ui-add-to-cart.is-active .ui-number {
		min-height: 5rem !important;
		align-items: center !important;
	}
	.products__item .ui-add-to-cart.is-active {
		min-height: 5.5rem;
	}
	.products__item .products__item-action .ui-add-to-cart {
		min-height: 5.5rem;
		align-items: stretch;
	}
}

/* Перебить кастом из темы (custom_css): float/-margin у .products__item-discounts и text-align:right у mark — из-за них наезжали цены */
@media (max-width: 767px) {
	.products__list .products__item .products__item-discounts,
	.swiper-products .products__item .products__item-discounts,
	.products-featured .products__item .products__item-discounts {
		float: none !important;
		clear: both !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0.5rem 0 0 !important;
		padding: 0 !important;
		position: relative !important;
		top: auto !important;
		right: auto !important;
		left: auto !important;
	}
	.products__list .products__item .products__item-discounts p,
	.swiper-products .products__item .products__item-discounts p,
	.products-featured .products__item .products__item-discounts p {
		text-align: center !important;
		font-size: 1.25rem !important;
		line-height: 1.45 !important;
		margin: 0.2rem 0 !important;
		font-weight: 500;
	}
	.products__list .products__item .products__item-price mark,
	.swiper-products .products__item .products__item-price mark,
	.products-featured .products__item .products__item-price mark,
	.products__item--responsive .products__item-price mark {
		text-align: center !important;
	}
	.products__list .products__item.products__item--responsive,
	.swiper-products .products__item.products__item--responsive,
	.products-featured .products__item.products__item--responsive,
	.products__list .products__item {
		height: auto !important;
		min-height: unset !important;
	}
	.products__item.products__item--compact {
		height: auto !important;
		min-height: unset !important;
	}
}


/* Десктоп: при акции — плашка % слева, справа цены. Тема: .products__item-price { display:flex; flex:1 } — в grid кастомный justify-content:flex-end сдвигает треки вправо; гасим + сбрасываем flex */
@media (min-width: 768px) {
	.products__list .products__item .products__item-price:has(ins):has(del),
	.swiper-products .products__item .products__item-price:has(ins):has(del),
	.products-featured .products__item .products__item-price:has(ins):has(del),
	.products__item .products__item-price:has(ins):has(del) {
		display: grid !important;
		grid-template-columns: auto minmax(0, max-content) !important;
		grid-template-rows: auto auto;
		align-items: start;
		align-content: start !important;
		justify-content: start !important;
		justify-items: start !important;
		column-gap: 0.75rem;
		row-gap: 0.25rem;
		white-space: normal !important;
		text-align: left !important;
		direction: ltr !important;
		width: max-content !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		flex: none !important;
		-ms-flex: none !important;
		align-self: flex-start !important;
		margin-left: 0 !important;
		margin-right: auto !important;
	}
	.products__list .products__item .products__item-price:has(ins):has(del) mark,
	.swiper-products .products__item .products__item-price:has(ins):has(del) mark,
	.products-featured .products__item .products__item-price:has(ins):has(del) mark,
	.products__item .products__item-price:has(ins):has(del) mark {
		grid-column: 1;
		grid-row: 1 / span 2;
		align-self: center;
		justify-self: start;
		margin: 0 !important;
		text-align: center !important;
	}
	.products__list .products__item .products__item-price:has(ins):has(del) del,
	.swiper-products .products__item .products__item-price:has(ins):has(del) del,
	.products-featured .products__item .products__item-price:has(ins):has(del) del,
	.products__item .products__item-price:has(ins):has(del) del {
		grid-column: 2;
		grid-row: 1;
		justify-self: start !important;
		width: auto !important;
		max-width: 100% !important;
		text-align: left !important;
		margin: 0 !important;
	}
	.products__list .products__item .products__item-price:has(ins):has(del) ins,
	.swiper-products .products__item .products__item-price:has(ins):has(del) ins,
	.products-featured .products__item .products__item-price:has(ins):has(del) ins,
	.products__item .products__item-price:has(ins):has(del) ins {
		grid-column: 2;
		grid-row: 2;
		justify-self: start !important;
		width: auto !important;
		max-width: 100% !important;
		text-align: left !important;
		margin: 0 !important;
	}
	.products__list .products__item .products__item-price:has(ins):has(del) ins *,
	.products__list .products__item .products__item-price:has(ins):has(del) del *,
	.swiper-products .products__item .products__item-price:has(ins):has(del) ins *,
	.swiper-products .products__item .products__item-price:has(ins):has(del) del *,
	.products-featured .products__item .products__item-price:has(ins):has(del) ins *,
	.products-featured .products__item .products__item-price:has(ins):has(del) del *,
	.products__item .products__item-price:has(ins):has(del) ins *,
	.products__item .products__item-price:has(ins):has(del) del * {
		text-align: left !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.sku__price:has(.sku__price-ins):has(.sku__price-del) {
		flex-direction: column !important;
		align-items: flex-start !important;
		flex-wrap: nowrap !important;
		gap: 0.35rem;
		white-space: normal !important;
	}
	.sku__price:has(.sku__price-ins):has(.sku__price-del) .sku__price-del {
		order: 1;
		margin: 0 0 0.25rem 0 !important;
	}
	.sku__price:has(.sku__price-ins):has(.sku__price-del) .sku__price-ins {
		order: 2;
		margin: 0 !important;
	}
	.sku__price:has(.sku__price-ins):has(.sku__price-del) .sku__price-economy {
		order: 3;
		margin: 0.25rem 0 0 !important;
	}
}
