/*
 * Nizu App - Shop archive (shop page, categories, tags, search results). Mobile first: the phone rules are the base,
 * only 768px / 1024px add to them. Owns every nz-shop-* class. Tokens come from the Bricks variables with fallbacks.
 */

/* ---------------------------------------------------------------- Sticky collection chips */
/* --nz-shop-gutter = the section's horizontal padding (theme style: 16 / 24 / 32); the rail bleeds out to the screen edges. */
.nz-shop {
	--nz-shop-gutter: var(--nz-s-4, 16px);
}

.nz-shop-chips {
	position: relative;
	z-index: 800; /* under the app bar (900) and sheets (1000) */
	box-sizing: border-box;
	align-self: stretch; /* the Bricks container is a flex column with align-items: flex-start */
	width: calc(100% + 2 * var(--nz-shop-gutter, 16px));
	max-width: none;
	margin: 0 calc(-1 * var(--nz-shop-gutter, 16px));
	background: rgba(255, 255, 255, .85);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	box-shadow: 0 .5px 0 var(--nz-line, #e7e2e0);
}

.nz-shop-chips--sticky {
	position: sticky;
	top: calc(var(--nz-appbar-h, 52px) + env(safe-area-inset-top, 0px));
}

/* Logged-in staff: the WP admin bar is fixed from 601px up and the app bar sits below it. */
@media (min-width: 601px) {
	body.admin-bar .nz-shop-chips--sticky {
		top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--nz-appbar-h, 52px) + env(safe-area-inset-top, 0px));
	}
}

.nz-shop-chips__row {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	padding: 8px var(--nz-shop-gutter, 16px);
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-padding-inline: var(--nz-shop-gutter, 16px);
}

.nz-shop-chips__row::-webkit-scrollbar {
	display: none;
}

