/*
 * Shop listing — Shop.dc.html (shop page, product taxonomy archives, product search).
 * Markup: woocommerce/archive-product.php + inc/woo/shop.php. Cards and chips are the shared
 * components (.ps-card, .ps-chip, .ps-grid); only their shop-specific context lives here.
 * Desktop values = the design's inline styles. ≤1024 / ≤767 rules are ours.
 */

/* ── Head band ────────────────────────────────────────────────────── */
.ps-shop-head { background: var(--ps-ink); color: var(--ps-cream); }
.ps-shop-head__inner {
	padding-top: 44px; padding-bottom: 40px;
	display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap;
}
.ps-shop-head__crumb {
	margin-bottom: 10px;
	font-family: var(--ps-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.2em;
	text-transform: uppercase; color: var(--ps-core);
}
.ps-shop-head__crumb a { color: var(--ps-muted); }
.ps-shop-head__crumb a:hover { color: var(--ps-core); }
/* The design's h1 keeps the UA bold on a 400-only face: Chrome synthesises the heavier strokes. */
.ps-shop-head__title {
	margin: 0; font-family: var(--ps-font-display); font-weight: 700; font-size: 52px;
	line-height: 0.98; letter-spacing: -0.02em; overflow-wrap: anywhere;
}
.ps-shop-head__note {
	font-family: var(--ps-font-cond); font-weight: 600; font-size: 14px; letter-spacing: 0.1em;
	text-transform: uppercase; color: var(--ps-muted-2); text-align: right;
}

/* ── Sticky filter bar ────────────────────────────────────────────── */
.ps-shop-filters {
	position: sticky; top: var(--ps-header-h); z-index: 40;
	background: var(--ps-paper); border-bottom: 1px solid var(--ps-line);
}
.admin-bar .ps-shop-filters { top: calc(var(--ps-header-h) + 32px); }
.ps-shop-filters__inner {
	padding-top: 16px; padding-bottom: 16px;
	display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
}
.ps-shop-filters__lanes { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-shop-filters__formats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ps-shop-filters__label {
	margin-right: 4px;
	font-family: var(--ps-font-cond); font-weight: 700; font-size: 12px; letter-spacing: 0.12em;
	text-transform: uppercase; color: var(--ps-muted);
}
.ps-shop-filters .ps-chip { line-height: normal; white-space: nowrap; }
.ps-shop-filters .ps-chip--sm:not(.is-active) { border-color: var(--ps-line); }
.ps-shop-filters .ps-chip--sm:hover:not(.is-active) { border-color: var(--ps-ink); color: var(--ps-ink); }
/* Active format chip: ink fill, the border stays the hairline (design). */
.ps-shop-filters .ps-chip--sm.is-active { border-color: var(--ps-line); }

/* ── Body: lane note, grid, footnote ──────────────────────────────── */
.ps-shop-body { padding-top: 36px; padding-bottom: 64px; }
.ps-shop-results { transition: opacity var(--ps-ease); }
.ps-shop.is-loading .ps-shop-results { opacity: .45; pointer-events: none; }

.ps-shop-note {
	margin-bottom: 24px; padding: 16px 22px; border-radius: var(--ps-radius);
	display: flex; gap: 16px; align-items: baseline;
	background: var(--lane-pill-bg, var(--ps-paper)); color: var(--lane-pill-fg, var(--ps-ink));
}
.ps-shop-note__word { flex: none; font-family: var(--ps-font-display); font-size: 17px; }
.ps-shop-note__text { font-size: 15px; font-weight: 600; }
.ps-shop-note--term { border: 1px solid var(--ps-line); }
.ps-shop-note--term .ps-shop-note__text { font-weight: 500; line-height: 1.55; color: var(--ps-text); }
.ps-shop-note--term .ps-shop-note__text > * { margin: 0; }
.ps-shop-note--term .ps-shop-note__text > * + * { margin-top: .6em; }

/* Card metrics as Shop.dc.html sets them (font "normal" line boxes; COA pill 4px 9px + 1px border).
   Shared-change request filed for components.css — these can go once it lands. */
.ps-shop .ps-card .ps-pill { line-height: normal; }
.ps-shop .ps-card .ps-pill--coa { padding: 4px 9px; }
.ps-shop .ps-card__price,
.ps-shop .ps-card__add { line-height: normal; }
/* Sold-out cards have no 34px Add button: keep their price on the same line as the neighbours'. */
.ps-shop .ps-card__foot { min-height: 34px; }
/* Woo's AJAX add-to-cart marks the button .loading while the request runs. */
.ps-shop .ps-card__add.loading { opacity: .6; pointer-events: none; cursor: progress; }

/* WooCommerce "Products per row" (Customizer) on listing pages; 4 is the .ps-grid default. */
@media (min-width: 1025px) {
	.ps-shop .ps-loop[data-columns="3"] { --ps-cols: 3; }
	.ps-shop .ps-loop[data-columns="5"] { --ps-cols: 5; }
}
/* A card with extension output (wishlist, compare…) around it: one grid cell, card still full height. */
.ps-loop__item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ps-loop__item > .ps-card { flex: 1; }

.ps-shop-foot {
	margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--ps-line);
	display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
	font-size: 13px; line-height: 1.55; color: var(--ps-muted);
}
.ps-shop-foot__text { max-width: 70ch; }
.ps-shop-foot__ships {
	display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
	font: inherit; font-weight: 700; color: inherit; line-height: inherit; text-align: inherit;
}
.ps-shop-foot__ships:hover { color: var(--ps-ink); text-decoration: underline; text-underline-offset: 2px; }
.ps-shop-foot__link {
	flex: none;
	/* The design's stack: Barlow has no "→", so it falls back to the system sans, not Arial Narrow.
	   Shared-change request filed for --ps-font-cond in tokens.css. */
	font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
	text-transform: uppercase; color: var(--ps-verify-deep);
}
.ps-shop-foot__link:hover { color: var(--ps-go-deep); }

/* ── Empty state ──────────────────────────────────────────────────── */
.ps-shop-empty {
	background: var(--ps-paper); border: 1px solid var(--ps-line); border-radius: var(--ps-radius);
	overflow: hidden; text-align: center;
}
.ps-shop-empty__inner { padding: 52px 32px 56px; }
.ps-shop-empty__eyebrow {
	margin-bottom: 12px;
	font-family: var(--ps-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.2em;
	text-transform: uppercase; color: var(--ps-muted);
}
.ps-shop-empty__title {
	font-family: var(--ps-font-display); font-size: 34px; line-height: 1.02; letter-spacing: -0.02em;
	color: var(--ps-ink); overflow-wrap: anywhere;
}
.ps-shop-empty__text {
	max-width: 56ch; margin: 14px auto 26px;
	font-size: 17px; line-height: 1.55; color: var(--ps-text);
}
.ps-shop-empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ps-shop-empty__search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto 22px; }
.ps-shop-empty__search .ps-input { flex: 1; min-width: 0; }
.ps-shop-empty__lanes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ps-shop-empty__lanes .ps-lanechip:hover { color: var(--lane-on, var(--ps-cream)); filter: brightness(1.08); }

/* ── WooCommerce notices + (safety) pagination inside the listing ─── */
.ps-shop .woocommerce-notices-wrapper:empty { display: none; }
.ps-shop .woocommerce-notices-wrapper { margin-bottom: 24px; }
.ps-shop .woocommerce-notices-wrapper > :last-child { margin-bottom: 0; }
.ps-shop .woocommerce-message,
.ps-shop .woocommerce-info,
.ps-shop .woocommerce-error {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin: 0 0 10px; padding: 14px 18px; list-style: none;
	background: var(--ps-paper); border: 1px solid var(--ps-line); border-left: 4px solid var(--ps-go);
	border-radius: var(--ps-radius); font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ps-ink);
}
.ps-shop .woocommerce-message:focus,
.ps-shop .woocommerce-info:focus,
.ps-shop .woocommerce-error:focus { outline: none; } /* Woo focuses the notice for screen readers */
.ps-shop .woocommerce-info { border-left-color: var(--ps-verify); }
.ps-shop .woocommerce-error { border-left-color: var(--ps-relief); display: block; }
.ps-shop .woocommerce-message .button,
.ps-shop .woocommerce-info .button {
	order: 2; flex: none; padding: 9px 15px; border-radius: var(--ps-radius-sm);
	background: var(--ps-ink); color: var(--ps-cream);
	font-family: var(--ps-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
}
.ps-shop .woocommerce-message .button:hover,
.ps-shop .woocommerce-info .button:hover { background: var(--ps-go); color: var(--ps-cream); }
.ps-shop .woocommerce-pagination { margin-top: 28px; }
.ps-shop .woocommerce-pagination ul { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.ps-shop .woocommerce-pagination .page-numbers {
	display: inline-block; padding: 8px 13px; border: 2px solid var(--ps-ink); border-radius: var(--ps-radius-sm);
	font-family: var(--ps-font-cond); font-weight: 700; letter-spacing: .08em; color: var(--ps-ink);
}
.ps-shop .woocommerce-pagination .page-numbers.current,
.ps-shop .woocommerce-pagination a.page-numbers:hover { background: var(--ps-ink); color: var(--ps-cream); }

/* ── Tablet ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.ps-shop-head__title { font-size: 46px; }

	/* Lanes stay one wrapped row; the Refine row becomes one sideways-scrolling line so the sticky
	   bar stays short (the wrapped rows pinned ~30% of a landscape tablet). The edge with more chips
	   behind it fades (data-fade from the inline script; no JS = right edge). */
	.ps-shop-filters__inner { padding-top: 14px; padding-bottom: 9px; gap: 11px; flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
	.ps-shop-filters__formats {
		--ps-fade: calc(var(--ps-gutter) + 28px);
		flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
		margin-left: calc(-1 * var(--ps-gutter)); margin-right: calc(-1 * var(--ps-gutter));
		/* 5px above/below: room for the 3px + 2px focus ring, which a scroller would clip. */
		padding: 5px var(--ps-gutter);
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--ps-fade)), transparent);
		mask-image: linear-gradient(90deg, #000 calc(100% - var(--ps-fade)), transparent);
	}
	.ps-shop-filters__formats::-webkit-scrollbar { display: none; }
	.ps-shop-filters__formats::after { content: ''; flex: none; width: 1px; } /* keeps the right gutter when scrolled to the end */
	.ps-shop-filters__formats > * { flex: none; }
	.ps-shop-filters__formats[data-fade=""] { -webkit-mask-image: none; mask-image: none; }
	.ps-shop-filters__formats[data-fade="l"] {
		-webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--ps-fade));
		mask-image: linear-gradient(90deg, transparent, #000 var(--ps-fade));
	}
	.ps-shop-filters__formats[data-fade="lr"] {
		-webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--ps-fade), #000 calc(100% - var(--ps-fade)), transparent);
		mask-image: linear-gradient(90deg, transparent, #000 var(--ps-fade), #000 calc(100% - var(--ps-fade)), transparent);
	}
}
/* Touch tablets: 40px chip targets (BUILD-GUIDE). */
@media (max-width: 1024px) and (pointer: coarse) {
	.ps-shop-filters .ps-chip { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Phone ────────────────────────────────────────────────────────── */
@media (max-width: 782px) {
	.admin-bar .ps-shop-filters { top: calc(var(--ps-header-h) + 46px); }
}
@media (max-width: 767px) {
	.ps-shop-head__inner { padding-top: 28px; padding-bottom: 24px; gap: 14px; align-items: flex-start; flex-direction: column; }
	.ps-shop-head__crumb { font-size: 12px; letter-spacing: 0.16em; margin-bottom: 8px; }
	.ps-shop-head__title { font-size: 36px; line-height: 1; }
	.ps-shop-head__note { font-size: 13px; text-align: left; }

	/* All six lanes in view (3 × 2), 40px touch targets; Refine scrolls sideways (tablet rules). */
	.ps-shop-filters__inner { padding-top: 8px; padding-bottom: 3px; gap: 3px; }
	.ps-shop-filters__lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.ps-shop-filters .ps-chip { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
	.ps-shop-filters__lanes .ps-chip { padding: 8px 6px; text-align: center; }

	.ps-shop-body { padding-top: 20px; padding-bottom: 44px; }
	.ps-shop-note { flex-direction: column; gap: 4px; padding: 14px 16px; margin-bottom: 16px; }
	.ps-shop-note__text { font-size: 14px; line-height: 1.45; }
	.ps-shop-foot { margin-top: 28px; flex-direction: column; gap: 14px; }

	/* Cards: the lane / COA pills sit above the photo instead of on it (same 150px box);
	   40px Add target. Shared-change requests filed for components.css. */
	.ps-shop .ps-card__media { padding: 34px 12px 8px; }
	.ps-shop .ps-card__media img { max-height: 108px; }
	.ps-shop .ps-card__media .ps-shot-ph { height: 108px; }
	.ps-shop .ps-card__add { min-height: 40px; }
	.ps-shop .ps-card__foot { min-height: 40px; }

	.ps-shop-empty__inner { padding: 36px 20px 40px; }
	.ps-shop-empty__title { font-size: 26px; }
	.ps-shop-empty__text { font-size: 16px; margin: 12px auto 22px; }
	.ps-shop-empty__search { flex-direction: column; }
	.ps-shop-empty__lanes .ps-lanechip { min-height: 40px; display: inline-flex; align-items: center; padding-left: 14px; padding-right: 14px; }
	.ps-shop .woocommerce-notices-wrapper { margin-bottom: 16px; } /* same rhythm as note → grid */
	.ps-shop .woocommerce-message, .ps-shop .woocommerce-info { font-size: 14px; }
}
@media (max-width: 600px) {
	.admin-bar .ps-shop-filters { top: var(--ps-header-h); }
}
