/* ── Merchandise page ─────────────────────────────────────────────
 * Sections in source order: feature hero (dark band), then the
 * "Exclusive Kodansha House Merchandise" listing — a two-axis filter
 * bar (series + product type) above the product grid.
 *
 * The hero is a hardcoded featured-collection band (currently the
 * Kinokuniya exclusive). The grid is the hardcoded product list defined
 * in page-templates/merchandise.php; each card carries data-series +
 * data-type so the combined filter (js/merch-filter.js) can show/hide
 * it, and hoodie cards flip front⇄back on hover (desktop) / tap (touch).
 * ────────────────────────────────────────────────────────────────── */

/* ── Feature hero ─────────────────────────────────────────────────── */

.merch-hero {
	background-color: var(--color-black);
	background-image: image-set(url(../../assets/kodanshahouse-background--new-york.avif) type("image/avif"), url(../../assets/kodanshahouse-background--new-york.webp) type("image/webp"), url(../../assets/kodanshahouse-background--new-york.png) type("image/png"));
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
	color: var(--color-white);
	padding: var(--space-07) 0;
}

.merch-hero__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-04);
}

/* Constrain the hero text to a readable measure without indenting it: the
 * inner stays the full .global--width container so its left edge lines up
 * with the listing title below, and the column is left-aligned within it. */
.merch-hero__inner > * {
	max-width: 44rem;
}

/* KHLA badge — the Los Angeles locale lockup (same mark as the LA page's
 * .la-hero__locale, sized slightly larger here: 14rem → 15.75rem). */
.merch-hero__badge {
	display: block;
	align-self: flex-start;
	width: 100%;
	max-width: 15.75rem;
	height: auto;
	margin: 0 0 var(--space-03);
	fill: var(--color-white);
}

.merch-hero__badge path {
	fill: inherit;
}

.merch-hero__title {
	margin: 0;
	color: var(--color-white);
	font-size: 4.115rem; /* 65.84px — family + tracking from .kodansha-black */
	line-height: 1.05;
}

.merch-hero__logo {
	display: block;
	align-self: flex-start;
	width: auto;
	height: clamp(1.75rem, 4vw, 2.25rem);
	max-width: 100%;
	margin-top: var(--space-04);
}

.merch-hero__subtitle {
	margin: 0;
	font-family: "Maax Black";
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1.2;
	color: var(--color-gray-mid);
}

.merch-hero__meta {
	display: flex;
	flex-direction: column;
	gap: var(--space-04);
	margin-top: var(--space-04);
	margin-bottom: var(--space-04);
}

.merch-hero__meta-label {
	margin: 0 0 var(--space-02);
	font-family: "Maax Bold";
	font-weight: 400;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-white);
}

.merch-hero__meta-value {
	margin: 0;
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 1.0625rem;
	line-height: 1.4;
	color: var(--color-white);
}

@media (max-width: 768px) {

	.merch-hero__title {
		font-size: clamp(2.5rem, 11vw, 4.115rem);
	}
}

/* ── Listing ──────────────────────────────────────────────────────── */

.merch-listing {
	background: #ddd;
	color: var(--color-text);
	padding: var(--space-07) 0;
}

.merch-listing__title {
	margin: 0 0 var(--space-05);
	font-size: 4.115rem; /* 65.84px — family + tracking from .kodansha-black */
	line-height: 1.1;
	color: var(--color-text);
}

@media (max-width: 768px) {

	.merch-listing__title {
		font-size: clamp(2.5rem, 11vw, 4.115rem);
	}
}

/* ── Two-axis filter bar ──────────────────────────────────────────── */

.merch-filters {
	display: flex;
	flex-direction: column;
	gap: var(--space-04);
	margin-bottom: var(--space-06);
}

.merch-filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-04);
}

.merch-filter__btn {
	flex: 1 1 8rem;
	padding: 1rem 1.25rem;
	background: var(--color-white);
	border: var(--border-width-md) solid var(--color-black);
	color: var(--color-black);
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.merch-filter__btn:hover,
.merch-filter__btn:focus-visible {
	background: var(--color-black);
	color: var(--color-white);
}

.merch-filter__btn.is-active {
	background: var(--color-black);
	color: var(--color-white);
}

/* ── Product grid (placeholder cards) ─────────────────────────────── */

.merch-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-05);
	margin: 0;
	padding: 0;
	list-style: none;
}

.merch-grid .merch-card[hidden] {
	display: none;
}

/* Empty state — shown by js/merch-filter.js when a filter combination
 * matches no products (e.g. Blue Lock + Sticker). */
.merch-empty {
	margin: var(--space-04) 0 0;
	font-family: "Maax Medium";
	font-weight: 400;
	font-size: 1.0625rem;
	line-height: 1.4;
	color: var(--color-text);
}

.merch-empty[hidden] {
	display: none;
}

.merch-card {
	margin: 0;
}

.merch-card__media {
	display: block;
	position: relative;
	width: 100%;
	margin: 0;
	padding: 0;
	aspect-ratio: 1 / 1;
	background: var(--color-gray-light);
	border: 0;
	overflow: hidden;
}

.merch-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Hoodie flip card (front ⇄ back) ──────────────────────────────── */

.merch-card__flip {
	cursor: pointer;
}

.merch-card__flip .merch-card__img--back {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.25s ease;
}

/* Hover swap on pointer devices; tap swap (.is-flipped) on touch. */
@media (hover: hover) {

	.merch-card__flip:hover .merch-card__img--back,
	.merch-card__flip:focus-visible .merch-card__img--back {
		opacity: 1;
	}
}

.merch-card__flip.is-flipped .merch-card__img--back {
	opacity: 1;
}

.merch-card__flip-hint {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	padding: 0.3rem 0.6rem;
	border-radius: 999px;
	background: var(--color-black);
	color: var(--color-white);
	font-family: "Maax Bold";
	font-weight: 400;
	font-size: 0.625rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	pointer-events: none;
}

@media (max-width: 768px) {

	.merch-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-04);
	}
}

@media (max-width: 480px) {

	.merch-grid {
		grid-template-columns: 1fr;
	}
}
