/*
 * Collection (product archive): head, pills, toolbar, filters (inline column
 * at 1024 px+, slide-in panel below), chips, grid, promo tile, load more.
 * Layouts: .njf-cl--line (contained), .njf-cl--style (full width), .njf-cl--feature (banner + line).
 */

.njf-cl {
	--njf-cols: 4;
	--njf-gap: 14px;
	--njf-cl-fg: var(--njf-fg, #111);
	--njf-cl-bg: var(--njf-bg, #fff);
	--njf-cl-line: color-mix(in srgb, var(--njf-cl-fg) 18%, transparent);
	--njf-cl-muted: color-mix(in srgb, var(--njf-cl-fg) 62%, transparent);
	--njf-cl-side: 280px;

	width: 100%;
	margin: 0 auto;
	padding: 0 16px 64px;
	color: var(--njf-cl-fg);
}

@media (min-width: 750px) {
	.njf-cl {
		padding: 0 28px 80px;
	}
}

.njf-cl--line,
.njf-cl--feature {
	max-width: 1536px;
}

.njf-cl.is-loading .njf-cl__main,
.njf-cl.is-loading .njf-cl__side-body {
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

/* ---- Head ---- */
.njf-cl .njf-cl__head {
	padding: 32px 0 20px;
	text-align: center;
}

.njf-cl .njf-cl__title {
	margin: 0 0 8px;
	color: inherit;
	font-size: clamp(28px, 3.4vw, 48px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.njf-cl--style .njf-cl__title {
	font-size: 24px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.njf-cl .njf-cl__desc {
	max-width: 720px;
	margin: 0 auto 8px;
	color: var(--njf-cl-muted);
	font-size: 14px;
	line-height: 1.6;
}

.njf-cl .njf-cl__desc p {
	margin: 0;
}

.njf-cl .njf-cl__pills ul {
	display: flex;
	gap: 8px;
	justify-content: safe center;
	margin: 16px 0 0;
	padding: 0 0 4px;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

@media (max-width: 749px) {
	.njf-cl .njf-cl__pills ul {
		justify-content: flex-start;
	}
}

.njf-cl .njf-cl__pill {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 16px;
	border: 1px solid var(--njf-cl-line);
	border-radius: 9999px;
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.njf-cl .njf-cl__pill:hover,
.njf-cl .njf-cl__pill:focus-visible {
	border-color: currentcolor;
	color: inherit;
}

.njf-cl .njf-cl__pill.is-current {
	border-color: var(--njf-cl-fg);
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
}

/* ---- Feature banner ---- */
.njf-cl .njf-cl__banner {
	position: relative;
	display: grid;
	min-height: clamp(280px, 42vw, 560px);
	margin: 0 -16px;
	overflow: hidden;
	background: var(--njf-surface, #111);
	color: #fff;
	place-items: center;
	text-align: center;
}

@media (min-width: 750px) {
	.njf-cl .njf-cl__banner {
		margin: 0 -28px;
	}
}

.njf-cl .njf-cl__banner-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.njf-cl .njf-cl__banner::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(0 0 0 / 55%), rgb(0 0 0 / 10%) 60%);
	content: "";
}

.njf-cl .njf-cl__banner-body {
	position: relative;
	z-index: 1;
	max-width: 640px;
	padding: 32px 20px;
}

.njf-cl .njf-cl__banner-title {
	margin: 0;
	color: inherit;
	font-size: clamp(32px, 5vw, 64px);
	font-weight: 700;
	line-height: 1.05;
	text-transform: uppercase;
}

.njf-cl .njf-cl__banner-title img {
	width: auto;
	max-height: 120px;
}

.njf-cl .njf-cl__banner-text {
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.6;
}

/* ---- Toolbar ---- */
.njf-cl .njf-cl__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-top: 1px solid var(--njf-cl-line);
	border-bottom: 1px solid var(--njf-cl-line);
	margin-bottom: 24px;
}

.njf-cl .njf-cl__filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--njf-cl-line);
	border-radius: 9999px;
	background: transparent;
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
}

.njf-cl .njf-cl__filter-btn:hover,
.njf-cl .njf-cl__filter-btn:focus-visible {
	border-color: currentcolor;
	background: transparent;
	color: inherit;
}

.njf-cl .njf-cl__filter-btn svg {
	width: 18px;
	height: 18px;
}

.njf-cl .njf-cl__filter-count {
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9999px;
	background: var(--njf-accent, currentcolor);
	color: #fff;
	font-size: 10px;
	line-height: 18px;
	text-align: center;
}

.njf-cl .njf-cl__count {
	margin: 0;
	white-space: nowrap;
	color: var(--njf-cl-muted);
	font-size: 13px;
}

@media (max-width: 749px) {
	.njf-cl .njf-cl__bar {
		gap: 8px;
	}

	.njf-cl .njf-cl__filter-btn {
		padding: 0 12px;
	}

	/* The count stays for screen readers; the panel's button shows it too. */
	.njf-cl .njf-cl__count {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.njf-cl .njf-cl__view .njf-cl__view-btn {
		padding: 0 10px;
	}
}

.njf-cl .njf-cl__count:focus {
	outline: none;
}

.njf-cl .njf-cl__view {
	display: inline-flex;
	margin-left: auto;
	padding: 3px;
	border-radius: 9999px;
	background: color-mix(in srgb, var(--njf-cl-fg) 10%, transparent);
}

.njf-cl .njf-cl__view .njf-cl__view-btn {
	min-height: 32px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: var(--njf-cl-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
}

.njf-cl .njf-cl__view .njf-cl__view-btn:hover,
.njf-cl .njf-cl__view .njf-cl__view-btn:focus-visible {
	background: transparent;
	color: var(--njf-cl-fg);
}

.njf-cl .njf-cl__view .njf-cl__view-btn.is-active {
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
}

/* ---- Body: filter column + results ---- */
.njf-cl .njf-cl__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
}

@media (min-width: 1024px) {
	.njf-cl.is-filters-open .njf-cl__body {
		grid-template-columns: var(--njf-cl-side) minmax(0, 1fr);
	}

	.njf-cl:not(.is-filters-open) .njf-cl__side {
		display: none;
	}

	.njf-cl .njf-cl__side-head,
	.njf-cl .njf-cl__side-foot,
	.njf-cl .njf-cl__scrim {
		display: none;
	}

	.njf-cl .njf-cl__side {
		position: sticky;
		top: calc(var(--njf-announcement-height, 0px) + var(--wp-admin--admin-bar--height, 0px) + 16px);
		align-self: start;
		max-height: calc(100vh - 120px);
		overflow-y: auto;
		scrollbar-width: thin;
	}
}

@media (max-width: 1023px) {
	.njf-cl .njf-cl__side {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 100001;
		display: flex;
		flex-direction: column;
		width: min(380px, 92vw);
		background: var(--njf-cl-bg);
		color: var(--njf-cl-fg);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}

	.njf-cl.is-panel-open .njf-cl__side {
		transform: none;
		visibility: visible;
		transition: transform 0.3s ease;
	}

	.njf-cl .njf-cl__scrim {
		position: fixed;
		inset: 0;
		z-index: 100000;
		background: rgb(0 0 0 / 60%);
	}

	.njf-cl .njf-cl__scrim[hidden] {
		display: none;
	}

	.njf-cl .njf-cl__side-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: calc(var(--wp-admin--admin-bar--height, 0px) + 14px) 20px 14px;
		border-bottom: 1px solid var(--njf-cl-line);
	}

	.njf-cl .njf-cl__side-title {
		margin: 0;
		font-size: 14px;
		font-weight: 700;
		letter-spacing: 0.1em;
		text-transform: uppercase;
	}

	.njf-cl .njf-cl__side-body {
		flex: 1;
		padding: 8px 20px 20px;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.njf-cl .njf-cl__side-foot {
		padding: 14px 20px 20px;
		border-top: 1px solid var(--njf-cl-line);
	}
}

html.njf-no-scroll {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.njf-cl .njf-cl__side {
		transition: none;
	}
}

.njf-cl .njf-cl__side-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.njf-cl .njf-cl__side-close:hover,
.njf-cl .njf-cl__side-close:focus-visible {
	background: var(--njf-cl-line);
	color: inherit;
}

.njf-cl .njf-cl__side-close svg {
	width: 20px;
	height: 20px;
}

.njf-cl .njf-cl__apply {
	width: 100%;
	min-height: 48px;
	margin: 0;
	border: 1px solid var(--njf-cl-fg);
	border-radius: 0;
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	cursor: pointer;
}

.njf-cl .njf-cl__apply:hover,
.njf-cl .njf-cl__apply:focus-visible {
	border-color: var(--njf-accent, var(--njf-cl-fg));
	background: var(--njf-accent, var(--njf-cl-fg));
	color: #fff;
}

/* ---- Filter groups ---- */
.njf-cl .njf-cl__group {
	padding: 16px 0;
	border-bottom: 1px solid var(--njf-cl-line);
}

.njf-cl .njf-cl__group-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 12px;
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}

.njf-cl summary.njf-cl__group-title::-webkit-details-marker {
	display: none;
}

.njf-cl summary.njf-cl__group-title::after {
	font-size: 16px;
	font-weight: 400;
	content: "+";
}

.njf-cl details[open] > summary.njf-cl__group-title::after {
	content: "\2212";
}

.njf-cl details:not([open]) > summary.njf-cl__group-title {
	margin-bottom: 0;
}

.njf-cl .njf-cl__group-count {
	color: var(--njf-cl-muted);
	font-weight: 400;
}

.njf-cl .njf-cl__sort .njf-cl__select {
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--njf-cl-line);
	border-radius: 0;
	background: var(--njf-cl-bg);
	color: inherit;
	font-size: 14px;
}

.njf-cl .njf-cl__options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.njf-cl .njf-cl__opt {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none;
}

.njf-cl .njf-cl__opt:hover,
.njf-cl .njf-cl__opt:focus-visible {
	color: inherit;
}

.njf-cl .njf-cl__opt:hover .njf-cl__opt-label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.njf-cl .njf-cl__check {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1px solid color-mix(in srgb, var(--njf-cl-fg) 50%, transparent);
}

.njf-cl .njf-cl__opt.is-on .njf-cl__check {
	border-color: var(--njf-cl-fg);
	background: var(--njf-cl-fg);
}

.njf-cl .njf-cl__opt.is-on .njf-cl__check::after {
	position: absolute;
	top: 2px;
	left: 5px;
	width: 5px;
	height: 9px;
	border: solid var(--njf-cl-bg);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	content: "";
}

/* Colour swatches. */
.njf-cl .njf-cl__group--swatch .njf-cl__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 14px 8px;
}

.njf-cl .njf-cl__group--swatch .njf-cl__opt {
	flex-direction: column;
	gap: 6px;
	font-size: 11px;
	text-align: center;
}

.njf-cl .njf-cl__swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--njf-cl-fg) 12%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--njf-cl-fg) 30%, transparent);
}

