/* =====================================================================
   SITAARA — EDITORIAL SHOP FEED (/shop/)

   Scoped entirely under .shop-page so nothing here can reach the home page,
   the product page, or the flat .collection-card grid still used by
   /collections/, category archives and search.

   Image rule, unchanged from the rest of the site: product photography is never
   cropped. Each card's frame takes its aspect ratio from that piece's own first
   photograph (--shop-ar, set from naturalWidth/naturalHeight by shop.js), so a
   landscape and a portrait piece both sit whole against the cream ground.
   ===================================================================== */

.shop-page {
	padding-top: var(--headerH);
	background: var(--paper);
	color: var(--ink);
	max-width: 1620px;
	margin: 0 auto;
	padding-inline: var(--gutter);
	padding-bottom: clamp(80px, 10vw, 150px);
}

/* ---------------- hero ---------------- */
.shop-hero {
	padding: clamp(48px, 7vw, 110px) 0 clamp(28px, 3.5vw, 48px);
	max-width: 62ch;
}
.shop-hero small {
	display: block;
	color: var(--muted);
	font-size: var(--fs-micro);
	letter-spacing: .22em;
	text-transform: uppercase;
}
.shop-hero h1 {
	margin: 14px 0 18px;
	font: clamp(38px, 5.4vw, 76px) / 1 var(--serif);
	font-weight: 400;
	letter-spacing: -.01em;
}
.shop-hero-lead {
	margin: 0;
	max-width: 54ch;
	color: var(--muted);
	font-size: var(--fs-lead);
	line-height: 1.7;
}
.shop-count {
	margin: 22px 0 0;
	color: var(--ink);
	font-size: var(--fs-label);
	letter-spacing: .16em;
	text-transform: uppercase;
}

/* ---------------- toolbar ---------------- */
.shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 18px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	position: relative;
}
.shop-tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px; /* tap target */
	padding: 10px 20px;
	border: 1px solid var(--ink);
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: var(--fs-label);
	letter-spacing: .16em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.shop-tool:hover,
.shop-tool:focus-visible {
	background: var(--ink);
	color: var(--paper);
}
.shop-tool:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}
.shop-tool-badge {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--maroon);
	color: #fff;
	font-size: 12px;
	letter-spacing: 0;
}

/* ---------------- active filter chips ---------------- */
.shop-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding-top: 18px;
}
.shop-chip {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--cream);
	color: var(--ink);
	font-size: var(--fs-label);
	letter-spacing: .08em;
	text-decoration: none;
}
.shop-chip:hover,
.shop-chip:focus-visible {
	border-color: var(--ink);
}
.shop-chip > span[aria-hidden] {
	font-size: 18px;
	line-height: 1;
}
.shop-chip-hint {
	color: var(--muted);
	font-size: var(--fs-micro);
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* ---------------- groups ---------------- */
.shop-group {
	padding-top: clamp(38px, 4.5vw, 70px);
}
.shop-group-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 20px;
	padding-bottom: 22px;
}
.shop-group-head h2 {
	margin: 0;
	font: clamp(26px, 3vw, 40px) var(--serif);
	font-weight: 400;
}
.shop-group-head p {
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-label);
	letter-spacing: .14em;
	text-transform: uppercase;
}

/* Desktop 3 columns, tablet 2, mobile 1. */
.shop-group .shop-card {
	flex: 1 1 calc(33.333% - 2 * var(--shop-gap));
	min-width: 0;
}
.shop-group {
	--shop-gap: 22px;
	display: flex;
	flex-wrap: wrap;
	gap: var(--shop-gap);
}
.shop-group .shop-group-head {
	flex: 1 0 100%;
}

/* ---------------- card ---------------- */
.shop-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.shop-media {
	position: relative;
	background: var(--cream);
}
.shop-swiper {
	overflow: hidden;
}
.shop-swiper .swiper-wrapper {
	display: flex;
}
.shop-swiper .swiper-slide {
	flex: 0 0 100%;
	width: 100%;
}
/* The frame ratio comes from the piece's own first photograph, so nothing is
   cropped and no two cards are forced into one shape. */
