/* ==========================================================================
   Heaven — catalogue (shop, categories, product search, wishlist)
   ========================================================================== */

/* 20px to the toolbar: the chip row itself carries 6px of block padding. */
.hv-listing__subnav { margin-bottom: 14px; }

.hv-toolbar {
	position: sticky;
	top: var(--header-h);
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-inline: calc(var(--gutter) * -1);
	padding: 8px var(--gutter);
	background: rgba(251, 248, 244, .96);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-block: 1px solid var(--c-line);
	transition: top var(--t) var(--ease);
}

.hv-header.is-hidden ~ .hv-main .hv-toolbar { top: 0; }

.hv-toolbar__btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--c-ink);
	border-radius: var(--r-pill);
	font: 600 .875rem/1 var(--f-sans);
}

.hv-toolbar__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--r-pill);
	background: var(--c-ink);
	color: #fff;
	font-size: .6875rem;
}

.hv-toolbar__count:empty { display: none; }

/* The count takes the room left between «Фільтри» and the sorting. When «80 товарів» does not fit there (a narrow
   phone, a filter count on the button) it is hidden rather than cut: the zero-width ::before holds the first line,
   text that does not fit beside it wraps to the second line, and the second line is clipped. The sheet's
   «Показати 80 товарів» button still tells the number. */
.hv-toolbar__total {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	height: 1.3em;
	overflow: hidden;
	font-size: var(--fs-sm);
	line-height: 1.3;
	color: var(--c-ink-2);
	text-align: center;
}

.hv-toolbar__total::before { content: ''; width: 0; height: 1.3em; }

.hv-toolbar__sort { display: flex; align-items: center; gap: 8px; }

/* A <select> is as wide as its longest option, so every option shows in full; it gives way only on the
   narrowest phones. */
.hv-toolbar__select {
	flex: 0 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 0 34px 0 14px;
	border: 1px solid var(--c-line);
	border-radius: var(--r-pill);
	background: var(--c-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231F1B18' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat;
	font: 600 .875rem/1 var(--f-sans);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

/* Phones and tablets: no strip. «Фільтри» and the sorting are two glass buttons that float under the header's
   capsule while the products scroll beneath them; the gap between the two lets taps through to the products.
   Once they float, the count between them goes — words straight on a photo cannot be read (.is-stuck, shop.js). */
@media (max-width: 1023.98px) {
	.hv-toolbar {
		top: calc(var(--header-h) + 8px);
		padding-block: 0;
		background: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		border: 0;
		pointer-events: none;
	}

	.hv-header.is-hidden ~ .hv-main .hv-toolbar { top: 8px; }

	.hv-toolbar__btn,
	.hv-toolbar__sort {
		position: relative;
		border-radius: var(--r-pill);
		background: var(--glass);
		-webkit-backdrop-filter: var(--glass-filter);
		backdrop-filter: var(--glass-filter);
		box-shadow: var(--glass-shadow);
		pointer-events: auto;
	}

	.hv-toolbar__btn { border-color: transparent; }
	.hv-toolbar__btn:active { transform: scale(.96); }
	.hv-toolbar__select { border-color: transparent; background-color: transparent; }
	.hv-toolbar__total { transition: opacity var(--t-fast); }
	.hv-toolbar.is-stuck .hv-toolbar__total { opacity: 0; }
}

.hv-listing__active:empty { display: none; }

.hv-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-top: 14px;
}

.hv-active__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 0 10px 0 14px;
	border-radius: var(--r-pill);
	background: var(--c-sand);
	font: 500 .8125rem/1 var(--f-sans);
}

.hv-active__chip:hover { background: var(--c-line); }