.nz-shop-chips .nz-chip {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	box-sizing: border-box;
	/* 44px tap target, 36px pill: the pill is the padding box, 4px of transparent border above and below is touch area. */
	height: 44px;
	margin-block: -4px;
	padding: 0 var(--nz-s-4, 16px);
	border: solid transparent;
	border-width: 4px 0;
	border-radius: 999px;
	background: var(--nz-surface, #f5f3f2);
	background-clip: padding-box;
	color: var(--nz-ink, #1b1918);
	font-size: var(--nz-fs-secondary, 14px);
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.nz-shop-chips .nz-chip:active {
	background-color: var(--nz-surface-2, #ece8e6);
}

.nz-shop-chips .nz-chip.nz-chip--active {
	background-color: var(--nz-ink, #1b1918);
	color: var(--nz-bg, #fff);
}

.nz-shop-chips .nz-chip:focus-visible {
	outline: 2px solid var(--nz-brand, #6f6467);
	outline-offset: 2px;
}

/* Second, smaller row: child categories of the current collection. */
.nz-shop-chips__row--sub {
	padding-top: 7px;
	padding-bottom: 8px;
}

.nz-shop-chips__row--sub .nz-chip {
	/* 30px pill inside a 44px touch box (7px of transparent border above and below). */
	height: 44px;
	margin-block: -7px;
	border-width: 7px 0;
	padding: 0 var(--nz-s-3, 12px);
	background-color: transparent;
	box-shadow: inset 0 0 0 1px var(--nz-line, #e7e2e0);
	font-size: 13px;
}

.nz-shop-chips__row--sub .nz-chip.nz-chip--active {
	background-color: var(--nz-ink, #1b1918);
	box-shadow: none;
}

@media (min-width: 768px) {
	.nz-shop {
		--nz-shop-gutter: var(--nz-s-6, 24px);
	}
}

@media (min-width: 1024px) {
	.nz-shop {
		--nz-shop-gutter: var(--nz-s-7, 32px);
	}
}

/* ---------------------------------------------------------------- Title + toolbar */
.nz-shop-title {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--nz-ink, #1b1918);
}

.nz-shop-desc {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: var(--nz-s-1, 4px) 0 0;
	font-size: var(--nz-fs-secondary, 14px);
	line-height: 1.45;
	color: var(--nz-ink-2, #6b6466);
}

.nz-shop-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--nz-s-3, 12px);
	width: 100%;
	min-height: 44px;
}

.nz-shop-count {
	margin: 0;
	font-size: var(--nz-fs-secondary, 14px);
	color: var(--nz-ink-2, #6b6466);
}

.nz-shop-actions {
	display: flex;
	align-items: center;
	gap: var(--nz-s-2, 8px);
}

.nz-shop-pillbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 44px;
	margin-block: -4px;
	padding: 0 14px;
	border: solid transparent;
	border-width: 4px 0;
	border-radius: 999px;
	background: var(--nz-surface, #f5f3f2);
	background-clip: padding-box;
	color: var(--nz-ink, #1b1918);
	font: 500 var(--nz-fs-secondary, 14px)/1 var(--nz-font-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.nz-shop-pillbtn:active {
	background-color: var(--nz-surface-2, #ece8e6);
}

.nz-shop-pillbtn:focus-visible {
	outline: 2px solid var(--nz-brand, #6f6467);
	outline-offset: 2px;
}

.nz-shop-pillbtn .nz-shop-ico {
	margin-right: 6px;
}

.nz-shop-pillbtn > * {
	display: inline-flex;
	align-items: center;
}

/* Active filter pills (each one removes its filter) */
.nz-shop-pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--nz-s-2, 8px);
}

.nz-shop-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	height: 32px;
	padding: 0 10px 0 12px;
	border-radius: 999px;
	background: var(--nz-blush, #f6ece8);
	color: var(--nz-ink, #1b1918);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
}

.nz-shop-pill:active {
	background: var(--nz-surface-2, #ece8e6);
}

/* Empty state */
.nz-shop-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--nz-s-3, 12px);
	padding: var(--nz-s-8, 48px) var(--nz-s-4, 16px);
	text-align: center;
}

.nz-shop-empty__title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
}

.nz-shop-empty__hint {
	margin: 0;
	font-size: var(--nz-fs-secondary, 14px);
	color: var(--nz-ink-2, #6b6466);
}

/* ---------------------------------------------------------------- Sort + Filter sheets */
.nz-shop-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: none;
	padding: 0 var(--nz-s-2, 8px) 0 var(--nz-s-5, 20px);
	min-height: 52px;
}

.nz-shop-sheet__title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.nz-shop-sheet__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--nz-ink, #1b1918);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.nz-shop-sheet__close:active {
	background: var(--nz-surface-2, #ece8e6);
}

.nz-shop-sheet__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 0 var(--nz-s-4, 16px) var(--nz-s-4, 16px);
}

.nz-shop-sheet__label {
	display: block;
	margin: var(--nz-s-3, 12px) 0 var(--nz-s-2, 8px);
	font-size: var(--nz-fs-caption, 12px);
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--nz-ink-2, #6b6466);
}

.nz-shop-sheet__foot {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: var(--nz-s-3, 12px);
	flex: none;
	padding: var(--nz-s-3, 12px) var(--nz-s-4, 16px);
	box-shadow: 0 -.5px 0 var(--nz-line, #e7e2e0);
	background: var(--nz-bg, #fff);
}

.nz-shop-sheet__foot > * {
	width: 100%;
	box-sizing: border-box;
	cursor: pointer;
}

/* Radio-style rows (sort) */
.nz-shop-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	padding: 0 4px;
	box-shadow: 0 .5px 0 var(--nz-line, #e7e2e0);
	color: var(--nz-ink, #1b1918);
	font-size: var(--nz-fs-body, 16px);
	text-decoration: none;
}

.nz-shop-row:last-child {
	box-shadow: none;
}

.nz-shop-row:active {
	background: var(--nz-surface, #f5f3f2);
}

.nz-shop-row .nz-shop-ico {
	opacity: 0;
	color: var(--nz-brand, #6f6467);
}

.nz-shop-row[aria-checked="true"] {
	font-weight: 600;
}

.nz-shop-row[aria-checked="true"] .nz-shop-ico {
	opacity: 1;
}

/* Segmented control (undertone) */
.nz-shop-seg {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2px;
	padding: 3px;
	border-radius: 12px;
	background: var(--nz-surface, #f5f3f2);
}

.nz-shop-seg__item {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 38px;
	padding: 0 4px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--nz-ink-2, #6b6466);
	font: 500 var(--nz-fs-secondary, 14px)/1 var(--nz-font-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif);
	cursor: pointer;
	transition: background-color 160ms var(--nz-ease, ease), color 160ms var(--nz-ease, ease), box-shadow 160ms var(--nz-ease, ease);
	-webkit-appearance: none;
	appearance: none;
}

.nz-shop-seg__item[aria-checked="true"] {
	background: var(--nz-bg, #fff);
	color: var(--nz-ink, #1b1918);
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04);
}

.nz-shop-seg__item:focus-visible,
.nz-shop-row:focus-visible {
	outline: 2px solid var(--nz-brand, #6f6467);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.nz-shop-seg__item {
		transition: none;
	}
}

/* ---------------------------------------------------------------- Builder canvas
   The sheets are closed ([hidden], fixed) on the real site. In the Bricks canvas show them in the page flow so
   the owner can see and edit their content. The front end body carries .bricks-is-frontend, the canvas does not. */
body:not(.bricks-is-frontend) .nz-sheet[data-nz-sheet] {
	display: block;
	position: relative;
	inset: auto;
	margin: var(--nz-s-4, 16px) 0;
	border: 1px dashed var(--nz-line, #e7e2e0);
	border-radius: var(--nz-r-l, 22px);
}

body:not(.bricks-is-frontend) .nz-sheet[data-nz-sheet] .nz-sheet__scrim {
	display: none;
}

body:not(.bricks-is-frontend) .nz-sheet[data-nz-sheet] .nz-sheet__panel {
	position: relative;
	max-height: none;
	transform: none;
	box-shadow: none;
}