.shop-swiper .swiper-slide img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--shop-ar, 2 / 3);
	object-fit: contain;
	background: var(--cream);
}
.shop-swiper.is-still .swiper-slide img {
	aspect-ratio: var(--shop-ar, 2 / 3);
}

/* --- carousel controls --- */
.shop-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(23, 19, 17, .16);
	border-radius: 50%;
	background: rgba(251, 250, 247, .86);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	cursor: pointer;
	transition: opacity .2s ease, background .2s ease;
}
.shop-nav::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 9px;
	height: 9px;
	border-top: 1.5px solid var(--ink);
	border-right: 1.5px solid var(--ink);
}
.shop-nav-prev {
	left: 10px;
}
.shop-nav-prev::before {
	transform: rotate(-135deg);
}
.shop-nav-next {
	right: 10px;
}
.shop-nav-next::before {
	transform: rotate(45deg);
}
.shop-nav:hover,
.shop-nav:focus-visible {
	background: rgba(251, 250, 247, .99);
}
.shop-nav:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}
/* Hidden rather than removed, so the layout never shifts when a card reaches
   either end of its own images. */
.shop-nav.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* --- dots --- */
.shop-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 7px;
}
/* The button is a real 24x24 target (the WCAG 2.2 AA minimum) and the visible
   dot is drawn inside it, so the understated 7px mark and a finger-sized hit
   area are both honest. Using a ::after overlay instead would leave the element
   itself at 7x7. */
.shop-dot {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	display: grid;
	place-items: center;
}
.shop-dot::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(23, 19, 17, .26);
	transition: background .2s ease, transform .2s ease;
}
.shop-dot.is-active::before {
	background: var(--maroon);
	transform: scale(1.35);
}
.shop-dot:focus-visible {
	outline: 1px solid var(--maroon);
	outline-offset: -4px;
}

/* --- card text --- */
.shop-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	padding: 16px 2px 0;
}
.shop-textile {
	color: var(--muted);
	font-size: var(--fs-micro);
	letter-spacing: .18em;
	text-transform: uppercase;
}
.shop-info h3 {
	margin: 2px 0 0;
	font: var(--fs-name) var(--serif);
	font-weight: 400;
	line-height: 1.2;
}
.shop-info h3 a {
	color: inherit;
	text-decoration: none;
}
.shop-info h3 a:hover,
.shop-info h3 a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 4px;
}
.shop-desc {
	margin: 4px 0 0;
	color: var(--muted);
	font-size: var(--fs-body);
	line-height: 1.65;
}
.shop-cta {
	/* A text link is 28px tall, which is too small to aim at. It keeps the
	   underlined editorial look but becomes a proper inline-flex target. */
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-top: 4px;
	padding-bottom: 0;
	border-bottom: 1px solid var(--ink);
	color: var(--ink);
	font-size: var(--fs-label);
	letter-spacing: .18em;
	text-decoration: none;
	align-self: flex-start;
}
.shop-cta:hover,
.shop-cta:focus-visible {
	color: var(--maroon);
	border-color: var(--maroon);
}

/* ---------------- empty state ---------------- */
.shop-empty {
	margin: clamp(40px, 6vw, 80px) 0;
	padding: clamp(40px, 6vw, 76px) clamp(24px, 4vw, 60px);
	background: var(--cream);
	text-align: center;
}
.shop-empty h2 {
	margin: 0 0 14px;
	font: clamp(26px, 3.4vw, 44px) var(--serif);
	font-weight: 400;
}
.shop-empty p {
	margin: 0 auto 26px;
	max-width: 44ch;
	color: var(--muted);
	font-size: var(--fs-body);
	line-height: 1.7;
}
.shop-empty-cta {
	display: inline-block;
	min-height: 44px;
	padding: 11px 22px;
	background: var(--ink);
	color: var(--paper);
	font-size: var(--fs-label);
	letter-spacing: .16em;
	text-decoration: none;
	text-transform: uppercase;
}
.shop-empty-cta:hover,
.shop-empty-cta:focus-visible {
	background: var(--maroon);
}

