/**
 * Onset Kategoria v2 — listing kategorii / marki.
 * Wymaga home-v2.css (zmienne, kafelki) i product-v2.css (okruszki).
 */

/* ---- nagłówek ---- */

.cv2-head {
	padding: 0 var(--hv2-pad);
}

.cv2 .cv2-crumbs {
	padding-left: 0;
	padding-right: 0;
}

.cv2-head__row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-top: clamp(4px, 1vw, 12px);
}

.hv2 .cv2-title {
	font-size: clamp(30px, 3.6vw, 52px);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -0.04em;
}

.hv2 .cv2-count {
	color: var(--hv2-soft);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.hv2 .cv2-lead {
	max-width: 62ch;
	margin-top: 12px;
	color: var(--hv2-soft);
	font-size: 15px;
	line-height: 1.6;
}

/* podkategorie — zwykłe linki tekstowe, przewijane w poziomie na telefonie */

.cv2-subcats {
	margin: clamp(20px, 2.4vw, 32px) calc(var(--hv2-pad) * -1) 0;
	padding: 0 var(--hv2-pad);
	overflow-x: auto;
	scrollbar-width: none;
}

.cv2-subcats::-webkit-scrollbar {
	display: none;
}

.hv2 .cv2-subcats ul {
	display: flex;
	gap: 28px;
	width: max-content;
	margin: 0;
	padding: 0;
}

.cv2-subcats a {
	display: inline-block;
	padding: 6px 0 8px;
	border-bottom: 1px solid transparent;
	color: var(--hv2-soft);
	font-size: 14px;
	white-space: nowrap;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.cv2-subcats a:hover {
	color: var(--hv2-ink);
}

.cv2-subcats a.is-current {
	border-bottom-color: var(--hv2-ink);
	color: var(--hv2-ink);
}

/* ---- pasek narzędzi (przyklejony pod headerem) ---- */

.cv2-bar {
	position: sticky;
	top: var(--hv2-head-h);
	z-index: 20;
	margin-top: clamp(16px, 2vw, 24px);
	border-top: 1px solid var(--hv2-line);
	border-bottom: 1px solid var(--hv2-line);
	background: rgba(251, 250, 248, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.admin-bar .cv2-bar {
	top: calc(var(--hv2-head-h) + 32px);
}

.cv2-bar__inner {
	display: flex;
	align-items: center;
	gap: 12px 20px;
	min-height: 60px;
	padding: 8px var(--hv2-pad);
}

.hv2 .cv2-filter-btn {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 16px 0 14px;
	border: 1px solid var(--hv2-line-2);
	border-radius: 999px;
	background: transparent;
	color: var(--hv2-ink);
	font-family: var(--hv2-font);
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.hv2 .cv2-filter-btn:hover {
	border-color: var(--hv2-ink);
	background: transparent;
	color: var(--hv2-ink);
}

.cv2-filter-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
}

.cv2-filter-btn__n {
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--hv2-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 20px;
	text-align: center;
}

/* aktywne filtry */

.hv2 ul.cv2-active {
	display: flex;
	flex: 1;
	flex-wrap: nowrap;
	gap: 6px;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

.cv2-active::-webkit-scrollbar {
	display: none;
}

.cv2-active a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 12px;
	border-radius: 999px;
	background: var(--hv2-paper-2);
	color: var(--hv2-ink);
	font-size: 13px;
	white-space: nowrap;
}

.cv2-active a span {
	color: var(--hv2-soft);
	font-size: 15px;
}

.cv2-active a:hover {
	background: var(--hv2-line);
}

.hv2 .cv2-active .cv2-active__clear {
	background: transparent;
	color: var(--hv2-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* sortowanie — rozwijane menu z linkami (działa bez JS) */

.cv2-sort {
	position: relative;
	flex: none;
	margin-left: auto;
}

.cv2-sort summary {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 4px;
	color: var(--hv2-ink);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	list-style: none;
	white-space: nowrap;
}

.cv2-sort summary::-webkit-details-marker {
	display: none;
}

.cv2-sort__label {
	color: var(--hv2-soft);
	font-weight: 400;
}

@media (max-width: 560px) {
	.cv2-sort__label { display: none; }
}

.cv2-sort summary svg {
	width: 11px;
	height: 7px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	transition: transform 0.25s var(--hv2-ease);
}

.cv2-sort[open] summary svg {
	transform: rotate(180deg);
}

.hv2 .cv2-sort__list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 5;
	min-width: 240px;
	margin: 0;
	padding: 6px;
	border: 1px solid var(--hv2-line-2);
	border-radius: var(--hv2-radius);
	background: #fff;
	box-shadow: 0 18px 40px -18px rgba(17, 17, 17, 0.25);
}

.cv2-sort__list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 42px;
	padding: 0 12px;
	border-radius: 3px;
	color: var(--hv2-ink);
	font-size: 14px;
}

.cv2-sort__list a:hover {
	background: var(--hv2-paper-2);
}

.cv2-sort__list a[aria-current="true"] {
	font-weight: 600;
}

.cv2-sort__list a[aria-current="true"]::after {
	content: "";
	width: 10px;
	height: 6px;
	border-left: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-45deg) translateY(-2px);
}

/* ---- siatka produktów ---- */

.cv2-list {
	padding: clamp(24px, 3vw, 40px) var(--hv2-pad) 0;
}

.cv2-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(28px, 3vw, 44px) var(--hv2-gap);
}

@media (min-width: 760px) {
	.cv2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
	.cv2-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cv2-grid__item.is-new {
	animation: cv2-in 0.5s var(--hv2-ease) both;
}

@keyframes cv2-in {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* „Pokaż więcej” */

.cv2-more {
	display: grid;
	justify-items: center;
	gap: 16px;
	margin-top: clamp(40px, 5vw, 64px);
}

.hv2 .cv2-more__info {
	color: var(--hv2-soft);
	font-size: 13px;
}

.hv2 a.cv2-more__btn {
	min-width: 220px;
}

.hv2 a.cv2-more__btn.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* pusto */

.cv2-empty {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: clamp(48px, 8vw, 120px) 0;
	text-align: center;
}

.hv2 .cv2-empty__title {
	font-size: 20px;
	font-weight: 500;
}

.hv2 .cv2-empty__lead {
	margin-bottom: 14px;
	color: var(--hv2-soft);
	font-size: 14px;
}

/* wyszukiwanie bez wyników */

.cv2-search {
	display: flex;
	gap: 8px;
	width: min(100%, 520px);
	margin-top: 6px;
}

.hv2 .cv2-search input[type="search"],
.hv2 .cv2-search input[type="search"]:focus {
	flex: 1;
	min-width: 0;
	height: 50px;
	padding: 0 18px;
	border: 1px solid var(--hv2-line-2);
	border-radius: 999px;
	background: #fff;
	color: var(--hv2-ink);
	font-family: var(--hv2-font);
	font-size: 16px;
	outline: none;
}

.hv2 .cv2-search input[type="search"]:focus {
	border-color: var(--hv2-ink);
}

.hv2 .cv2-search button {
	height: 50px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--hv2-ink);
	color: #fff;
	font-family: var(--hv2-font);
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	cursor: pointer;
}

.hv2 ul.cv2-empty__hints {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 16px 0 0;
	padding: 0;
}

.cv2-empty__hints a {
	display: inline-block;
	padding: 7px 13px;
	border-radius: 999px;
	background: var(--hv2-paper-2);
	color: var(--hv2-ink);
	font-size: 13px;
}

/* opis kategorii pod listą */

.cv2-about {
	max-width: 860px;
	margin: clamp(48px, 5.5vw, 88px) auto 0;
	padding: 0 var(--hv2-pad);
}

.cv2-about details {
	border-top: 1px solid var(--hv2-line);
	border-bottom: 1px solid var(--hv2-line);
}

.cv2-about summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	list-style: none;
}

.cv2-about summary::-webkit-details-marker {
	display: none;
}

.cv2-about summary span {
	position: relative;
	width: 12px;
	height: 12px;
}

.cv2-about summary span::before,
.cv2-about summary span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	height: 1.5px;
	margin-top: -0.75px;
	background: var(--hv2-ink);
	transition: transform 0.3s var(--hv2-ease);
}

.cv2-about summary span::after {
	transform: rotate(90deg);
}

.cv2-about details[open] summary span::after {
	transform: rotate(0);
}

.cv2-about__body {
	padding-bottom: 22px;
	color: var(--hv2-soft);
	font-size: 14px;
	line-height: 1.7;
}

.cv2-about__body p + p {
	margin-top: 10px;
}

.cv2 {
	padding-bottom: clamp(48px, 5.5vw, 88px);
}

/* ---- panel filtrów (z prawej) ---- */

.cv2-filters {
	position: fixed;
	inset: 0;
	z-index: 90;
	font-family: var(--hv2-font);
}

.cv2-filters[hidden] {
	display: none;
}

.cv2-filters::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.35);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.cv2-filters.is-open::before {
	opacity: 1;
}

