/* NZ Product Groups — Figma "04 · Product groups" + NZ/Product group card. */
.nz-pg {
	--nz-pg-w: 264px;
	--nz-pg-h: 300px;
	--nz-pg-active-w: 360px;
	--nz-pg-active-h: 420px;
	--nz-pg-gap: 24px;
	--nz-pg-bleed: 0px;
	position: relative;
	min-width: 0;
}

/* Rail runs to the right edge of the screen (section clips it). 100vw
   includes the scrollbar, so the section must clip — see nz-clip-x. */
.nz-pg-bleed-yes .nz-pg {
	--nz-pg-bleed: max(0px, calc((100vw - 100%) / 2));
}

.nz-pg__viewport {
	margin-inline-end: calc(-1 * var(--nz-pg-bleed));
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.nz-pg__viewport::-webkit-scrollbar {
	display: none;
}

.nz-pg .nz-pg__rail {
	display: flex;
	align-items: flex-start;
	gap: var(--nz-pg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Trailing space after the last card = page margin, never the bleed. */
.nz-pg .nz-pg__rail::after {
	content: "";
	flex: 0 0 max(1px, calc(var(--nz-page-margin) - var(--nz-pg-gap)));
}

.nz-pg .nz-pg__card {
	flex: 0 0 var(--nz-pg-w);
	width: var(--nz-pg-w);
	margin: 0;
	padding: 0;
	transition: flex-basis 0.25s ease, width 0.25s ease;
}

.nz-pg .nz-pg__card.is-active {
	flex-basis: var(--nz-pg-active-w);
	width: var(--nz-pg-active-w);
}

.nz-pg .nz-pg__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.nz-pg .nz-pg__media {
	height: var(--nz-pg-h);
	overflow: hidden;
	border-radius: 12px;
	background-color: var(--nz-color-surface-subtle);
	transition: height 0.25s ease;
}

.nz-pg .nz-pg__card.is-active .nz-pg__media {
	height: var(--nz-pg-active-h);
}

.nz-pg .nz-pg__media img.nz-pg__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: filter 0.25s ease;
}

/* Figma: vibrance -100 %, contrast +1.5 % on the inactive cards. */
.nz-pg-gray-yes .nz-pg__card:not(.is-active) img.nz-pg__img {
	filter: grayscale(1) contrast(1.015);
}

.nz-pg .nz-pg__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 16px;
}

.nz-pg .nz-pg__num,
.nz-pg .nz-pg__title,
.nz-pg .nz-pg__text,
.nz-pg .nz-pg__count {
	margin: 0;
}

.nz-pg .nz-pg__num {
	font-family: var(--nz-font-family);
	font-size: var(--nz-font-size-caption);
	font-weight: 500;
	line-height: var(--nz-line-height-caption);
	color: var(--nz-color-text-muted);
}

.nz-pg .nz-pg__title {
	font-family: var(--nz-font-display);
	font-size: var(--nz-font-size-h4);
	font-weight: 600;
	line-height: var(--nz-line-height-h4);
	color: var(--nz-color-text-primary);
}

.nz-pg .nz-pg__text {
	font-family: var(--nz-font-family);
	font-size: var(--nz-font-size-small);
	line-height: var(--nz-line-height-small);
	color: var(--nz-color-text-muted);
}

.nz-pg .nz-pg__link:hover .nz-pg__title,
.nz-pg .nz-pg__link:focus-visible .nz-pg__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Arrows + counter */
.nz-pg .nz-pg__nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 64px;
}

.nz-pg .nz-pg__btn,
.nz-pg .nz-pg__btn:hover,
.nz-pg .nz-pg__btn:focus,
.nz-pg .nz-pg__btn:active {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--nz-color-border-strong);
	border-radius: 50%;
	background-color: transparent;
	box-shadow: none;
	color: var(--nz-color-text-brand);
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.nz-pg .nz-pg__btn:hover {
	background-color: var(--nz-color-surface-subtle);
}

.nz-pg .nz-pg__btn:focus-visible {
	outline: none;
	box-shadow: var(--nz-focus-ring, var(--nz-focus-ring-light));
}

.nz-pg .nz-pg__btn[aria-disabled="true"] {
	opacity: 0.4;
	cursor: default;
}

.nz-pg .nz-pg__btn svg {
	display: block;
	width: 20px;
	height: 20px;
}

.nz-pg .nz-pg__btn--prev svg {
	transform: rotate(180deg);
}

.nz-pg .nz-pg__count {
	font-family: var(--nz-font-family);
	font-size: var(--nz-font-size-small);
	line-height: var(--nz-line-height-small);
	color: var(--nz-color-text-muted);
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
	.nz-pg__viewport {
		scroll-behavior: auto;
	}

	.nz-pg .nz-pg__card,
	.nz-pg .nz-pg__media,
	.nz-pg .nz-pg__media img.nz-pg__img {
		transition: none;
	}
}
