/*
 * Shop header. The layout, logo, nav circles and phone sizes are the parent's
 * site-header CSS, loaded with this block. This adds the strip above, the
 * shop colors (theme.json custom.shop), the Shop tag and Roonie.
 */

/* The strip: the main site's menu in miniature, on its tan. */
.pm-strip {
	background: var(--wp--preset--color--tan);
	/* A thin dark purple rule (the shop accent) between the main site's strip and the shop header. */
	border-bottom: 1px solid var(--wp--custom--shop--color);
}

.pm-strip__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 20px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 7px 32px;
}

.pm-strip__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 500;
	line-height: 1;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.pm-strip__link:hover .pm-strip__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pm-strip .pm-dot {
	width: 18px;
	height: 18px;
}

/*
 * The strip of the comic site someone came from (Site Integration Plan,
 * section 4): its header color, its menu link color, its icon and logo, and
 * one link home. data-pm-from on <html> picks it, and it replaces the main
 * strip; the aubergine rule under it stays. Without data-pm-from, none show.
 */
.pm-strip--from {
	display: none;
	background: var(--pm-from-bg);
}

[data-pm-from] .pm-strip--main {
	display: none;
}

[data-pm-from="roonie"] .pm-strip--from-roonie,
[data-pm-from="bassistwanted"] .pm-strip--from-bassistwanted,
[data-pm-from="johnny"] .pm-strip--from-johnny,
[data-pm-from="thunderdog"] .pm-strip--from-thunderdog {
	display: block;
}

.pm-strip--from .pm-strip__inner {
	flex-wrap: nowrap;
	padding-top: 8px;
	padding-bottom: 8px;
}

.pm-from {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	min-height: 26px; /* the icon's height, so Thunder Dog's strip (no icon) is as tall as the others */
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	color: var(--pm-from-ink);
	text-decoration: none;
}

.pm-from:hover .pm-from__back {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* .pm-strip--from img beats WooCommerce's `.woocommerce-page img { height: auto }`. */
.pm-strip--from img.pm-from__icon {
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 4px;
}

.pm-strip--from img.pm-from__logo {
	flex: none;
	width: auto;
	height: 24px;
}

.pm-from__back {
	margin-left: 8px;
	color: var(--pm-from-ink);
}

/* The shop's own header, in the shop colors. */
.pm-shop-header .pm-header {
	background: var(--wp--custom--shop--header);
}

.pm-shop-header .pm-header__home {
	gap: 18px;
}

.pm-shop-header .pm-header__logo {
	filter: var(--wp--custom--shop--logo-filter);
}

/* WooCommerce's product-page CSS (.woocommerce-page img { height: auto }) would undo the parent's logo heights. */
.pm-shop-header .pm-header img.pm-header__logo {
	height: 88px;
}

.pm-shop-header .pm-nav__link,
.pm-shop-header .pm-nav__link:hover {
	color: var(--wp--custom--shop--header-ink);
}

.pm-shop-header .pm-nav__link:hover .pm-nav__label {
	text-decoration: underline;
	text-underline-offset: 8px;
}

/* The nav circles: their color and glyph color are shop settings, so they suit the header. */
.pm-shop-header .pm-nav .pm-dot {
	color: var(--wp--custom--shop--dot-glyph);
}

/* The current category: underlined in the header's text color, as the main site underlines in the section color. */
.pm-shop-header .pm-nav__link[aria-current="page"] .pm-nav__label {
	text-decoration: underline;
	text-decoration-color: var(--wp--custom--shop--header-ink);
	text-decoration-thickness: 3px;
	text-underline-offset: 8px;
}

/* The "Shop" tag beside the logo: a white pill holding a black bag circle. */
.pm-shop-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 6px;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--white);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--ink);
}

.pm-shop-tag .pm-dot {
	width: 30px;
	height: 30px;
}

/*
 * Roonie stands on the header's bottom border, the way the main site's
 * platypus does: the crop is a 150px box aligned to the bottom, its
 * margin-bottom cancelling the inner padding. Behind him a dark glow, centered
 * on his belly and spreading up and out across the header, so his white body
 * stands out and the flat color gets some depth. The header clips the glow.
 */
.pm-shop-header .pm-header {
	position: relative;
	overflow: hidden;
}

.pm-shop-header .pm-header__inner {
	position: relative;
}

.pm-shop-roonie {
	position: relative;
	display: block;
	align-self: flex-end;
	margin: 0 0 -16px 10px;
}