.cv2-filters__panel {
	position: absolute;
	inset: 0 0 0 auto;
	display: flex;
	flex-direction: column;
	width: min(100vw, 440px);
	margin: 0;
	background: var(--hv2-paper);
	transform: translateX(100%);
	transition: transform 0.42s var(--hv2-ease);
}

.cv2-filters.is-open .cv2-filters__panel {
	transform: none;
}

.cv2-filters__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 22px;
	border-bottom: 1px solid var(--hv2-line);
}

.hv2 .cv2-filters__top p {
	font-size: 16px;
	font-weight: 500;
}

.hv2 .cv2-filters__top button {
	width: 40px;
	height: 40px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--hv2-ink);
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
}

.cv2-filters__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 22px;
}

.cv2-fset {
	margin: 0;
	padding: 22px 0;
	border: 0;
	border-bottom: 1px solid var(--hv2-line);
}

.cv2-fset:last-child {
	border-bottom: 0;
}

.cv2-fset legend {
	float: left;
	width: 100%;
	margin: 0 0 14px;
	padding: 0;
	color: var(--hv2-ink);
	font-size: 14px;
	font-weight: 500;
}

.cv2-fset legend + * {
	clear: both;
}

.hv2 .cv2-fset__note {
	margin-top: 12px;
	color: var(--hv2-mute);
	font-size: 12px;
}