.njf-cl .njf-cl__opt.is-on .njf-cl__swatch {
	box-shadow: 0 0 0 2px var(--njf-cl-bg), 0 0 0 3px var(--njf-cl-fg);
}

/* Size boxes. */
.njf-cl .njf-cl__group--box .njf-cl__options {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}

.njf-cl .njf-cl__group--box .njf-cl__opt {
	justify-content: center;
	width: 100%;
	min-height: 40px;
	padding: 0 4px;
	border: 1px solid var(--njf-cl-line);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.njf-cl .njf-cl__group--box .njf-cl__opt:hover {
	border-color: currentcolor;
}

.njf-cl .njf-cl__group--box .njf-cl__opt.is-on {
	border-color: var(--njf-cl-fg);
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
}

.njf-cl .njf-cl__group--box .njf-cl__opt:hover .njf-cl__opt-label {
	text-decoration: none;
}

/* Price. */
.njf-cl .njf-cl__price {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 10px;
	align-items: center;
	margin: 0;
}

.njf-cl .njf-cl__price label {
	font-size: 13px;
}

.njf-cl .njf-cl__price input[type] {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--njf-cl-line);
	border-radius: 0;
	background: var(--njf-cl-bg);
	color: inherit;
	font-size: 14px;
}

.njf-cl .njf-cl__price .njf-cl__go,
.njf-cl .njf-cl__sort .njf-cl__go {
	grid-column: 1 / -1;
	min-height: 40px;
	margin: 4px 0 0;
	border: 1px solid var(--njf-cl-fg);
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}

