/*
 * Паркети България - каталог (категория, магазин, таг, промоции). Задача B2.2.
 * Макет: makets/final/kategoria.html → секции 1-3 + Mobile + Състояния (инвентар 1, kategoria).
 * Продуктовата карта, бутоните, пагинацията и празното състояние са в base.css - тук са само разликите.
 * Mobile вариантът е при ≤1024px (допускане 9).
 */

/* ================================================================ 1. Заглавна зона */

.pb-cat-hero {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px var(--pb-gutter) 14px;
	background: var(--pb-bg-2);
}

.pb-cat-hero--solo {
	padding-bottom: 36px;
}

.pb-cat-hero__row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 40px;
}

.pb-cat-hero__text {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.pb-cat-hero__title {
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-size: 48px;
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -0.03em;
	overflow-wrap: anywhere;
}

.pb-cat-hero__lead {
	max-width: 640px;
	color: var(--pb-text-2);
	font-size: 17px;
	line-height: 1.55;
}

.pb-cat-hero__lead > * + * {
	margin-top: 0.6em;
}

.pb-cat-hero__count {
	flex: 0 0 auto;
	color: var(--pb-text-2);
	font-size: 15px;
	line-height: 1.4;
	white-space: nowrap;
}

.pb-cat-hero__count strong {
	color: var(--pb-ink);
	font-weight: 700;
}

/* Чипове под H1 (desktop - продължение на сивата зона). */
.pb-cat-chips {
	padding: 0 var(--pb-gutter) 36px;
	background: var(--pb-bg-2);
}

.pb-cat-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pb-cat-chips__item {
	flex: 0 0 auto;
	margin: 0;
}

.pb-cat-chips__chip {
	display: inline-flex;
	align-items: center;
	padding: 8px 15px;
	border: 1px solid var(--pb-green-border);
	border-radius: var(--pb-radius-pill);
	background: var(--pb-bg);
	color: var(--pb-green);
	font-family: var(--pb-font-head);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
}

.pb-cat-chips__chip:hover {
	border-color: var(--pb-green);
	background: var(--pb-green-light);
	color: var(--pb-green-dark);
}

.pb-cat-chips__chip.is-active {
	border-color: var(--pb-green);
	background: var(--pb-green);
	color: var(--pb-bg);
}

/* ================================================================ 2. Плочки на подкатегориите */

.pb-subcats {
	padding: 32px var(--pb-gutter) 0;
}

.pb-subcats__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pb-subcats__item {
	margin: 0;
	min-width: 0;
}

.pb-subcats__tile {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 16px 12px 12px;
	border: 1px solid var(--pb-line);
	border-radius: var(--pb-radius);
	background: var(--pb-bg);
	color: var(--pb-ink);
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.pb-subcats__tile:hover {
	border-color: var(--pb-green);
	color: var(--pb-ink);
}

.pb-subcats__media {
	flex: 0 0 auto;
	overflow: hidden;
	border-radius: var(--pb-radius-s);
	background: var(--pb-bg-2);
}

.pb-subcats__img {
	display: block;
	width: 120px;
	height: 96px;
	object-fit: cover;
}

.pb-subcats__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.pb-subcats__name {
	font-family: var(--pb-font-head);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.pb-subcats__from {
	color: var(--pb-text-2);
	font-size: 14px;
	line-height: 1.4;
}

.pb-subcats__from strong {
	color: var(--pb-ink);
}

.pb-subcats__arrow {
	flex: 0 0 auto;
	color: var(--pb-green);
	font-size: 20px;
	line-height: 1;
}

@media (max-width: 900px) {
	.pb-subcats__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.pb-subcats__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}
}

/* ================================================================ 3. Каталог: сайдбар + мрежа */

.pb-cat-main {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	padding: 32px var(--pb-gutter) 64px;
}

.pb-cat-filters {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.pb-filters {
	margin: 0;
}

.pb-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--pb-line-2);
}

.pb-filters__title {
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.4;
}

.pb-filters__clear {
	color: var(--pb-green);
	font-family: var(--pb-font-head);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.pb-filters__clear:hover {
	color: var(--pb-green-dark);
	text-decoration: underline;
}

.pb-filters__group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 0;
	border-bottom: 1px solid var(--pb-line-2);
}

.pb-filters__legend {
	margin-bottom: 4px;
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
}

/* Ред 32px = 21px текст + 2 × 5.5px (без min-height на текстов елемент - PLAN 5.2). */
.pb-filters__row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-block: 5.5px;
	color: var(--pb-ink);
	font-size: 15px;
	line-height: 1.4;
	cursor: pointer;
}