/* ---------------- filter drawer ----------------
   Built on the site's existing .drawer, so it inherits the shared overlay
   behaviour (backdrop, Escape, focus return) from app.js rather than
   reimplementing it. Only the internals are new here. */
.shop-filter {
	width: min(420px, 92vw);
	padding: 100px 32px 40px;
	overflow-y: auto;
	background: var(--paper);
	/* Iteration 3 — the drawer now slides in from the LEFT edge of the viewport
	   instead of the right. The base .drawer is right-anchored (right:0,
	   translateX(105%), left shadow); these four declarations flip it. They sit
	   after the base rule (shop.css depends on styles.css, so it wins) and are
	   scoped to .shop-filter, so the search popover, the mobile menu and the
	   sort panel are untouched. */
	left: 0;
	right: auto;
	transform: translateX(-105%);
	box-shadow: 20px 0 60px rgba(0, 0, 0, .12);
}
.shop-filter.open {
	transform: translateX(0);
}
.shop-sort-panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 60;
	width: min(300px, 78vw);
	padding: 18px 20px 22px;
	border: 1px solid var(--line);
	background: var(--paper);
	box-shadow: 0 24px 60px rgba(23, 19, 17, .16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.shop-sort-panel.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.shop-filter-close,
.shop-sort-close {
	position: absolute;
	top: 34px;
	right: 32px;
	min-height: 40px;
	padding: 8px 4px;
	border: 0;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: var(--fs-micro);
	letter-spacing: .18em;
	text-transform: uppercase;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 4px;
}
.shop-filter-title {
	margin: 0 0 6px;
	font: clamp(24px, 3vw, 34px) var(--serif);
	font-weight: 400;
}
.shop-filter-note {
	margin: 0 0 26px;
	color: var(--muted);
	font-size: var(--fs-label);
	letter-spacing: .1em;
	text-transform: uppercase;
}
.shop-filter-group {
	padding-top: 22px;
	border-top: 1px solid var(--line);
}
.shop-filter-group + .shop-filter-group {
	margin-top: 26px;
}
.shop-filter-group h3 {
	margin: 0 0 14px;
	color: var(--muted);
	font-size: var(--fs-micro);
	font-weight: 400;
	letter-spacing: .2em;
	text-transform: uppercase;
}
.shop-filter-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	min-height: 48px; /* tap target */
	padding: 10px 2px;
	border-bottom: 1px solid transparent;
	color: var(--ink);
	font-size: var(--fs-body);
	text-decoration: none;
}
.shop-filter-option:hover,
.shop-filter-option:focus-visible {
	border-bottom-color: var(--ink);
}
.shop-filter-option em {
	flex: 0 0 auto;
	color: var(--muted);
	font-size: var(--fs-label);
	font-style: normal;
	letter-spacing: .08em;
}
.shop-filter-option.is-active {
	font-weight: 600;
}
.shop-filter-option.is-active em {
	color: var(--maroon);
}
/* A real category with no pieces yet is listed and reachable, but marked so the
   visitor is not led to expect a grid that does not exist. */
.shop-filter-option.is-empty {
	color: var(--muted);
}
.shop-filter-option.is-empty em {
	font-size: var(--fs-micro);
	letter-spacing: .16em;
	text-transform: uppercase;
}
.shop-filter-clear {
	display: inline-block;
	margin-top: 28px;
	min-height: 44px;
	padding: 11px 20px;
	border: 1px solid var(--ink);
	color: var(--ink);
	font-size: var(--fs-label);
	letter-spacing: .16em;
	text-decoration: none;
	text-transform: uppercase;
}
.shop-filter-clear:hover,
.shop-filter-clear:focus-visible {
	background: var(--ink);
	color: var(--paper);
}

