/* Мобільний рубрикатор — окремо від меню сторінок (Головна, Кошик…) */
@media (max-width: 921px) {
	.ecoprod-mobile-catalog-nav {
		display: none;
		padding: 0.5rem 0 0.75rem;
		border-bottom: 1px solid var(--ast-border-color, #e5e7eb);
	}

	body.ecoprod-catalog-open .ecoprod-mobile-catalog-nav {
		display: block;
	}

	body.ecoprod-catalog-open .ast-mobile-header-content .ast-builder-menu-mobile {
		display: none !important;
	}

	.ecoprod-rubricator-title {
		margin: 0 0 0.5rem;
		padding: 0 1rem;
		font-size: 0.75rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: #6b7280;
	}

	.ecoprod-rubricator-list {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.ecoprod-rubricator-list .menu-link {
		display: block;
		padding: 0.65rem 1rem;
		font-size: 16px;
		font-weight: 600;
		color: inherit;
		text-decoration: none;
		border-bottom: 1px solid var(--ast-border-color, #f3f4f6);
		touch-action: manipulation;
	}

	.ecoprod-rubricator-list .menu-item:last-child .menu-link {
		border-bottom: none;
	}

	.ecoprod-mobile-catalog-trigger {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		margin-right: 0.5rem;
		padding: 0.35rem 0.65rem;
		border: 1px solid var(--ast-global-color-0, #046c4e);
		border-radius: 9999px;
		background: #fff;
		color: var(--ast-global-color-0, #046c4e);
		font-size: 16px;
		font-weight: 700;
		line-height: 1.2;
		cursor: pointer;
		white-space: nowrap;
		touch-action: manipulation;
	}

	body.ecoprod-has-catalog-bar .vca-mobile-fab {
		bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px)) !important;
	}
}

@media (min-width: 922px) {
	.ecoprod-mobile-catalog-nav,
	.ecoprod-mobile-catalog-trigger {
		display: none !important;
	}

	#ast-hf-menu-1 > li.ecoprod-catalog-menu-slot,
	.main-header-menu > li.ecoprod-catalog-menu-slot {
		position: relative;
		list-style: none;
	}

	.ecoprod-astra-catalog-link-hidden {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}

	.ecoprod-desktop-catalog-wrap:not(.ecoprod-mounted) {
		position: absolute !important;
		left: -9999px !important;
		top: auto !important;
		opacity: 0 !important;
		pointer-events: none !important;
	}

	.ecoprod-desktop-catalog-wrap.ecoprod-mounted {
		position: relative;
		display: inline-flex;
		align-items: center;
		margin-right: 0.5rem;
		vertical-align: middle;
		opacity: 1;
		pointer-events: auto;
	}

	.ecoprod-desktop-catalog-trigger,
	.ecoprod-mobile-catalog-trigger {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		padding: 0.4rem 0.75rem;
		border: 1px solid var(--ast-global-color-0, #046c4e);
		border-radius: 9999px;
		background: #fff;
		color: var(--ast-global-color-0, #046c4e);
		font-size: 16px;
		font-weight: 700;
		line-height: 1.2;
		cursor: pointer;
		white-space: nowrap;
		font-family: inherit;
	}

	.ecoprod-desktop-catalog-panel {
		display: none !important;
		min-width: min(320px, 92vw);
		max-width: 360px;
		max-height: min(70vh, 520px);
		overflow-x: hidden;
		overflow-y: auto;
		background: #fff;
		border: 1px solid var(--ast-border-color, #e5e7eb);
		border-radius: 0.5rem;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
		padding: 0.5rem 0 0.75rem;
	}

	.ecoprod-desktop-catalog-panel.is-open,
	body.ecoprod-desktop-catalog-open .ecoprod-desktop-catalog-panel.is-open,
	body.ecoprod-desktop-catalog-open #ecoprod-desktop-catalog-panel {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	.ecoprod-desktop-catalog-panel .ecoprod-rubricator-title {
		margin: 0 0 0.5rem;
		padding: 0 1rem;
		font-size: 0.75rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: #6b7280;
	}

	.ecoprod-desktop-catalog-panel .ecoprod-rubricator-list .menu-link {
		display: block;
		padding: 0.55rem 1rem;
		font-weight: 600;
		text-decoration: none;
		border-bottom: 1px solid var(--ast-border-color, #f3f4f6);
	}

	.ecoprod-desktop-catalog-panel .ecoprod-rubricator-list .menu-item:last-child .menu-link {
		border-bottom: none;
	}

	#ast-hf-menu-1 a.menu-link[href="#"],
	.main-header-menu a.menu-link[href="#"] {
		cursor: pointer;
	}
}

@media (max-width: 921px) {
	.ecoprod-desktop-catalog-wrap {
		display: none !important;
	}
}

/* Горизонтальна смуга підрубрик над сіткою товарів (усі ширини) */
.ecoprod-subcat-bar {
	margin: 0 0 1rem;
	padding: 0;
	width: 100%;
}

.ecoprod-subcat-bar__scroll {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.5rem;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 0.25rem 0 0.5rem;
	touch-action: pan-x manipulation;
}

.ecoprod-subcat-bar__scroll::-webkit-scrollbar {
	display: none;
}

.ecoprod-subcat-chip {
	flex: 0 0 auto;
	display: inline-block;
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--ast-border-color, #d1d5db);
	border-radius: 9999px;
	background: #fff;
	color: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	white-space: nowrap;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ecoprod-subcat-chip:hover {
	border-color: var(--ast-global-color-0, #046c4e);
	color: var(--ast-global-color-0, #046c4e);
}

.ecoprod-subcat-chip.is-active {
	border-color: var(--ast-global-color-0, #046c4e);
	background: var(--ast-global-color-0, #046c4e);
	color: #fff;
}

.woocommerce .ecoprod-subcat-bar + .woocommerce-result-count,
.woocommerce .ecoprod-subcat-bar + .woocommerce-ordering {
	margin-top: 0;
}

@media (max-width: 921px) {
	.ecoprod-subcat-bar {
		margin-left: -0.5rem;
		margin-right: -0.5rem;
		padding-left: 0.5rem;
		padding-right: 0.5rem;
	}
}

/*
 * Сітка каталогу: однакова висота карток (ПК вузьке вікно, планшет, телефон).
 * Причина зі скріна: назви в 1–2 рядки — кнопки «Додати в кошик» на різній висоті.
 */
.woocommerce ul.products {
	align-items: stretch;
}

.woocommerce ul.products li.product {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	height: 100%;
}

.woocommerce ul.products li.product .astra-shop-summary-wrap,
.woocommerce ul.products li.product .ast-shop-summary-wrap {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
	min-height: 2.8em;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 0.35em;
}

.woocommerce ul.products li.product .price {
	margin-bottom: 0.5em;
}

.woocommerce ul.products li.product a.button,
.woocommerce ul.products li.product .button.add_to_cart_button,
.woocommerce ul.products li.product .ast-loop-product__link + .button {
	margin-top: auto;
}