.pb-filters__row input {
	flex: 0 0 auto;
	inline-size: 18px;
	block-size: 18px;
	margin: 0;
	accent-color: var(--pb-green);
	cursor: pointer;
}

.pb-filters__name {
	flex: 1 1 auto;
	min-width: 0;
}

.pb-filters__count {
	flex: 0 0 auto;
	color: var(--pb-muted-3);
	font-size: 13px;
}

.pb-filters__row.is-empty {
	color: var(--pb-muted-3);
	cursor: default;
}

.pb-filters__row.is-empty input {
	cursor: default;
}

.pb-filters__row--promo input {
	accent-color: var(--pb-red);
}

.pb-filters__row--promo .pb-filters__name {
	color: var(--pb-red);
	font-weight: 500;
}

.pb-filters__range-vals {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--pb-text-2);
	font-size: 14px;
	line-height: 1.4;
}

.pb-filters__range-vals strong {
	color: var(--pb-ink);
}

.pb-filters__range {
	display: block;
	inline-size: 100%;
	margin: 4px 0 0;
	accent-color: var(--pb-green);
	cursor: pointer;
}

/* Тъмна кутия „Помощ при избора" (само desktop). */
.pb-cat-help {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 20px;
	padding: 22px;
	background: var(--pb-brown);
	color: var(--pb-bg);
}

.pb-cat-help__label {
	color: var(--pb-beige);
	font-size: 13px;
	line-height: 1.4;
}

.pb-cat-help__phone {
	color: var(--pb-bg);
	font-family: var(--pb-font-head);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	word-break: break-word;
}

.pb-cat-help__phone:hover {
	color: var(--pb-beige-text);
}

/* Над мрежата: активни филтри вляво, сортиране вдясно. */
.pb-cat-results {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
	scroll-margin-top: 16px;
}

.pb-cat-results .woocommerce-notices-wrapper:empty {
	display: none;
}