/* rozmiary — siatka przełączników */

.cv2-sizes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 6px;
}

.cv2-size {
	position: relative;
	cursor: pointer;
}

.cv2-size input,
.cv2-checks input,
.cv2-toggle input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cv2-size span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	border-radius: var(--hv2-radius);
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--hv2-line-2);
	color: var(--hv2-ink);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	transition: box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cv2-size:hover span {
	box-shadow: inset 0 0 0 1px var(--hv2-ink);
}

.cv2-size input:checked + span {
	background: var(--hv2-ink);
	box-shadow: inset 0 0 0 1px var(--hv2-ink);
	color: #fff;
}

.cv2-size input:focus-visible + span {
	outline: 2px solid var(--hv2-ink);
	outline-offset: 2px;
}

/* listy z checkboxami */

.hv2 ul.cv2-checks {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
}

.hv2 ul.cv2-checks--cols {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
}

.cv2-checks label {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 38px;
	color: var(--hv2-ink);
	font-size: 14px;
	cursor: pointer;
}

.cv2-checks label span {
	flex: 1;
	min-width: 0;
}

.cv2-checks label span::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 12px;
	border: 1px solid var(--hv2-line-2);
	border-radius: 3px;
	background: #fff center / 11px no-repeat;
	vertical-align: -4px;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cv2-checks input:checked + span::before {
	border-color: var(--hv2-ink);
	background-color: var(--hv2-ink);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5l3.5 3.5L11 1' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E");
}

.cv2-checks input:focus-visible + span::before {
	outline: 2px solid var(--hv2-ink);
	outline-offset: 2px;
}

.cv2-checks em {
	color: var(--hv2-mute);
	font-size: 12px;
	font-style: normal;
}

/* cena */

.cv2-price {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.cv2-price label {
	display: grid;
	gap: 6px;
	color: var(--hv2-soft);
	font-size: 12px;
}

.hv2 .cv2-price input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--hv2-line-2);
	border-radius: var(--hv2-radius);
	background: #fff;
	color: var(--hv2-ink);
	font-family: var(--hv2-font);
	font-size: 16px;
	box-shadow: none;
	-moz-appearance: textfield;
}

.hv2 .cv2-price input:focus {
	border-color: var(--hv2-ink);
	outline: none;
}

/* przełącznik „tylko dostępne” */

.cv2-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	color: var(--hv2-ink);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.cv2-toggle i {
	position: relative;
	flex: none;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: var(--hv2-line-2);
	transition: background 0.2s ease;
}

.cv2-toggle i::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.25s var(--hv2-ease);
}

.cv2-toggle input:checked ~ i {
	background: var(--hv2-ink);
}

.cv2-toggle input:checked ~ i::after {
	transform: translateX(18px);
}

.cv2-toggle input:focus-visible ~ i {
	outline: 2px solid var(--hv2-ink);
	outline-offset: 2px;
}

/* stopka panelu */

.cv2-filters__foot {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--hv2-line);
}

.hv2 .cv2-filters__clear {
	color: var(--hv2-soft);
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hv2 .cv2-filters__apply {
	flex: 1;
	height: 52px;
	border: 0;
	border-radius: 999px;
	background: var(--hv2-ink);
	color: #fff;
	font-family: var(--hv2-font);
	font-size: 15px;
	font-weight: 500;
	text-transform: none;
	cursor: pointer;
	transition: background 0.2s ease;
}

.hv2 .cv2-filters__apply:hover {
	background: var(--hv2-ink-2);
}

/* Filtry (2026-11-17): dłuższe nazwy zawijają się obok pola wyboru, nie pod nim. */
.cv2-checks label span {
	position: relative;
	padding-left: 30px;
	line-height: 1.4;
}

.cv2-checks label span::before {
	position: absolute;
	top: 1px;
	left: 0;
	margin-right: 0;
}

/* Kolor: reszta pozycji pod „Pokaż wszystkie kolory (N)”. */
.cv2-more-opts {
	margin-top: 6px;
}

.cv2-more-opts > summary {
	display: inline-block;
	padding: 6px 0;
	color: var(--hv2-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	list-style: none;
}

.cv2-more-opts > summary::-webkit-details-marker {
	display: none;
}

.cv2-more-opts[open] > summary {
	display: none;
}

/* Wyszukiwanie bez wyników i bez aktywnych filtrów: bez paska „Filtry / sortowanie” (nie ma czego filtrować). */
.cv2:has(.cv2-empty):not(:has(.cv2-active)) .cv2-bar {
	display: none;
}
