/**
 * IV Sport — макет каталога: sidebar + товары
 */

/* Скрываем дублирующий hero Blocksy — заголовок в правой колонке */
.iv-catalog-page .hero-section {
	display: none;
}

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

/* ── Sidebar ─────────────────────────────────────────── */

.iv-catalog-sidebar {
	position: sticky;
	top: 100px;
}

.iv-catalog-sidebar__inner {
	border: 1px solid var(--iv-gray-200, #e5e5e5);
	background: #fff;
}

.iv-catalog-sidebar__title {
	margin: 0;
	padding: 1rem 1.25rem;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #757575;
	border-bottom: 1px solid #e5e5e5;
}

.iv-catalog-nav__list,
.iv-catalog-nav__sub {
	list-style: none;
	margin: 0;
	padding: 0;
}

.iv-catalog-nav__list {
	padding: 0.5rem;
}

/* Корневые разделы — заголовок блока, без боковых линий у подменю */
.iv-catalog-nav__list > .iv-catalog-nav__item--root {
	margin-top: 0.5rem;
	border: none;
	border-radius: 0;
	overflow: visible;
	background: transparent;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root:first-child {
	margin-top: 0;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root + .iv-catalog-nav__item--root {
	margin-top: 0.625rem;
}

.iv-catalog-nav__item {
	border-bottom: none;
}

.iv-catalog-nav__item--root {
	border-bottom: none;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root.has-children > .iv-catalog-nav__row {
	background: #f3f3f3;
	border: 1px solid #e8e8e8;
	border-radius: 2px;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root.has-children.is-open > .iv-catalog-nav__row {
	background: #ececec;
	border-bottom: 1px solid #e8e8e8;
	border-radius: 2px 2px 0 0;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root.has-children > .iv-catalog-nav__row .iv-catalog-nav__link {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #111;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root.has-children.is-active-branch > .iv-catalog-nav__row .iv-catalog-nav__link {
	color: #111;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root:not(.has-children) > .iv-catalog-nav__link {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}

.iv-catalog-nav__list > .iv-catalog-nav__item--root.has-children > .iv-catalog-nav__row .iv-catalog-nav__toggle {
	background: transparent;
	border-left: none;
}

.iv-catalog-nav__item:last-child {
	border-bottom: none;
}

.iv-catalog-nav__row {
	display: flex;
	align-items: stretch;
}

.iv-catalog-nav__row .iv-catalog-nav__link {
	flex: 1;
	min-width: 0;
}

.iv-catalog-nav__link {
	display: block;
	padding: 0.85rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #111;
	text-decoration: none;
	line-height: 1.35;
	transition: background 0.12s, color 0.12s;
}

.iv-catalog-nav__link.is-active,
.iv-catalog-nav__item:not(.has-children).is-active > .iv-catalog-nav__link {
	font-weight: 700;
	background: #f5f5f5;
}

.iv-catalog-nav__item.is-active-branch > .iv-catalog-nav__row .iv-catalog-nav__link {
	font-weight: 600;
}

.iv-catalog-nav__toggle {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	transition: background 0.12s;
}

.iv-catalog-nav__toggle:hover {
	background: #fafafa;
}

.iv-catalog-nav__chevron {
	display: block;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid #757575;
	border-bottom: 1.5px solid #757575;
	transform: rotate(-45deg);
	transition: transform 0.2s;
}

.iv-catalog-nav__item.is-open > .iv-catalog-nav__row .iv-catalog-nav__chevron {
	transform: rotate(45deg);
}

.iv-catalog-nav__sub {
	display: none;
	background: #fff;
	border: none;
}

.iv-catalog-nav__sub.is-open {
	display: block;
}

.iv-catalog-nav__sub--level-1 {
	padding: 0.35rem 0 0.5rem;
}

.iv-catalog-nav__sub--level-1 .iv-catalog-nav__item {
	border-bottom: none;
}

.iv-catalog-nav__sub .iv-catalog-nav__row {
	border: none;
	background: transparent;
}

.iv-catalog-nav__sub .iv-catalog-nav__link {
	padding: 0.5rem 1rem 0.5rem 1.25rem;
	font-size: 0.8125rem;
	font-weight: 400;
	color: #555;
}

.iv-catalog-nav__sub .iv-catalog-nav__sub .iv-catalog-nav__link {
	padding-left: 1.75rem;
}

.iv-catalog-nav__link:hover {
	background: #fafafa;
	color: #111;
}

.iv-catalog-nav__sub .iv-catalog-nav__link.is-active,
.iv-catalog-nav__sub .iv-catalog-nav__item:not(.has-children).is-active > .iv-catalog-nav__link {
	color: #111;
	background: #f5f5f5;
}

.iv-catalog-nav__sub .iv-catalog-nav__sub .iv-catalog-nav__link.is-active,
.iv-catalog-nav__sub .iv-catalog-nav__sub .iv-catalog-nav__item:not(.has-children).is-active > .iv-catalog-nav__link {
	color: #111;
	background: #f5f5f5;
}

/* ── Main column ─────────────────────────────────────── */

.iv-catalog-main {
	min-width: 0;
}

.iv-catalog-main__head {
	margin-bottom: 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid #e5e5e5;
}

.iv-catalog-main__title {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: -0.03em;
	line-height: 1.1;
	color: #111;
}

.iv-catalog-main__desc {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	color: #757575;
	line-height: 1.55;
}

.iv-catalog-main__desc p {
	margin: 0;
}

.iv-catalog-search {
	margin-top: 1rem;
	max-width: 520px;
}

.iv-catalog-search__form {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--iv-black, #111);
	border-radius: 999px;
	overflow: hidden;
	background: #fff;
}

.iv-catalog-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 0.75rem 1rem;
	font: inherit;
	color: var(--iv-black, #111);
	outline: none;
}

.iv-catalog-search__input::placeholder {
	color: rgba(17, 17, 17, 0.45);
}

.iv-catalog-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	border: 0;
	background: var(--iv-black, #111);
	color: #fff;
	cursor: pointer;
}

.iv-catalog-search__submit:hover {
	background: #333;
}

.iv-catalog-main__content.is-search-loading {
	opacity: 0.55;
	pointer-events: none;
}

.iv-search-products {
	margin: 0;
	padding: 0;
	list-style: none;
}

.iv-search-product__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.iv-search-product__link:hover .woocommerce-loop-product__title {
	text-decoration: underline;
}

.iv-search-product__figure {
	margin: 0 0 1rem;
	aspect-ratio: 4 / 3;
	background: #f5f5f5;
	overflow: hidden;
}

.iv-search-product__figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.iv-catalog-main__content .woocommerce-products-header {
	display: none;
}

.iv-catalog-main__content .woo-listing-top {
	margin-bottom: 1.25rem;
}

/* ── Filters (правая колонка) ─────────────────────────── */

.iv-catalog-filters {
	position: sticky;
	top: 100px;
}

.iv-catalog-filters__inner {
	border: 1px solid var(--iv-gray-200, #e5e5e5);
	background: #fff;
}

.iv-catalog-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #e5e5e5;
}

.iv-catalog-filters__title {
	margin: 0;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #757575;
}

.iv-catalog-filters__reset {
	font-size: 0.75rem;
	font-weight: 600;
	color: #111;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.iv-catalog-filters__reset:hover {
	color: #757575;
}

.iv-catalog-filters__body {
	padding: 0.25rem 0 0.5rem;
}

.iv-filter-group {
	padding: 0.75rem 0;
	border-bottom: 1px solid #f0f0f0;
}

.iv-filter-group:last-child {
	border-bottom: none;
}

.iv-filter-group__title {
	margin: 0;
	padding: 0 1.25rem 0.65rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #111;
}

.iv-filter-group__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 220px;
	overflow: auto;
}

.iv-filter-group__link {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.45rem 1.25rem;
	font-size: 0.8125rem;
	color: #111;
	text-decoration: none;
	line-height: 1.35;
	transition: background 0.12s;
}

.iv-filter-group__link:hover {
	background: #fafafa;
}

.iv-filter-group__check {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	border: 1.5px solid #bdbdbd;
	border-radius: 2px;
	background: #fff;
	position: relative;
}

.iv-filter-group__item.is-active .iv-filter-group__check {
	background: #111;
	border-color: #111;
}

.iv-filter-group__item.is-active .iv-filter-group__check::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0;
	width: 5px;
	height: 8px;
	border: solid #fff;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}

.iv-filter-group__item.is-active .iv-filter-group__label {
	font-weight: 600;
}

.iv-filter-group__label--instock::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 0.4rem;
	border-radius: 50%;
	background: #16a34a;
	vertical-align: middle;
}

.iv-filter-group--instock .iv-filter-group__list {
	max-height: none;
}

.iv-filter-group--color .iv-filter-group__link {
	justify-content: flex-start;
}

.iv-filter-group--color .iv-filter-group__label {
	flex: 1;
	min-width: 0;
}

.iv-filter-color-swatch {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin-left: auto;
	border-radius: 50%;
	background-color: var(--iv-swatch-color, #bdbdbd);
	border: 1px solid rgba(0, 0, 0, 0.15);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.iv-filter-color-swatch.is-light {
	border-color: rgba(0, 0, 0, 0.22);
}

.iv-catalog-filters__reset-mobile {
	display: none;
	margin: 0;
	padding: 0.65rem 1.25rem 0;
}

.iv-catalog-filters__toggle {
	display: none;
}

/* Сетка товаров: 3 в ряд на широком экране */
.iv-catalog-page [data-products] {
	--shop-columns: repeat(3, minmax(0, 1fr));
	--grid-columns-gap: 22px;
}

@media (max-width: 1199px) {
	.iv-catalog-page [data-products] {
		--shop-columns: repeat(2, minmax(0, 1fr));
	}
}

.iv-catalog-page .woocommerce-info,
.iv-catalog-page .woocommerce-no-products-found {
	margin: 0;
}

/* Карточка товара: без категории и кнопки «Выберите параметры» */
.iv-catalog-page [data-products] .entry-meta,
.iv-catalog-page [data-products] .ct-woo-card-actions {
	display: none !important;
}

/* ── Mobile ──────────────────────────────────────────── */

@media (max-width: 1199px) {
	.iv-catalog-layout {
		grid-template-columns: 260px minmax(0, 1fr);
	}

	.iv-catalog-filters {
		grid-column: 1 / -1;
		position: static;
		order: 2;
	}

	.iv-catalog-main {
		order: 3;
	}

	.iv-catalog-sidebar {
		order: 1;
	}

	.iv-catalog-filters__head {
		display: none;
	}

	.iv-catalog-filters__reset-mobile {
		display: block;
	}

	.iv-catalog-filters__toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 0.85rem 1.25rem;
		border: none;
		border-bottom: 1px solid #e5e5e5;
		background: #fff;
		font-size: 0.875rem;
		font-weight: 600;
		cursor: pointer;
	}

	.iv-catalog-filters.is-collapsed .iv-catalog-filters__body {
		display: none;
	}

	.iv-catalog-filters__chevron {
		width: 6px;
		height: 6px;
		border-right: 1.5px solid #757575;
		border-bottom: 1.5px solid #757575;
		transform: rotate(45deg);
		transition: transform 0.2s;
	}

	.iv-catalog-filters:not(.is-collapsed) .iv-catalog-filters__chevron {
		transform: rotate(-135deg);
	}
}

@media (max-width: 999px) {
	.iv-catalog-layout {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.iv-catalog-sidebar {
		position: static;
	}

	.iv-catalog-sidebar__inner {
		max-height: none;
		overflow: visible;
	}

	.iv-catalog-nav__sub.is-open {
		display: block;
	}
}

@media (max-width: 689px) {
	.iv-catalog-page [data-products] {
		--shop-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 479px) {
	.iv-catalog-page [data-products] {
		--shop-columns: repeat(1, minmax(0, 1fr));
	}
}