.pb-cat-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.pb-cat-active {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pb-cat-active li {
	margin: 0;
}

.pb-cat-active__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border: 1px solid var(--pb-green);
	border-radius: var(--pb-radius-pill);
	background: var(--pb-green-light);
	color: var(--pb-green);
	font-family: var(--pb-font-head);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

.pb-cat-active__chip:hover {
	background: var(--pb-bg);
	color: var(--pb-green-dark);
}

/* Сортиране: „Подреди:" + select 44px (20px ред + 2 × 10.5px + 3px рамка). */
.pb-sort {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 10px;
	margin: 0;
}

.pb-sort__label {
	color: var(--pb-text-2);
	font-size: 14px;
	line-height: 1.4;
	white-space: nowrap;
}

.pb-sort__select {
	min-width: 0;
	margin: 0;
	padding: 10.5px 36px 10.5px 12px;
	border: 1.5px solid var(--pb-line);
	border-radius: var(--pb-radius-s);
	background-color: var(--pb-bg);
	background-image: linear-gradient(45deg, transparent 50%, var(--pb-ink) 50%), linear-gradient(135deg, var(--pb-ink) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	color: var(--pb-ink);
	font: 500 15px/20px var(--pb-font-body);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.pb-sort__select:focus-visible {
	border-color: var(--pb-green);
	outline: 2px solid var(--pb-green);
	outline-offset: 2px;
}

/* Празно състояние (базата е .pb-empty в base.css): padding 48px, заглавие 700 18px. */
.pb-cat-empty {
	gap: 12px;
	padding: 48px;
}

.pb-cat-empty__title {
	font-size: 18px;
	font-weight: 700;
}

.pb-cat-empty__btn {
	padding: 12px 20px;
}

.pb-cat-more-wrap:empty {
	display: none;
}

.pb-cat-pagination {
	margin-top: 8px;
}

.pb-cat-more {
	display: flex;
	font-size: 15px;
}

/* Докато fetch-ът върви. */
.pb-cat.is-loading .pb-cat-results {
	opacity: 0.55;
	transition: opacity 0.15s ease;
}

/* ================================================================ 4. SEO блок (term meta pb_seo_blok) */

.pb-seo {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 56px;
	align-items: start;
	padding: 56px var(--pb-gutter);
	background: var(--pb-bg-2);
}

.pb-seo__text {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pb-seo h2 {
	color: var(--pb-ink);
	font-family: var(--pb-font-head);
	font-size: 28px;
	font-weight: 900;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.pb-seo p {
	color: var(--pb-text);
	font-size: 16px;
	line-height: 1.7;
}

.pb-seo__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pb-seo__row {
	display: grid;
	grid-template-columns: 100px minmax(0, 1fr);
	gap: 16px;
	align-items: center;
	padding: 16px 20px;
	border-radius: var(--pb-radius);
	background: var(--pb-bg);
}

.pb-seo__label {
	color: var(--pb-green);
	font-family: var(--pb-font-head);
	font-size: 20px;
	font-weight: 900;
	line-height: 1.2;
}

.pb-seo .pb-seo__row p {
	color: var(--pb-text-2);
	font-size: 15px;
	line-height: 1.5;
}

/* ================================================================ 5. Mobile (≤1024) */

.pb-cat-bar {
	display: none;
}

@media (max-width: 1024px) {
	.pb-cat-hero {
		gap: 10px;
		padding: 14px var(--pb-gutter) 18px;
	}

	.pb-cat-hero .pb-breadcrumb {
		font-size: 12px;
	}

	.pb-cat-hero__row {
		display: block;
	}

	.pb-cat-hero__text {
		gap: 0;
	}

	.pb-cat-hero__title {
		font-size: 30px;
		letter-spacing: -0.02em;
	}

	.pb-cat-hero__count {
		margin-top: 10px;
		font-size: 14px;
		white-space: normal;
	}

	.pb-cat-hero__count strong {
		color: inherit;
		font-weight: 400;
	}

	/* Чиповете - отделен бял ред с хоризонтален скрол. */
	.pb-cat-chips {
		padding: 14px 0 0 var(--pb-gutter);
		background: var(--pb-bg);
	}

	.pb-cat-chips__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-right: var(--pb-gutter);
		scrollbar-width: none;
	}

	.pb-cat-chips__list::-webkit-scrollbar {
		display: none;
	}

	.pb-cat-chips__chip {
		padding: 9px 13px;
	}

	.pb-subcats {
		padding-top: 14px;
	}

	.pb-subcats__tile {
		gap: 12px;
		padding: 10px 12px 10px 10px;
	}

	.pb-subcats__img {
		width: 72px;
		height: 60px;
	}

	.pb-subcats__name {
		font-size: 15px;
	}

	.pb-subcats__from {
		font-size: 13px;
	}

	.pb-subcats__from strong {
		color: inherit;
		font-weight: 400;
	}

	.pb-cat-main {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 14px 0 0;
	}

	/* Sticky лента: „Филтри (N)" + сортиране (2 колони). */
	.pb-cat-bar {
		position: sticky;
		top: 0;
		z-index: 5;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		padding: 12px var(--pb-gutter);
		border-bottom: 1px solid var(--pb-line-2);
		background: var(--pb-bg);
	}

	.pb-cat-bar__toggle {
		min-width: 0;
		padding-inline: 8px;
	}

	.pb-cat-bar__toggle[aria-expanded="true"],
	.pb-cat-bar__toggle[aria-expanded="true"]:hover {
		border-color: var(--pb-green);
		background: var(--pb-green);
		color: var(--pb-bg);
	}

	.pb-sort--bar {
		display: grid;
		min-width: 0;
	}

	.pb-sort--bar .pb-sort__select {
		padding-right: 30px;
		text-overflow: ellipsis;
	}

	/* Сгъваем панел под лентата. */
	.pb-cat-filters {
		position: static;
		display: none;
		padding: 4px var(--pb-gutter) 16px;
		border-bottom: 1px solid var(--pb-line-2);
		background: var(--pb-bg-3);
	}

	.pb-cat-filters.is-open {
		display: flex;
	}

	/* Ред 40px = 21px + 2 × 9.5px. */
	.pb-filters__row {
		padding-block: 9.5px;
	}

	.pb-filters__foot {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		padding-top: 14px;
	}

	.pb-filters__reset {
		border-color: var(--pb-line);
		background: var(--pb-bg);
		color: var(--pb-ink);
		font-size: 14px;
	}

	.pb-filters__reset:hover {
		border-color: var(--pb-line-3);
		background: var(--pb-bg-2);
		color: var(--pb-ink);
	}

	.pb-filters__show {
		font-size: 14px;
	}

	.pb-cat-results {
		gap: 14px;
		padding: 14px var(--pb-gutter) 24px;
		scroll-margin-top: 72px;
	}

	.pb-cat-empty {
		padding: 24px 16px;
	}

	.pb-seo {
		display: flex;
		flex-direction: column;
		gap: 10px;
		padding: 24px var(--pb-gutter) 32px;
	}

	.pb-seo__text {
		gap: 10px;
	}

	.pb-seo h2 {
		font-size: 20px;
	}

	.pb-seo p {
		font-size: 14px;
		line-height: 1.6;
	}

	.pb-seo__rows {
		display: none;
	}
}