.pm-shop-roonie::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -224px;
	width: 760px;
	height: 494px;
	transform: translateX(calc(-50% + 14px)); /* his belly sits right of the image's middle */
	background: radial-gradient(ellipse closest-side, rgb(20 8 34 / 0.55), rgb(20 8 34 / 0.22) 55%, rgb(20 8 34 / 0));
	pointer-events: none;
}

.pm-shop-roonie__crop {
	position: relative;
	display: block;
	height: 150px;
	overflow: hidden;
}

.pm-shop-roonie img {
	display: block;
	width: 116px;
	max-width: none;
	height: auto;
}

/* The logo, tag and nav sit above the glow. */
.pm-shop-header .pm-header__logo,
.pm-shop-tag,
.pm-shop-header .pm-nav {
	position: relative;
	z-index: 1;
}

/* The cart circle's count: a small badge on its top right. */
.pm-cart-dot {
	position: relative;
	display: inline-flex;
}

.pm-cart-dot__count {
	position: absolute;
	top: -6px;
	right: -8px;
	box-sizing: border-box;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid var(--wp--custom--shop--header);
	border-radius: var(--wp--custom--radius--pill);
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	color: var(--wp--custom--shop--buy-ink);
	background: var(--wp--custom--shop--buy);
}

.pm-cart-dot__count[hidden] {
	display: none;
}

/* The cart glyph is wide, so it sits a little smaller than the others. */
.pm-shop-header .pm-nav .pm-nav__link--cart .pm-dot svg {
	width: 52%;
	height: 52%;
}

/* Roonie steps out where the platypus does, before the nav can reach him. */
@media (max-width: 999px) {
	.pm-shop-roonie {
		display: none;
	}
}

/* Small tablets: without this the logo, the Shop tag and the nav collide. */
@media (min-width: 768px) and (max-width: 899px) {
	.pm-shop-header .pm-header img.pm-header__logo {
		height: 64px;
	}

	.pm-shop-header .pm-header__home {
		gap: 12px;
	}

	.pm-shop-tag {
		font-size: 17px;
	}

	.pm-shop-tag .pm-dot {
		width: 26px;
		height: 26px;
	}

	.pm-shop-header .pm-nav {
		gap: 16px;
	}
}

@media (max-width: 767px) {
	/* Phones: no strip (Porter, 2026-10-28). Its unlabeled circles cost the room Buy now needs; the footer's Porter Mason column is the way back. */
	.pm-strip {
		display: none;
	}

	.pm-strip__inner {
		gap: 12px;
		padding: 7px 16px;
	}

	/* Visitors from a comic site still get its strip, on one line (Porter, 2026-11-05). The [data-pm-from] rules above out-rank the .pm-strip one. */
	.pm-from {
		gap: 8px;
		min-height: 22px;
	}

	.pm-strip--from img.pm-from__icon {
		width: 22px;
		height: 22px;
	}

	.pm-strip--from img.pm-from__logo {
		height: 19px;
	}

	.pm-from__back {
		margin-left: 4px;
	}

	/* Circles only, as in the main site's phone header; the labels stay for screen readers. */
	.pm-strip__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.pm-strip .pm-dot {
		width: 22px;
		height: 22px;
	}

	.pm-shop-header .pm-header__home {
		gap: 8px;
	}

	/* 38px (was 44) and smaller circles, so the logo, the Shop tag and four circles have room on a 390px phone (Porter, 2026-10-28). */
	.pm-shop-header .pm-header img.pm-header__logo {
		height: 38px;
	}

	.pm-shop-tag {
		gap: 5px;
		padding: 3px 9px 3px 3px;
		font-size: 14px;
	}

	.pm-shop-tag .pm-dot {
		width: 22px;
		height: 22px;
	}

	.pm-shop-header .pm-nav {
		gap: 6px;
	}

	.pm-shop-header .pm-nav .pm-dot {
		width: 32px;
		height: 32px;
	}

	/*
	 * The current category on phones: the circle filled in the shop's
	 * aubergine with a white glyph, not a ring around it, which made the row
	 * wider than a phone can spare (Porter, 2026-10-28).
	 */
	.pm-shop-header .pm-nav__link[aria-current="page"] .pm-dot {
		box-shadow: none;
		background: var(--wp--custom--shop--color);
		color: var(--wp--preset--color--white);
	}
}

/* The narrowest phones (320px): the comic site's strip a size smaller, so "Back to the comics" fits on its line. */
@media (max-width: 359px) {
	.pm-from {
		gap: 6px;
		min-height: 18px;
		font-size: 13px;
	}

	.pm-strip--from img.pm-from__icon {
		width: 18px;
		height: 18px;
	}

	.pm-strip--from img.pm-from__logo {
		height: 15px;
	}

	.pm-from__back {
		margin-left: 2px;
	}
}
