/* Category information starts below both columns, in the site's full container. */
:is(.tax-product_cat, .tax-product_brand) .altyn-category-sections>.ast-container {
	display: block;
}

:is(.tax-product_cat, .tax-product_brand) #content :is(#primary, #secondary) {
	margin-bottom: 0;
}

:is(.tax-product_cat, .tax-product_brand) .altyn-category-sections {
	padding-bottom: 48px;
}

/* Catalog filters share Astra's palette and the site's form control sizes. */
:is(.tax-product_cat, .tax-product_brand) #secondary {
	--altyn-filter-primary: var(--ast-global-color-0, #07404F);
	--altyn-filter-heading: var(--ast-global-color-2, #171F2C);
	--altyn-filter-text: var(--ast-global-color-3, #454C56);
	--altyn-filter-surface: var(--ast-global-color-4, #FFFFFF);
	--altyn-filter-hover: var(--ast-global-color-5, #F3F5F6);
	--altyn-filter-border: #E8E9EA;
	--altyn-filter-radius: 4px;
	color: var(--altyn-filter-text);
	font-size: 14px;
	line-height: 20px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters {
	--wc-product-filter-block-spacing: 16px;
	--wc-product-filter-checkbox-list-option-element: var(--altyn-filter-surface);
	--wc-product-filter-checkbox-list-option-element-border: #AEB5BD;
	--wc-product-filter-checkbox-list-option-element-selected: #FFFFFF;
	--wc-product-filter-checkbox-list-label-element: inherit;
	width: 100%;
	min-width: 0;
	font-family: inherit;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__overlay-content>.wp-block-heading {
	color: var(--altyn-filter-heading);
	font-size: 20px;
	font-weight: 500;
	line-height: 28px;
}

/* Keep WooCommerce's native dual range and price bindings, with catalog controls. */
:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider {
	--wc-product-filter-price-slider: var(--altyn-filter-primary);
	--wc-product-filter-price-slider-handle: var(--altyn-filter-surface);
	--wc-product-filter-price-slider-handle-border: var(--altyn-filter-primary);
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__content {
	grid-template-areas: "price-slider price-slider" "left-input right-input";
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 12px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__range {
	height: 4px;
	margin: 18px 0 20px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__range::before {
	border-radius: 999px;
	background: var(--altyn-filter-border);
	opacity: 1;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__range .range-bar {
	border-radius: 999px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	border: 0;
	background: transparent;
	box-shadow: none;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]::-moz-range-track {
	height: 4px;
	border: 0;
	background: transparent;
	box-shadow: none;
}

/* Separate pseudo-element rules so Firefox and WebKit both keep their styles. */
:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]::-webkit-slider-thumb {
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	margin-top: -8px;
	border: 2px solid var(--altyn-filter-primary);
	border-radius: 50%;
	background: var(--altyn-filter-surface);
	box-shadow: 0 1px 3px rgb(7 64 79 / 12%);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]::-moz-range-thumb {
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	border: 2px solid var(--altyn-filter-primary);
	border-radius: 50%;
	background: var(--altyn-filter-surface);
	box-shadow: 0 1px 3px rgb(7 64 79 / 12%);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]:is(:hover, :focus-visible, :active)::-webkit-slider-thumb {
	border-color: var(--ast-global-color-1, #F47F2D);
	box-shadow: 0 0 0 4px rgb(244 127 45 / 14%);
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider input[type="range"]:is(:hover, :focus-visible, :active)::-moz-range-thumb {
	border-color: var(--ast-global-color-1, #F47F2D);
	box-shadow: 0 0 0 4px rgb(244 127 45 / 14%);
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider .text {
	position: relative;
	min-width: 0;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider .text::before {
	position: absolute;
	top: 50%;
	left: 12px;
	transform: translateY(-50%);
	color: #8B8F95;
	font-size: 12px;
	line-height: 16px;
	pointer-events: none;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__left.text::before {
	content: "От";
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider__right.text::before {
	content: "До";
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider .text input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 11px 10px 11px 34px;
	border: 1px solid var(--altyn-filter-border);
	border-radius: var(--altyn-filter-radius);
	background: var(--altyn-filter-surface);
	box-shadow: none;
	color: var(--altyn-filter-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
	transition: border-color 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider .text input[type="text"]:hover {
	border-color: #AEB5BD;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-price-slider .text input[type="text"]:focus {
	border-color: var(--ast-global-color-1, #F47F2D);
	outline: 2px solid rgb(244 127 45 / 20%);
	outline-offset: 2px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters :is(.wp-block-woocommerce-product-filter-attribute, .wp-block-woocommerce-product-filter-taxonomy) {
	min-width: 0;
	padding-top: 12px;
	border-top: 1px solid var(--altyn-filter-border);
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters :is(.wp-block-woocommerce-product-filter-attribute, .wp-block-woocommerce-product-filter-taxonomy)>.wp-block-heading {
	/* The block editor writes heading margins inline. */
	margin: 0 0 8px !important;
	color: var(--altyn-filter-heading);
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
	word-break: normal;
	overflow-wrap: anywhere;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__label {
	box-sizing: border-box;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	min-height: 32px;
	margin: 0;
	padding: 6px 4px;
	border-radius: var(--altyn-filter-radius);
	color: var(--altyn-filter-text);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__label:hover {
	background: var(--altyn-filter-hover);
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__label:has(input:checked) {
	color: var(--altyn-filter-primary);
	font-weight: 500;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__text-wrapper {
	flex: 1;
	min-width: 0;
	font-size: inherit;
	line-height: inherit;
	word-break: normal;
	overflow-wrap: anywhere;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__input-wrapper {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin-top: 1px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__input-wrapper::before {
	display: none;
}

:is(.tax-product_cat, .tax-product_brand) #secondary input.wc-block-product-filter-checkbox-list__input {
	box-sizing: border-box;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	border-radius: var(--altyn-filter-radius);
	transition: background-color 160ms ease, border-color 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary input.wc-block-product-filter-checkbox-list__input:checked {
	border-color: #f47f2d;
	background-color: #f47f2d;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__mark {
	width: 18px;
	height: 18px;
	padding: 4px;
	color: #FFFFFF;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__count {
	color: #69727E;
	font-size: 12px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-removable-chips__items {
	gap: 6px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-removable-chips__items .wc-block-product-filter-removable-chips__item {
	min-width: 0;
	margin: 0;
	padding: 4px 8px;
	border-color: var(--altyn-filter-border);
	border-radius: 4px;
	background: var(--altyn-filter-hover);
	color: var(--altyn-filter-primary);
	font-size: 12px;
	line-height: 16px;
	gap: 4px;
}

.wc-block-product-filter-removable-chips__remove-icon {
	width: 20px !important;
	height: 20px !important;
}

.wp-block-button__link[data-wp-on--click="actions.removeAll"] {
	font-size: 14px !important;
	line-height: 20px !important;
	border: none !important;
	color: #f47f2d !important;
	background-color: rgba(244, 127, 45, .1) !important;
	padding: 8px 12px !important;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-removable-chips__label {
	min-width: 0;
	overflow-wrap: anywhere;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-removable-chips__remove {
	flex-shrink: 0;
}

:is(.tax-product_cat, .tax-product_brand) #secondary :is(.wc-block-product-filter-checkbox-list__show-more-button, .wc-block-product-filter__show-more) {
	width: auto;
	min-height: 32px;
	margin-top: 8px;
	padding: 4px 2px;
	border: 0;
	background: transparent;
	color: var(--altyn-filter-primary);
	box-shadow: none;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 20px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary :is(.wc-block-product-filter-checkbox-list__show-more-button, .wc-block-product-filter__show-more):is(:hover, :focus-visible) {
	background: transparent;
	color: var(--altyn-filter-primary);
	text-decoration: none;
}

:is(.tax-product_cat, .tax-product_brand) #secondary :is(.wc-block-product-filters__open-overlay, .wc-block-product-filters__apply, .altyn-product-filters__apply) {
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--altyn-filter-primary);
	border-radius: var(--altyn-filter-radius);
	background: var(--altyn-filter-primary);
	color: #FFFFFF;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	transition: background-color 160ms ease;
}

:is(.tax-product_cat, .tax-product_brand) #secondary :is(.wc-block-product-filters__open-overlay, .wc-block-product-filters__apply, .altyn-product-filters__apply):hover:not(:disabled) {
	background: #003945;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .altyn-product-filters__apply {
	width: 100%;
	margin-top: 8px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .altyn-product-filters__apply:disabled {
	opacity: .55;
	cursor: not-allowed;
}

@media (max-width: 600px) {
	:is(.tax-product_cat, .tax-product_brand) #secondary .altyn-product-filters__apply {
		display: none;
	}
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__close-overlay {
	min-height: 44px;
	gap: 4px;
	padding: 8px 12px;
	border: 0;
	border-radius: var(--altyn-filter-radius);
	background: transparent;
	color: var(--altyn-filter-text);
	font-size: 14px;
}

:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__close-overlay:hover {
	background: var(--altyn-filter-hover);
}

:is(.tax-product_cat, .tax-product_brand) #secondary :is(input.wc-block-product-filter-checkbox-list__input, button):focus-visible {
	outline: 2px solid var(--altyn-filter-primary) !important;
	outline-offset: 3px;
}

@media (min-width: 1141px) {
	:is(.tax-product_cat, .tax-product_brand):is(.ast-left-sidebar, .ast-right-sidebar) #secondary {
		box-sizing: border-box;
		width: 264px;
	}

	:is(.tax-product_cat, .tax-product_brand):is(.ast-left-sidebar, .ast-right-sidebar) #primary {
		box-sizing: border-box;
		width: calc(100% - 264px);
	}

	:is(.tax-product_cat, .tax-product_brand).ast-left-sidebar #secondary {
		padding-right: 16px;
	}

	:is(.tax-product_cat, .tax-product_brand).ast-left-sidebar #primary {
		padding-left: 32px;
	}

	:is(.tax-product_cat, .tax-product_brand).ast-right-sidebar #secondary {
		padding-left: 24px;
	}

	:is(.tax-product_cat, .tax-product_brand).ast-right-sidebar #primary {
		padding-right: 32px;
	}
}

@media (max-width: 1140px) {
	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__label {
		min-height: 44px;
		padding-top: 12px;
		padding-bottom: 12px;
	}
}

@media (max-width: 600px) {
	:is(.tax-product_cat, .tax-product_brand) #content>.ast-container {
		position: relative;
	}

	/* Keep WooCommerce's filter drawer mounted for its mobile overlay button. */
	:is(.tax-product_cat, .tax-product_brand) #content #secondary {
		position: absolute;
		top: 0;
		left: -10000px;
		width: 0;
		height: 0;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible;
		border: 0 !important;
	}
}

@media (max-width: 568px) {
	:is(.tax-product_cat, .tax-product_brand):is(.ast-left-sidebar, .ast-right-sidebar) #content>.ast-container {
		display: flex;
		flex-direction: column;
	}

	:is(.tax-product_cat, .tax-product_brand):is(.ast-left-sidebar, .ast-right-sidebar) #secondary {
		order: -1;
		margin: 24px 0 0;
	}

	:is(.tax-product_cat, .tax-product_brand):is(.ast-left-sidebar, .ast-right-sidebar) #primary {
		margin-top: 8px;
	}

	.site-content section.ast-archive-description {
		margin-bottom: 16px;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__open-overlay {
		width: 100%;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__overlay-content {
		padding: 16px 20px 24px;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__overlay-header {
		padding: 8px 16px;
		border-bottom: 1px solid var(--altyn-filter-border);
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__overlay-footer {
		padding: 16px 20px;
		border-top: 1px solid var(--altyn-filter-border);
		box-shadow: none;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filter-checkbox-list__label {
		box-sizing: border-box;
		display: flex;
		align-items: flex-start;
		gap: 8px;
		width: 100%;
		min-height: auto;
		margin: 0;
		padding: 8px 8px;
		padding-top: 6px;
		padding-bottom: 6px;
		font-size: 14px;
		font-weight: 400;
		line-height: 20px;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters__close-overlay {
		min-height: 32px;
		gap: 0px;
		padding: 8px 12px;
		border: 0;
		background: #F3F4F4;
		color: #171F2C;
	}

	:is(.tax-product_cat, .tax-product_brand) #secondary .wc-block-product-filters :is(.wp-block-woocommerce-product-filter-attribute, .wp-block-woocommerce-product-filter-taxonomy) {
		padding-top: 8px;
		border-top: 1px solid #E8E9EA;
	}

	:where(.wc-block-product-filters) .wc-block-product-filters__close-overlay span,
	:where(.wc-block-product-filters) .wc-block-product-filters__open-overlay span {
		padding: 0 !important;
	}
}