.shop-sort-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 48px;
	padding: 10px 2px;
	color: var(--ink);
	font-size: var(--fs-body);
	text-decoration: none;
}
.shop-sort-option:hover,
.shop-sort-option:focus-visible {
	background: var(--cream);
}
.shop-sort-option.is-active {
	font-weight: 600;
}
.shop-sort-option em {
	color: var(--muted);
	font-size: var(--fs-micro);
	font-style: normal;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.shop-sort-option.is-disabled {
	color: var(--muted);
	cursor: not-allowed;
	opacity: .8;
}

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
	.shop-group .shop-card {
		flex-basis: calc(50% - var(--shop-gap) / 2);
	}
}
@media (max-width: 680px) {
	.shop-group {
		--shop-gap: 26px;
	}
	.shop-group .shop-card {
		flex-basis: 100%;
	}
	.shop-toolbar {
		gap: 10px;
	}
	.shop-tool {
		flex: 1 1 auto;
		justify-content: center;
	}
	.shop-filter {
		padding: 92px 22px 34px;
	}
	.shop-filter-close {
		top: 28px;
		right: 22px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.shop-tool,
	.shop-nav,
	.shop-dot,
	.shop-sort-panel {
		transition: none;
	}
}

/* =====================================================================
   ITERATION 2 / 3 — UNIFIED PRODUCT GRID
   Shared by /shop/ and /collections/: one continuous grid, no category
   sections. Iteration 3 sets the desktop default to THREE columns, tablet to
   two, and keeps TWO columns down to 320px so a phone shows a clean two-up
   catalogue instead of a single stretched column. Every card is the same
   width, so the cards that used to stretch to full width in a one-piece
   category can no longer do so.
   ===================================================================== */
.shop-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(30px, 3.4vw, 52px) clamp(16px, 2vw, 26px);
	align-items: stretch;
}
.shop-grid .shop-card {
	min-width: 0;
	height: 100%;
}
.shop-grid .shop-info {
	flex: 1 1 auto;
}

/* Price above, button below, both full width: the Add to Bag button can never
   detach from its own card or float between rows. */
.shop-info .shop-buy,
.collection-card-wrap .shop-buy {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	width: 100%;
	margin: 12px 0 0;
	flex-wrap: nowrap;
}
.shop-info .shop-price,
.collection-card-wrap .shop-price {
	font-family: var(--serif);
	font-size: var(--fs-body);
	letter-spacing: .02em;
	color: var(--ink);
}
.shop-add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 46px;
	padding: 0 20px;
	border-radius: 999px;
	background: var(--maroon);
	color: var(--paper);
	font-family: var(--sans);
	font-size: var(--fs-label);
	line-height: 1;
	letter-spacing: .16em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	transition: background .2s ease, transform .2s ease;
}
.shop-add-icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.shop-grid .shop-buy {
	margin-top: auto;
}

/* Collections textile filter hides the shared card; the card is a flex box, so
   [hidden] alone would be overridden and must be defined explicitly. */
.shop-card.is-filtered-out,
.shop-card[hidden] {
	display: none;
}

@media (max-width: 860px) {
	.shop-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 30px 18px;
	}
}
/* Iteration 3 — two-up phone layout. Tighter gutters/gaps, a compact card and
   a narrower Add to Bag button so two complete image frames fit side by side
   at 375px and 320px with no horizontal page overflow. */
@media (max-width: 600px) {
	.shop-grid {
		gap: 26px 12px;
	}
	.shop-info {
		padding: 12px 0 0;
		gap: 4px;
	}
	.shop-info h3 {
		font-size: clamp(17px, 5vw, 20px);
	}
	.shop-textile {
		letter-spacing: .14em;
	}
	.shop-add {
		min-height: 42px;
		padding: 0 10px;
		gap: 6px;
		font-size: 12px;
		letter-spacing: .08em;
	}
	.shop-add-icon {
		width: 14px;
		height: 14px;
	}
	/* 44px arrows do not fit a two-up phone card; swipe and the (smaller) dots
	   remain the controls there. */
	.shop-nav {
		display: none;
	}
	.shop-dot {
		width: 18px;
		height: 18px;
	}
	.shop-dot::before {
		width: 5px;
		height: 5px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.shop-add {
		transition: none;
	}
}