/*
 * Subcategories of a product category on najlepsiemobily.sk (inc/subcats.php): an overview list –
 * photo, name, products · in stock, "až −X %", "od X €". Two columns on desktop, one on phones;
 * catalog.js folds a long list (.is-folded) and shows "Zobraziť všetky (N)".
 *
 * nav.cat-subcats.nm-subcats > ul.nm-subcats__list > li > a.nm-subcats__row (span.is-out when nothing is in stock)
 */

.nm-subcats__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 var(--nd-sp-24, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--nd-c-line);
}
.nm-subcats__list > li {
	border-bottom: 1px solid var(--nd-c-line);
}
.nm-subcats__list.is-folded > li:nth-child(n + 7) {
	display: none;
}

.nm-subcats__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 6px;
	color: var(--nd-c-ink);
	text-decoration: none;
	transition: background .15s;
}
a.nm-subcats__row:hover {
	background: var(--nd-c-brand-tint);
	color: var(--nd-c-ink);
}
.nm-subcats__row.is-out {
	opacity: .5;
}
.nm-subcats__img {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 48px;
	color: var(--nd-c-brand);
	font-weight: var(--nd-fw-bold);
}
.nm-subcats__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.nm-subcats__main {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}
.nm-subcats__name {
	overflow: hidden;
	font-size: var(--nd-fs-16, 16px);
	font-weight: var(--nd-fw-semibold);
	text-overflow: ellipsis;
	white-space: nowrap;
}
.nm-subcats__meta {
	white-space: nowrap;
	color: var(--nd-c-muted);
	font-size: 13px;
}
.nm-subcats__discount {
	flex: none;
	padding: 2px 8px;
	border-radius: var(--nd-radius-pill);
	background: #fde8eb;
	color: #c4122f;
	font-size: 12px;
	font-weight: var(--nd-fw-bold);
	white-space: nowrap;
}
.nm-subcats__price {
	flex: none;
	min-width: 72px;
	font-size: 17px;
	font-weight: 800;
	text-align: right;
	white-space: nowrap;
}
.nm-subcats__price small {
	color: var(--nd-c-muted);
	font-size: 12px;
	font-weight: 500;
}
.nm-subcats__row .cat-icon {
	flex: none;
	color: var(--nd-c-brand);
}

/* "Zobraziť všetky (N)": a pill under the list; on desktop only when more than 6 rows are folded. */
.nm-subcats .nm-subcats__more {
	width: auto;
	margin: var(--nd-sp-10, 10px) auto 0;
	padding: 8px 18px;
	border-color: var(--nd-c-line);
	border-radius: var(--nd-radius-pill);
}
.nm-subcats .nm-subcats__more.is-desktop:not([hidden]) {
	display: flex;
}

/* Tablets and phones: only "56 skladom" – with the product count the line runs into the discount. */
@media (max-width: 1100px) {
	.nm-subcats__count {
		display: none;
	}
}

@media (max-width: 640px) {
	.nm-subcats__list {
		grid-template-columns: minmax(0, 1fr);
	}
	.nm-subcats__list.is-folded > li:nth-child(n + 5) {
		display: none;
	}
	.nm-subcats .nm-subcats__more:not([hidden]) {
		display: flex;
	}
	.nm-subcats__row {
		gap: 10px;
		padding: 8px 2px;
	}
	.nm-subcats__name {
		font-size: 15px;
	}
	.nm-subcats__price {
		min-width: 0;
		font-size: 15px;
	}
}
