.catalog-shell__page {
	padding-bottom: var(--tv-space-6, 1.5rem);
}

.catalog-shell--no-sidebar > .catalog-shell__page.catalog-grid-row {
	padding-bottom: var(--tv-space-3, 1rem);
}

.catalog-shell {
	--catalog-sidebar-sticky-top: 64px;
	--catalog-sidebar-sticky-gap: 8px;
	--catalog-sidebar-sticky-inset: 8px;
}

.catalog-shell__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--tv-space-4, 1rem);
	align-items: start;
}

.catalog-shell__sidebar,
.catalog-shell__main {
	min-width: 0;
}

/* ===== Главная каталога — акцент только в шапке блока, сетка на светлом фоне ===== */
.catalog-shell > .tv-page.catalog-subcat-strip-row,
.catalog-shell > .tv-page.catalog-category-chrome,
.catalog-shell > .tv-page.catalog-shell__page--content,
.catalog-shell > .tv-page.catalog-hero-row,
.catalog-shell > .tv-page.catalog-stores-row,
.catalog-shell > .tv-page.store-hero-row,
.catalog-shell > .tv-page.store-identity-row,
.catalog-shell > .tv-page.store-about-row,
.catalog-shell > .tv-page.store-nav-row,
.catalog-shell > .tv-page.catalog-grid-row {
	position: relative;
	top: auto;
	z-index: 1;
	isolation: isolate;
}

.catalog-shell.marketplace-store {
	--vm-catalog-col-gap: 2px;
	--vm-catalog-row-gap: 12px;
}

@media (max-width: 520px) {
	.catalog-shell.marketplace-store {
		--vm-catalog-row-gap: 10px;
	}
}

.catalog-shell--no-sidebar .catalog-shell__chrome {
	box-shadow: none;
	border: none;
}

