/* Страница раздела каталога с современным фильтром: сетка «фильтр + список» и карточка товара в списке.
   Стили модуля, не относятся к теме сайта. */
.cl {
	--cl-accent: #1d2130;
	--cl-accent-text: #fff;
	--cl-border: #e3e5ec;
	--cl-soft: #f5f6f9;
	--cl-muted: #6b7183;
	--cl-radius: 14px;
	--cl-ok: #1e7e45;
	--cl-bad: #8a8fa0;
}
.cl *,
.cl *::before,
.cl *::after { box-sizing: border-box; }

.cl-layout {
	display: grid;
	grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}
.cl-side { min-width: 0; }
.cl-main { min-width: 0; }
.cl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 0 14px; }
.cl-h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.cl-count { color: var(--cl-muted); font-size: 18px; }

.cl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 16px;
}
.cl-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	background: #fff;
	overflow: hidden;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.cl-card:hover { border-color: #c9ccd8; box-shadow: 0 8px 24px -14px rgba(20, 24, 40, .35); }
.cl-card-photo { display: block; aspect-ratio: 1 / 1; background: #fff; }
.cl-card-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cl-card-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 12px 14px 14px; }
.cl-card-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 3.9em;
	color: inherit;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}
.cl-card-title:hover { text-decoration: underline; }
.cl-card-rating { min-height: 18px; }
.cl-card-stock { font-size: 13px; color: var(--cl-ok); }
.cl-card-stock.is-out { color: var(--cl-bad); }
.cl-card-buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.cl-card-price { font-size: 20px; font-weight: 800; white-space: nowrap; }

.cl-pages { margin: 26px 0 8px; text-align: center; }
.cl-empty { padding: 40px 20px; text-align: center; color: var(--cl-muted); }

@media (max-width: 991.98px) {
	.cl-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.cl-h1 { font-size: 23px; }
	.cl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}
@media (max-width: 479.98px) {
	.cl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.cl-card-body { padding: 10px; }
	.cl-card-price { font-size: 17px; }
}

/* Тексты подборки и раздела над и под списком */
.cl-text:empty { display: none; }
.cl-text--top { margin: 0 0 14px; color: var(--cl-muted); line-height: 1.5; }
.cl-text--top > :last-child { margin-bottom: 0; }
.cl-text--bottom { margin: 32px 0 0; padding-top: 22px; border-top: 1px solid var(--cl-border); line-height: 1.6; }
.cl-text--bottom h2 { margin: 0 0 10px; font-size: 22px; }

/* Панель над списком: сортировка и переключатель вида */
.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; }
.cl-toolbar:not(:has(*)) { display: none; }
.cl-sort-box { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.cl-sort-label { color: var(--cl-muted); font-size: 14px; white-space: nowrap; }
.cl-sort-select {
	min-width: 0;
	max-width: 100%;
	height: 40px;
	padding: 0 36px 0 14px;
	border: 1px solid var(--cl-border);
	border-radius: 999px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7183' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.cl-sort-select:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.cl-view { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--cl-border); border-radius: 999px; background: #fff; }
.cl-view-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 34px; border: 0; border-radius: 999px; background: none; color: var(--cl-muted); cursor: pointer; }
.cl-view-btn:hover { color: var(--cl-accent); }
.cl-view-btn[aria-pressed="true"] { background: var(--cl-accent); color: var(--cl-accent-text); }
.cl-view-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Краткие характеристики в карточке */
.cl-card-specs:empty { display: none; }
.cl-card-specs .item-specs li:nth-child(n+4) { display: none; }

/* Постраничная навигация */
.cp { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cp-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 36px;
	border: 1px solid var(--cl-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--cl-accent);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.cp-more:hover { background: var(--cl-accent); color: var(--cl-accent-text); text-decoration: none; }
.cp-more.is-loading { opacity: .5; pointer-events: none; }
.cp-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cp-list li { margin: 0; padding: 0; }
.cp-gap { display: inline-flex; align-items: center; min-width: 24px; justify-content: center; color: var(--cl-muted); }
.cp-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--cl-border); border-radius: 999px; background: #fff; color: inherit; font-weight: 600; text-decoration: none; }
a.cp-link:hover { border-color: var(--cl-accent); text-decoration: none; }
a.cp-link:focus-visible,
a.cp-more:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.cp-link.is-current { border-color: var(--cl-accent); background: var(--cl-accent); color: var(--cl-accent-text); }

/* Вид «списком» (запоминается в браузере, атрибут data-cl-view на <html>) */
html[data-cl-view="list"] .cl-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
html[data-cl-view="list"] .cl-card { flex-direction: row; }
html[data-cl-view="list"] .cl-card-photo { flex: 0 0 200px; align-self: flex-start; }
html[data-cl-view="list"] .cl-card-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 230px;
	grid-template-areas: "title buy" "rating buy" "specs buy" "stock buy";
	grid-template-rows: auto auto 1fr auto;
	column-gap: 24px;
	row-gap: 6px;
	padding: 16px 18px;
}
html[data-cl-view="list"] .cl-card-title { grid-area: title; min-height: 0; -webkit-line-clamp: 2; }
html[data-cl-view="list"] .cl-card-rating { grid-area: rating; min-height: 0; }
html[data-cl-view="list"] .cl-card-specs { grid-area: specs; }
html[data-cl-view="list"] .cl-card-stock { grid-area: stock; }
html[data-cl-view="list"] .cl-card-buy { grid-area: buy; align-self: center; flex-direction: column; align-items: stretch; justify-content: center; margin: 0; padding: 0; }
html[data-cl-view="list"] .cl-card-specs .item-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 20px; }
html[data-cl-view="list"] .cl-card-specs .item-specs li:nth-child(n+4) { display: list-item; }
html[data-cl-view="list"] .cl-card-specs .item-specs li:nth-child(n+7) { display: none; }

@media (max-width: 575.98px) {
	.cl-sort-label { display: none; }
	.cl-sort-box { flex: 1 1 auto; }
	.cl-sort-select { width: 100%; }
	html[data-cl-view="list"] .cl-card {
		display: grid;
		grid-template-columns: 116px minmax(0, 1fr);
		grid-template-areas: "photo title" "photo rating" "photo stock" "buy buy";
		grid-template-rows: auto auto 1fr auto;
		column-gap: 12px;
		row-gap: 4px;
		padding: 10px 12px 12px;
	}
	html[data-cl-view="list"] .cl-card-body { display: contents; }
	html[data-cl-view="list"] .cl-card-photo { grid-area: photo; flex: none; }
	html[data-cl-view="list"] .cl-card-title { grid-area: title; }
	html[data-cl-view="list"] .cl-card-rating { grid-area: rating; }
	html[data-cl-view="list"] .cl-card-stock { grid-area: stock; }
	html[data-cl-view="list"] .cl-card-specs { display: none; }
	html[data-cl-view="list"] .cl-card-buy { grid-area: buy; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; padding-top: 6px; }
}
@media (max-width: 767.98px) and (min-width: 576px) {
	html[data-cl-view="list"] .cl-card-photo { flex-basis: 150px; }
	html[data-cl-view="list"] .cl-card-body { grid-template-columns: minmax(0, 1fr) 190px; column-gap: 14px; }
	html[data-cl-view="list"] .cl-card-specs .item-specs { grid-template-columns: minmax(0, 1fr); }
}

/* Цена в карточке не должна наследовать оформление подписей вкладок темы */
.cl .cl-card-price label { display: inline; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; line-height: inherit; cursor: inherit; }