.hv-active__reset {
	min-height: 36px;
	padding: 0 8px;
	display: inline-flex;
	align-items: center;
	font: 600 .8125rem/1 var(--f-sans);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hv-listing { padding-bottom: calc(var(--section-y) * .8); }
.hv-listing__layout { padding-top: 20px; }
.hv-listing__aside { display: none; }
html:not(.js) .hv-listing__aside { display: block; margin-bottom: 24px; }

[data-hv-part="grid"] { transition: opacity var(--t-fast); }
[data-hv-part="grid"].is-loading { opacity: .4; pointer-events: none; }

@media (min-width: 1024px) {
	.hv-toolbar {
		position: static;
		margin-inline: 0;
		padding: 0 0 4px;
		border: 0;
		background: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.hv-toolbar__total { text-align: left; }

	.hv-listing__layout {
		display: grid;
		grid-template-columns: 248px minmax(0, 1fr);
		gap: 48px;
		align-items: start;
	}

	.hv-listing__aside {
		display: block;
		position: sticky;
		top: calc(var(--header-h) + 20px);
		max-height: calc(100dvh - var(--header-h) - 40px);
		overflow-y: auto;
		scrollbar-width: thin;
		padding-right: 6px;
	}
}

/* ---------- Facets ---------- */
.hv-facet { border-bottom: 1px solid var(--c-line); }
.hv-facet:first-child { border-top: 1px solid var(--c-line); }

.hv-facet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	font: 600 .9375rem/1.2 var(--f-sans);
	cursor: pointer;
	list-style: none;
}

.hv-facet__head::-webkit-details-marker { display: none; }
.hv-facet__head .hv-icon { transition: transform var(--t) var(--ease); }
.hv-facet[open] .hv-facet__head .hv-icon { transform: rotate(180deg); }

.hv-facet__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	margin-left: 8px;
	padding: 0 5px;
	border-radius: var(--r-pill);
	background: var(--c-ink);
	color: #fff;
	font-size: .6875rem;
	vertical-align: 2px;
}

.hv-facet__body { padding-bottom: 16px; }

.hv-facet__body--size,
.hv-facet__body--color {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hv-facet__item {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	font-size: .9375rem;
}

.hv-facet__body--size .hv-facet__item {
	justify-content: center;
	min-width: 52px;
	padding: 0 14px;
	border: 1px solid var(--c-line);
	border-radius: var(--r-pill);
	background: var(--c-surface);
	font-weight: 600;
	font-size: .875rem;
	transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}

.hv-facet__body--size .hv-facet__item:hover { border-color: var(--c-ink); }

.hv-facet__body--size .hv-facet__item.is-active {
	border-color: var(--c-ink);
	background: var(--c-ink);
	color: #fff;
}

.hv-facet__body--color .hv-facet__item {
	min-height: 40px;
	padding: 0 14px 0 6px;
	border: 1px solid var(--c-line);
	border-radius: var(--r-pill);
	background: var(--c-surface);
	font-size: .8125rem;
}

.hv-facet__body--color .hv-facet__item.is-active { border-color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-ink); }

.hv-facet__swatch {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--swatch);
	box-shadow: inset 0 0 0 1px rgba(31, 27, 24, .14);
}

.hv-facet__box {
	flex: none;
	width: 22px;
	height: 22px;
	border: 1.5px solid var(--c-ink-3);
	border-radius: 6px;
	background: var(--c-surface);
	transition: background-color var(--t-fast), border-color var(--t-fast);
}

.hv-facet__item.is-active .hv-facet__box {
	border-color: var(--c-ink);
	background: var(--c-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/14px no-repeat;
}

.hv-facet__price {
	display: grid;
	grid-template-columns: 1fr auto 1fr auto;
	align-items: center;
	gap: 8px;
}

.hv-facet__price .hv-input { min-height: 44px; padding: 8px 12px; }
.hv-facet--toggles { padding: 8px 0; }

.hv-filters__foot {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
}

.hv-filters__foot .hv-btn { white-space: nowrap; }

/* In the sheet the title already has a line under it: no second line above the first filter. */
.hv-drawer__body[data-hv-filters-sheet] { padding-top: 4px; }
.hv-drawer__body[data-hv-filters-sheet] .hv-facet:first-child { border-top: 0; }

/* ---------- Empty state, SEO block ---------- */
.hv-empty {
	display: grid;
	justify-items: center;
	gap: 12px;
	padding: 56px 12px;
	text-align: center;
}

.hv-seo { display: grid; gap: 40px; }
.hv-seo__text { color: var(--c-ink-2); }
.hv-seo__text h2 { color: var(--c-ink); }
.hv-seo__text .hv-prose > h2:first-child { margin-top: 0; }
.hv-seo__faq h2 { margin-bottom: 16px; }

@media (min-width: 900px) {
	.hv-seo { grid-template-columns: 1fr 1fr; gap: 64px; }
}

.hv-wishlist__grid { margin-top: 8px; }

.hv-toolbar__total { white-space: nowrap; font-size: .8125rem; }

@media (max-width: 400px) {
	.hv-toolbar { gap: 8px; }
	.hv-toolbar__btn { padding: 0 12px; }
	.hv-toolbar__select { padding: 0 30px 0 12px; }
}