.catalog-shell__chrome {
	--vm-catalog-accent: var(--vm-lime, #9edc2a);
	--vm-catalog-accent-ink: var(--vm-navy, #0e1a32);
	--vm-catalog-radius-shell: 5px;
	--vm-catalog-radius-inner: 8px;
	position: relative;
	overflow: hidden;
	border-radius: var(--vm-catalog-radius-shell);
	background: var(--color-stage, #fff);
	box-shadow: 0 1px 3px rgb(15 23 42 / 0.05);
}

.catalog-shell__chrome.medium_radius {
	border-radius: var(--vm-catalog-radius-shell);
}

.catalog-shell__chrome > .catalog-shell__layout {
	gap: 0;
}

.catalog-shell__chrome .catalog-shell__main {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.catalog-shell__showcase {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.catalog-shell__showcase > .catalog-shell__toolbar,
.catalog-shell__showcase > #prod.products {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.catalog-shell__showcase > .catalog-shell__toolbar {
	align-self: start;
	height: auto;
}

.catalog-shell__chrome .catalog-shell__showcase {
	padding: 0 0 8px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.catalog-shell__toolbar {
	--vm-catalog-toolbar-min-h: 52px;
	--vm-catalog-toolbar-btn-h: 28px;
	--vm-catalog-toolbar-btn-w: 44px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin: 0;
	padding: 12px 16px;
	min-height: var(--vm-catalog-toolbar-min-h);
	box-sizing: border-box;
	border-radius: var(--tv-radius-md, 5px);
	background: var(--tv-action-primary, #6366f1);
	color: #fff;
	box-shadow: none;
}

.catalog-shell__toolbar-title {
	margin: 0;
	font-family: var(--font-sans);
	font-size: clamp(0.8125rem, 1.2vw, 0.9375rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgb(255 255 255 / 0.82);
}

.catalog-shell__toolbar .product_bar {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
	padding: 0;
	border-radius: 0;
}

.catalog-shell__toolbar .card_changer {
	min-height: var(--vm-catalog-toolbar-btn-h);
}

.catalog-shell__toolbar .card_changer button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--vm-catalog-toolbar-btn-w);
	min-width: var(--vm-catalog-toolbar-btn-w);
	height: var(--vm-catalog-toolbar-btn-h);
	min-height: var(--vm-catalog-toolbar-btn-h);
	padding: 0;
	box-sizing: border-box;
	border-radius: var(--vm-catalog-radius-inner);
	border-color: rgb(255 255 255 / 0.28) !important;
	background: rgb(255 255 255 / 0.12);
	color: #fff;
	cursor: pointer;
}

.catalog-shell__toolbar .card_changer button:hover:not(.active) {
	background: rgb(255 255 255 / 0.2);
	border-color: rgb(255 255 255 / 0.38) !important;
	color: #fff;
}

.catalog-shell__toolbar .card_changer button.active {
	background: #fff;
	border-color: #fff !important;
	box-shadow: 0 2px 8px rgb(15 23 42 / 0.16);
	color: var(--tv-action-primary, #6366f1);
}

.catalog-shell__toolbar .card_changer button.active:hover {
	background: #fff;
	border-color: #fff !important;
	box-shadow: 0 2px 10px rgb(15 23 42 / 0.2);
}

.catalog-shell__toolbar .card_changer button:not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.catalog-shell__toolbar .card_changer button:not(:first-child) {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.catalog-shell__toolbar .card_changer button img {
	display: block;
	width: 16px;
	height: 16px;
	opacity: 0.88;
	filter: brightness(0) invert(1);
}

.catalog-shell__toolbar .card_changer button.active img {
	opacity: 1;
	filter: none;
}

.catalog-shell__chrome .catalog-shell__showcase > .catalog-shell__toolbar {
	padding-left: 16px;
	padding-right: 16px;
}

.catalog-shell--no-sidebar .catalog-shell__chrome .catalog-shell__showcase > #prod.products {
	padding-left: 0;
	padding-right: 0;
	width: 100%;
	max-width: none;
	box-sizing: border-box;
	border: none;
	box-shadow: none;
	outline: none;
}

.catalog-shell--no-sidebar .catalog-shell__chrome .products.vertical_4 {
	width: 100%;
	justify-content: stretch;
	column-gap: var(--vm-catalog-col-gap, 2px);
	row-gap: var(--vm-catalog-row-gap, 12px);
}

.catalog-shell--no-sidebar #prod .product_card--marketplace.vertical_4,
.catalog-shell--no-sidebar #prod .product_card.vertical_4.product_card--marketplace {
	width: 100%;
	min-width: 0;
	max-width: none;
	box-sizing: border-box;
	border: none;
	box-shadow: none;
	outline: none;
}

html.dark .catalog-shell__toolbar {
	background: var(--tv-action-primary, #818cf8);
	box-shadow: none;
}

html.dark .catalog-shell__chrome {
	background: var(--color-stage, #1a1f2e);
	box-shadow: none;
	border: none;
}

html.dark .catalog-shell:not(.catalog-shell--no-sidebar) > .tv-page.catalog-shell__page--content {
	background: var(--color-stage, #1a1f2e);
	color: var(--color-text-stage, #e8eaef);
}

html.dark .catalog-shell--no-sidebar .catalog-shell__chrome {
	box-shadow: none;
	border: none;
}

@media (max-width: 991px) {
	/* Сетка товаров — на всю ширину экрана (главный каталог + витрины поставщиков) */
	.catalog-shell.marketplace-store > .tv-page.catalog-grid-row,
	.catalog-shell.marketplace-store > .tv-page.catalog-shell__page.catalog-grid-row,
	.catalog-shell.marketplace-store > .tv-page.catalog-shell__page--content {
		padding-left: 0;
		padding-right: 0;
	}

	.catalog-shell--no-sidebar .catalog-shell__chrome {
		border-radius: 0;
	}

	.catalog-shell.marketplace-store .catalog-shell__showcase {
		padding-left: 0;
		padding-right: 0;
	}

	.catalog-shell--no-sidebar .catalog-shell__chrome .catalog-shell__showcase > .catalog-shell__toolbar,
	.catalog-shell.marketplace-store > .tv-page.catalog-shell__page--content .catalog-shell__showcase > .catalog-shell__toolbar {
		margin-left: var(--tv-page-gutter, 12px);
		margin-right: var(--tv-page-gutter, 12px);
		width: calc(100% - 2 * var(--tv-page-gutter, 12px));
		box-sizing: border-box;
		border-radius: var(--tv-radius-md, 5px);
	}

	.catalog-shell.marketplace-store #prod.products.vertical_4 {
		column-gap: 0;
		row-gap: 0;
	}

	.catalog-shell #prod .product_card--marketplace.vertical_4,
	.catalog-shell #prod .product_card.vertical_4.product_card--marketplace {
		--vm-card-inset: 8px;
		--vm-card-media-inset-x: 8px;
		--vm-card-media-inset-y: 6px;
		border-radius: 12px;
		padding: var(--vm-card-inset);
		background-color: var(--color-stage, #fff);
		box-shadow: none;
		overflow: visible;
	}

	.catalog-shell #prod .product_card--marketplace .pc_media {
		border-radius: var(--vm-card-media-radius, 10px);
	}

	.catalog-shell #prod .product_card--marketplace .pc_media__link,
	.catalog-shell #prod .product_card--marketplace .pc_media__link img {
		border-radius: var(--vm-card-media-radius, 10px);
	}
}

@media (max-width: 767px) {
	.catalog-shell__toolbar {
		--vm-catalog-toolbar-min-h: 48px;
		padding: 10px 12px;
	}

	.catalog-shell--no-sidebar .catalog-shell__chrome .catalog-shell__showcase > #prod.products {
		padding-left: 0;
		padding-right: 0;
	}
}

@media (min-width: 992px) {
	.catalog-shell__layout {
		grid-template-columns: var(--catalog-sidebar-width, 256px) minmax(0, 1fr);
		gap: 24px;
		align-items: stretch;
	}

	.catalog-shell__sidebar {
		width: var(--catalog-sidebar-width, 256px);
		align-self: stretch;
		min-height: 0;
	}

	/* Ozon-style: липнет сразу под шапкой; max-height вместо bottom (bottom сдвигал панель вниз) */
	.catalog-shell:not(.catalog-shell--no-sidebar) .catalog-shell__sidebar .sticky_ {
		position: sticky;
		top: calc(var(--catalog-sidebar-sticky-top) + var(--catalog-sidebar-sticky-inset));
		max-height: calc(100vh - var(--catalog-sidebar-sticky-top) - var(--catalog-sidebar-sticky-inset) - var(--catalog-sidebar-sticky-gap));
		overflow-x: hidden;
		overflow-y: hidden;
		overscroll-behavior-y: auto;
		-ms-overflow-style: none;
		scrollbar-width: none;
	}

	.catalog-shell:not(.catalog-shell--no-sidebar) .catalog-shell__sidebar .sticky_.is-scrollable {
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.catalog-shell:not(.catalog-shell--no-sidebar) .catalog-shell__sidebar .sticky_::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}

	.catalog-shell--no-sidebar .catalog-shell__layout {
		grid-template-columns: 1fr;
	}
}

/* Отдельная шапка категории — как header, полная ширина .tv-page */
.catalog-shell > .tv-page.catalog-category-chrome {
	padding-top: 18px;
	padding-bottom: 16px;
	box-sizing: border-box;
}

/* Блок фильтров + товаров — та же ширина .tv-page, что и шапка категории */
.catalog-shell:not(.catalog-shell--no-sidebar) > .tv-page.catalog-shell__page--content {
	box-sizing: border-box;
	background-color: var(--color-stage, #fff);
	color: var(--color-text-stage, #202020);
	border-radius: 5px;
}

.catalog-shell__page--content > .catalog-shell__layout {
	width: 100%;
}

.catalog-shell__page--content .catalog-shell__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.catalog-shell__page--content .catalog-shell__showcase {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	/* auto + 1fr: toolbar не растягивается, когда #prod пуст (иначе grid делит высоту сайдбара между строками) */
	grid-template-rows: auto minmax(0, 1fr);
	align-content: start;
	gap: 12px;
	overflow-x: clip;
}

.catalog-shell__page--content .catalog-shell__showcase > #prod.products {
	padding-left: 0;
	padding-right: 0;
}

.catalog-category-chrome__title {
	margin: 0;
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.catalog-category-chrome:has(.catalog-subcat-strip) .catalog-category-chrome__title {
	margin-bottom: 14px;
}

.catalog-category-chrome .catalog-subcat-strip {
	padding: 0;
	border: none;
	background: transparent;
}

.catalog-subcat-strip {
	padding: 14px 18px;
	border: 1px solid color-mix(in srgb, var(--tv-action-primary, #6366f1) 18%, transparent);
}

.catalog-subcat-strip__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px 24px;
}

.catalog-subcat-strip__all {
	flex: 0 0 auto;
	align-self: center;
	padding: 8px 14px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--tv-action-primary, #6366f1) 12%, transparent);
	color: var(--tv-action-primary, #6366f1);
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.catalog-subcat-strip__all:hover {
	background: var(--tv-action-primary, #6366f1);
	color: #fff;
}

.catalog-subcat-strip__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1 1 280px;
	min-width: 0;
}

.catalog-subcat-strip__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--tv-action-primary, #6366f1) 22%, transparent);
	color: inherit;
	text-decoration: none;
	line-height: 1.25;
	transition: border-color 0.2s, background-color 0.2s;
}

.catalog-subcat-strip__link:hover {
	border-color: var(--tv-action-primary, #6366f1);
	background: color-mix(in srgb, var(--tv-action-primary, #6366f1) 8%, transparent);
}

.catalog-subcat-strip__count {
	font-size: 0.75rem;
	opacity: 0.65;
}

html.dark .catalog-subcat-strip__all {
	color: var(--color-text-stage, #e8eaef);
}
