/* ===== Elestil — recursive category tree ===== */

.elestil-cat-tree {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Всяко следващо ниво — отместване навътре */
.elestil-cat-tree__children {
	list-style: none;
	margin: 0;
	padding-left: 18px;
}

.elestil-cat-tree__row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 4px;
	border-radius: 7px;
	transition: background-color 0.15s ease;
}
.elestil-cat-tree__row:hover {
	background-color: #f3f3f0;
}

.elestil-cat-tree__toggle {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: #8a8a86;
	cursor: pointer;
	padding: 0;
	margin: 0;
}
.elestil-cat-tree__toggle svg {
	transition: transform 0.18s ease;
}
.elestil-cat-tree__item.is-open > .elestil-cat-tree__row .elestil-cat-tree__toggle svg {
	transform: rotate(90deg);
}
.elestil-cat-tree__toggle--empty {
	cursor: default;
}

.elestil-cat-tree__link {
	flex: 1 1 auto;
	min-width: 0;
	text-decoration: none;
	color: #333;
	line-height: 1.35;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.elestil-cat-tree__link:hover {
	color: #0f76ba;
}

.elestil-cat-tree__count {
	flex: 0 0 auto;
	font-size: 12px;
	color: #9a9a95;
	white-space: nowrap;
}

/* Активна категория */
.elestil-cat-tree__item.is-active > .elestil-cat-tree__row {
	background-color: #e7f1f9;
}
.elestil-cat-tree__item.is-active > .elestil-cat-tree__row .elestil-cat-tree__link {
	color: #0f76ba;
	font-weight: 700;
}

/* Mobile: по-големи тап-зони, без hover */
@media (max-width: 782px) {
	.elestil-cat-tree__children {
		padding-left: 14px;
	}
	.elestil-cat-tree__row {
		padding: 11px 6px;
		gap: 8px;
	}
	.elestil-cat-tree__toggle {
		width: 36px;
		height: 36px;
	}
	.elestil-cat-tree__toggle svg {
		width: 16px;
		height: 16px;
	}
}

/* Подкатегории (списък на категорийните страници) */
.elestil-subcats { margin-bottom: 1.5rem; }
.elestil-subcats__title { font-size: 1.05rem; margin: 0 0 0.75rem; }
.elestil-subcats__grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px;
}
.elestil-subcats__item a {
	display: flex; flex-direction: column; gap: 3px;
	padding: 13px 15px; background: #fff;
	border: 1px solid var(--wp--preset--color--border, #e4e4e1); border-radius: 10px;
	text-decoration: none; color: #333;
	transition: transform .18s ease, box-shadow .18s ease;
}
.elestil-subcats__item a:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(16,24,40,.20); }
.elestil-subcats__name { font-weight: 600; line-height: 1.3; }
.elestil-subcats__count { font-size: 12px; color: #999; }