.njf-cl .njf-cl__price .njf-cl__go:hover,
.njf-cl .njf-cl__price .njf-cl__go:focus-visible {
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
}

/* ---- Chips ---- */
.njf-cl .njf-cl__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.njf-cl .njf-cl__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--njf-cl-line);
	border-radius: 9999px;
	color: inherit;
	font-size: 12px;
	text-decoration: none;
}

.njf-cl .njf-cl__chip:hover,
.njf-cl .njf-cl__chip:focus-visible {
	border-color: currentcolor;
	color: inherit;
}

.njf-cl .njf-cl__chip--clear {
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Grid ---- */
.njf-cl .njf-cl__grid {
	display: grid;
	grid-template-columns: repeat(var(--njf-cols), minmax(0, 1fr));
	gap: 32px var(--njf-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.njf-cl .njf-cl__promo {
	grid-column: span 2;
	list-style: none;
}

.njf-cl .njf-cl__promo-inner {
	position: relative;
	display: flex;
	align-items: flex-end;
	height: 100%;
	min-height: 320px;
	overflow: hidden;
	background: var(--njf-surface, #111);
	color: #fff;
	text-decoration: none;
}

.njf-cl .njf-cl__promo-inner:hover,
.njf-cl .njf-cl__promo-inner:focus-visible {
	color: #fff;
}

.njf-cl .njf-cl__promo-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.njf-cl .njf-cl__promo-inner:hover .njf-cl__promo-img {
	transform: scale(1.03);
}

.njf-cl .njf-cl__promo-inner::after {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgb(0 0 0 / 60%), transparent 55%);
	content: "";
}

.njf-cl .njf-cl__promo-body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 24px;
}

.njf-cl .njf-cl__promo-eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.njf-cl .njf-cl__promo-title {
	font-size: clamp(20px, 2vw, 28px);
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
}

.njf-cl .njf-cl__promo-text {
	font-size: 14px;
	line-height: 1.5;
}

/* ---- More / pages ---- */
.njf-cl .njf-cl__more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin-top: 48px;
}

.njf-cl .njf-cl__more-status {
	margin: 0;
	color: var(--njf-cl-muted);
	font-size: 13px;
}

.njf-cl .njf-cl__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 220px;
	min-height: 48px;
	padding: 0 28px;
	border: 1.5px solid var(--njf-cl-fg);
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-decoration: none;
	text-transform: uppercase;
}

.njf-cl .njf-cl__more:hover,
.njf-cl .njf-cl__more:focus-visible {
	border-color: var(--njf-accent, var(--njf-cl-fg));
	background: var(--njf-accent, var(--njf-cl-fg));
	color: #fff;
}

.njf-cl .njf-cl__more[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

.njf-cl .njf-cl__pages {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 48px;
}

.njf-cl .njf-cl__pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	border: 1px solid var(--njf-cl-line);
	color: inherit;
	text-decoration: none;
}

.njf-cl .njf-cl__pages .page-numbers.current {
	border-color: var(--njf-cl-fg);
	background: var(--njf-cl-fg);
	color: var(--njf-cl-bg);
}

.njf-cl .woocommerce-info,
.njf-cl .woocommerce-no-products-found {
	margin: 24px 0;
}

.njf-cl .njf-cl__more-opts {
	margin-top: 12px;
}

.njf-cl .njf-cl__more-opts > summary {
	display: inline-block;
	margin-bottom: 12px;
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	list-style: none;
}

.njf-cl .njf-cl__more-opts > summary::-webkit-details-marker {
	display: none;
}

.njf-cl .njf-cl__more-opts[open] > summary {
	display: none;
}
