/*
 * charlie.css
 * Standalone recreation of Figma node 76:16007 ("Charlie Manikin").
 * Styles ONLY this page's main content via .ch-* classes; the shared
 * header/footer chrome keeps its own storefront styling (with a few
 * page-scoped responsive overrides at the bottom, mirroring new/homepage.css).
 *
 * Figma tokens:
 *   Blue_Main #2DA7FA · Blue_Subtle #EDF7FF · Text #333536 · Muted #737A82
 *   BG/Default #F6F6F6 · BG/Background #F7F7F9 · BG/Line #E7E7E7 · Card #FDFDFD
 *   Title/Display 36/44 · Title/Title 24/30 · Body/Lead 16/22
 *   Body-B 14 · Body-sm 12 · Label/Button 16
 */

.ch-main {
	--ch-blue: #2da7fa;
	--ch-blue-subtle: #edf7ff;
	--ch-text: #333536;
	--ch-muted: #737a82;
	--ch-line: #e7e7e7;
	--ch-card: #fdfdfd;
	/* Match new/homepage.css's content width so the side margins line up with
	 * the redesigned homepage (1480 desktop, 3320 at 4K below). */
	--ch-shell: min(1480px, 100% - 80px);
	color: var(--ch-text);
	font-family: "Montserrat", sans-serif;
}

.ch-main *,
.ch-main *::before,
.ch-main *::after {
	box-sizing: border-box;
}

.ch-shell {
	width: var(--ch-shell);
	margin-inline: auto;
}

/* The content sections (System, Titan) sit in a narrower band than the full
 * shell, matching the Charlie Figma (1320px content / ~300px side margins) and
 * the homepage's .ft-split sections (1340px). The hero keeps the full shell plus
 * its own 1252px cap, so it stays aligned with the homepage hero. Without this
 * the cards stretch the whole 1480px shell and stick out ~114px past the hero. */
.ch-section--system .ch-shell,
.ch-section--titan .ch-shell {
	max-width: 1320px;
}

/* Hero sits on a wider 18.75% gutter than the sections (Figma: hero copy x=360,
 * sections x=300), exactly like the homepage hero. Applied from 991px up; below
 * that the hero stacks.
 *
 * A flat 62.5% collapses the media column on smaller desktops: at ~1000px it is
 * 625px (copy 480 + gap 48 + media ≈ 97px), shrinking the manikin to a sliver.
 * Instead hold a 1200px content block (the 1920 design: copy 480 + gap 48 + media
 * 672) down to where the viewport can't afford it (then full width minus a small
 * gutter), and only keep the 18.75% inset once 62.5% is wider than that block
 * (>=1920). Mirrors the homepage hero (.ft-section--hero .ft-shell) so the manikin
 * stays a consistent size across desktop widths and at 4K. */
@media (min-width: 991px) {
	.ch-section--hero .ch-shell {
		width: min(100% - 48px, max(1200px, 62.5%));
		max-width: none;
	}
}

/* ---- Sections ---- */
.ch-section {
	padding: 80px 0;
	scroll-margin-top: calc(var(--shop-header-height, 96px) + 12px);
}

.ch-section--hero {
	background: #f6f6f6;
	/* Compact hero band matching new/homepage.css (.ft-section--hero) instead of
	 * a tall fixed 720px band — the hero is now content-height, not min-height. */
	padding: 56px 0 80px;
	/* The blob (behind the manikin) is sized/placed to peek out lower-right and
	 * extends below the manikin. overflow:hidden clips that overhang flush to the
	 * hero's bottom edge — mirroring the Figma, where the next section overlaps and
	 * cuts the blob at y=720. The bottom padding leaves ~80px of grey band below
	 * the manikin for the visible peek (Figma: manikin bottom 639 → hero bottom 720). */
	overflow: hidden;
}

.ch-section--system {
	background: var(--ch-card);
}

.ch-section--titan {
	position: relative;
	background: #f7f7f9;
}

/* Divider line above the Titan cards (Figma Line 504: 1600px, #E7E7E7) */
.ch-section--titan::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: min(1600px, 100% - 80px);
	height: 1px;
	background: var(--ch-line);
}

/* ---- Headings ---- */
.ch-heading {
	display: grid;
	gap: 8px;
	margin-bottom: 40px;
}

.ch-heading--center {
	justify-items: center;
	text-align: center;
}

.ch-eyebrow {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--ch-text);
}

.ch-title {
	margin: 0;
	font-size: 24px;
	line-height: 30px;
	font-weight: 700;
	color: var(--ch-text);
}

.ch-accent {
	color: var(--ch-blue);
}

/* ---- Buttons ---- */
.ch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	width: fit-content;
	padding: 12px 32px;
	border: 1.5px solid transparent;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
}

.ch-btn i {
	font-size: 16px;
}

.ch-btn--primary {
	background: var(--ch-blue);
	color: #f6f6f6;
}

/* "Add to Cart" text link with chevron */
.ch-cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	color: var(--ch-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.ch-cart i {
	font-size: 14px;
}

/* ---- Hero ---- */
/* Hero gutter matches the homepage hero exactly: 18.75% per side (360px on the
 * 1920 design, Figma node 97:2653 copy at x=360). The %-based shell rule below
 * (.ch-section--hero .ch-shell { width: 62.5% }) drives it, so it also holds at
 * 4K — identical to the homepage hero (.ft-section--hero .ft-shell). */
.ch-hero {
	display: grid;
	grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
}

.ch-hero__copy {
	display: grid;
	gap: 24px;
	max-width: 480px; /* Figma node 97:2653 copy column = 480px */
}

.ch-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	padding: 8px 12px;
	background: #fff;
	border-radius: 40px;
	box-shadow: 0 8px 24px rgba(39, 55, 75, 0.08);
	font-size: 14px;
	font-weight: 600;
	color: var(--ch-text);
}

.ch-hero__badge img {
	width: 16px;
	height: 16px;
}

.ch-hero__title {
	margin: 0;
	font-size: 36px;
	line-height: 44px;
	font-weight: 700;
	color: var(--ch-text);
}

.ch-hero__desc {
	margin: 0;
	font-size: 16px;
	line-height: 22px;
	font-weight: 500;
	color: var(--ch-muted);
}

.ch-hero__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 360px;
}

/* The manikin + blob share this sizing box, set to the manikin's footprint
 * (Figma node 97:2663 ≈ 560px wide at 1920). The blob is then positioned as a
 * percentage of THIS box, so its size and offset relative to the manikin stay
 * identical at 1080p and 4K (the 4K block only bumps the box width). */
.ch-hero__figure {
	position: relative;
	width: 560px;
	max-width: 100%;
}

/* Light-blue blob (Figma 97:2662) sits behind the manikin, peeking out lower-right.
 * Per Figma it is ~92% of the manikin width, with its right edge ~25% past the
 * manikin's right edge and its bottom ~30% below the manikin's bottom; that lower
 * overhang is clipped flush by the hero's overflow:hidden (as the next section
 * clips it in Figma). Sized/placed relative to .ch-hero__figure, so these numbers
 * hold at every resolution — fixing the prior media-relative placement that was
 * wrong at both 1080p and 4K. */
.ch-hero__blob {
	position: absolute;
	z-index: 0;
	left: 40%;
	top: 35%;
	width: 80%;
	height: auto;
}

/* Manikin photo clipped into the organic blob shape (Figma 97:2663). The raw
 * export carries opaque white corners outside the blob; we mask them away with
 * the blob silhouette (same coordinate space, so the framing stays exact). Fills
 * the figure box, so it drives the blob's relative sizing above. */
.ch-hero__manikin {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	aspect-ratio: 556 / 419;
	object-fit: cover;
	-webkit-mask: url(/images/new/charlie/hero_mask.svg) center / contain no-repeat;
	mask: url(/images/new/charlie/hero_mask.svg) center / contain no-repeat;
}

/* ---- Charlie Manikin System: vertical product cards ---- */
.ch-products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.ch-pcard {
	display: flex;
	flex-direction: column;
	min-height: 360px;
	padding: 20px;
	background: var(--ch-blue-subtle);
	border-radius: 16px;
}

/* Fixed media height so every card's info block starts at the same y — the Figma
 * anchors the title/description/cart block at top:232px in all four cards, so the
 * titles line up regardless of image height or whether the card has an Add to Cart
 * (card padding 20px + media 212px ≈ the design's 232px). */
.ch-pcard__media {
	flex: 0 0 212px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Fill the media height (height, not max-height) so a product photo whose natural
 * size is smaller than the box scales UP to match the others instead of sitting
 * tiny — e.g. the Charlie Ear Kit (364×303), which under-filled at 4K where the box
 * grows to 424px. width:auto keeps each photo's aspect; max-width guards the rare
 * extra-wide image. */
.ch-pcard--product .ch-pcard__media img {
	width: auto;
	height: 212px;
	max-width: 100%;
	object-fit: contain;
}

/* A-dec photo: the source asset is mirrored relative to the Figma (which flips it
 * via a transform), so flip it horizontally to match the design. */
.ch-pcard__img--flip {
	transform: scaleX(-1);
}

/* Video tile: full-width rounded thumbnail anchored to the top of the media area */
.ch-pcard--video .ch-pcard__media {
	align-items: flex-start;
}

.ch-pcard--video .ch-pcard__media img {
	width: 100%;
	border-radius: 8px;
	object-fit: cover;
}

.ch-pcard__info {
	display: grid;
	gap: 8px;
}

.ch-pcard__info h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--ch-text);
}

.ch-pcard__info p {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--ch-muted);
}

.ch-pcard__info .ch-cart {
	margin-top: 8px;
}

/* ---- Titan Bench Mount: horizontal product cards + instruction tile ---- */
.ch-titan {
	display: flex;
	gap: 16px;
	align-items: stretch;
}

.ch-tcard {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 24px;
	background: var(--ch-card);
	border-radius: 16px;
}

.ch-tcard__info {
	flex: 1 1 auto;
	display: grid;
	gap: 8px;
}

.ch-tcard__info h3 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--ch-text);
}

.ch-tcard__info p {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	font-weight: 500;
	color: var(--ch-muted);
}

.ch-tcard__info .ch-cart {
	margin-top: 4px;
}

.ch-tcard__media {
	flex: 0 0 180px;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ch-blue-subtle);
	border-radius: 16px;
	padding: 12px;
}

.ch-tcard__media img {
	max-width: 100%;
	max-height: 168px;
	object-fit: contain;
}

/* Instruction tile (narrower) */
.ch-icard {
	flex: 0 0 284px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 12px 12px 20px;
	background: var(--ch-card);
	border-radius: 16px;
}

.ch-icard__media img {
	display: block;
	width: 100%;
	border-radius: 8px;
	object-fit: cover;
}

.ch-icard h3 {
	margin: 0 auto;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	color: var(--ch-text);
}

/* ---- Responsive ---- */

/* Keep the manikin + its lower-right blob inside the viewport across mid widths.
 * The hero media column is squeezed between the fixed 480px copy (+48px gap) and
 * the gutter, so a fixed-560px figure fills the column and butts the shell's
 * right edge (~24px gutter) — pushing the blob's ~20% right overhang past the
 * viewport, where the hero's overflow:hidden slices it with a hard vertical line.
 * Scaling the figure with the viewport shrinks the whole manikin+blob unit just
 * enough that the blob's right edge stays in-bounds. The 560px cap is reached by
 * ~1350px, so wide desktop is unchanged; below that it scales down continuously
 * (no breakpoint jump). The slope/offset are derived for this hero's 480px copy +
 * 48px gap layout: figure ≈ 71.4vw − 410px keeps the centred blob's right edge
 * ~20px inside the viewport across the squeeze. Placed here (after the base
 * .ch-hero__figure rule) so it wins on source order; the <=990 stacked hero
 * below overrides it again with its own figure cap. */
@media (min-width: 991px) {
	.ch-hero__figure {
		width: min(560px, calc(71.4vw - 410px));
	}
}

/* Below 1250px the three-in-a-row Titan layout squeezes the two bench-mount
 * cards too narrow (they share the row with the instruction tile). Keep the two
 * bench mounts together on their own row and drop the instruction tile to a
 * full-width row beneath them. */
@media (max-width: 1250px) {
	.ch-titan {
		flex-wrap: wrap;
	}

	.ch-tcard {
		flex: 1 1 calc(50% - 8px);
	}

	/* Instruction tile drops to its own row; cap + centre it so it doesn't blow up
	 * into a full-width video banner (it's full-width on phones, see <=990). */
	.ch-icard {
		flex: 1 1 100%;
		max-width: 560px;
		margin-inline: auto;
	}
}

@media (max-width: 1100px) {
	.ch-products {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 990px) {
	.ch-section {
		padding: 64px 0;
	}

	/* Hero stacks: copy first, manikin image below — matching the modupro mobile
	 * hero. Natural DOM order (copy → media) gives this, so no order override. */
	.ch-hero {
		grid-template-columns: 1fr;
		gap: 32px;
		min-height: 0;
		padding: 48px 0;
	}

	.ch-hero__copy {
		max-width: none;
		justify-items: center;
		text-align: center;
	}

	.ch-hero__media {
		min-height: 0;
	}

	.ch-hero__figure {
		width: 100%;
		max-width: 460px;
	}

	/* Stacked hero: tuck the blob behind the manikin (only a small lower-right
	 * peek) so its overhang doesn't reach down into the section below. */
	.ch-hero__blob {
		left: 16%;
		top: 10%;
		width: 88%;
	}

	/* Titan: each card spans the full row on mobile (the two bench mounts and the
	 * instruction tile stack one per row). The product cards keep their horizontal
	 * layout (text + image) here; they go vertical on small phones (<=600). */
	.ch-tcard {
		flex: 1 1 100%;
	}

	/* Instruction tile is full-width too on mobile, matching the bench cards. */
	.ch-icard {
		max-width: none;
	}
}

@media (max-width: 600px) {
	.ch-section {
		padding: 48px 0;
	}

	/* System cards size to content (equal height per row via the grid) with a
	 * smaller image area suited to the narrower phone cards. */
	.ch-pcard {
		min-height: 0;
		padding: 14px;
	}

	.ch-pcard__media {
		flex-basis: 150px;
	}

	.ch-pcard--product .ch-pcard__media img {
		height: 150px;
	}

	/* Titan product cards go vertical (image box on top, text below) once the
	 * full-width card is too narrow for the side-by-side image. */
	.ch-tcard {
		flex-direction: column;
		gap: 12px;
		padding: 16px;
	}

	.ch-tcard__media {
		order: -1;
		flex: 0 0 auto;
		width: 100%;
		height: 160px;
	}
}

/* ============================================================
   Narrow phones (<=449px) — the System product grid collapses to a SINGLE
   column (Titan is already one card per row from <=990). Min target width is
   325px, so also reclaim side padding here so cards stay roomy.
   ============================================================ */
@media (max-width: 449px) {
	.ch-products {
		grid-template-columns: 1fr;
	}

	.ch-main {
		--ch-shell: min(1480px, 100% - 32px);
	}
}

/* ---- 4K / ultra-wide: scale the design up ~2.2x to match the desktop look ----
 * Mirrors new/homepage.php's 4K strategy: widen the shell to line up with the
 * shared header (which homePage_design.css scales to --shop-shell: 3320px at the
 * same breakpoint) and scale type/spacing by the same factor.
 */
@media (min-width: 3000px) {
	.ch-main {
		--ch-shell: min(3320px, 100% - 180px);
	}

	.ch-section {
		padding: 176px 0;
	}

	.ch-section--hero {
		padding: 124px 0 160px; /* 2× the base grey band so the blob's clipped peek scales */
	}

	/* Content sections: 2640px block → 600px (15.625%) gutter at 3840, matching
	 * the homepage's 4K split sections (.ft-split max-width: 2640). */
	.ch-section--system .ch-shell,
	.ch-section--titan .ch-shell {
		max-width: 2640px;
	}

	.ch-eyebrow {
		font-size: 30px;
	}

	.ch-title {
		font-size: 52px;
		line-height: 64px;
	}

	.ch-heading {
		margin-bottom: 88px;
	}

	/* Hero — mirrors the homepage 4K hero: gutter stays 18.75% via the %-based
	 * rule (.ch-section--hero .ch-shell { width: 62.5% }), copy column 960px
	 * (480 × 2). No max-width cap needed. */
	.ch-hero {
		grid-template-columns: minmax(0, 960px) minmax(0, 1fr);
		gap: 96px;
	}

	.ch-hero__copy {
		max-width: 960px; /* 480 × 2 */
		gap: 53px;
	}

	.ch-hero__media {
		min-height: 720px;
	}

	/* Manikin/blob box scaled 2× the 560px base. The manikin fills it (width:100%)
	 * and the blob keeps its figure-relative %s, so the lower-right peek matches the
	 * 1080p look at 4K too. */
	.ch-hero__figure {
		width: 1120px; /* 560 × 2 */
	}

	.ch-hero__badge {
		padding: 18px 27px;
		font-size: 30px;
		border-radius: 88px;
	}

	.ch-hero__badge img {
		width: 35px;
		height: 35px;
	}

	.ch-hero__title {
		font-size: 78px;
		line-height: 96px;
	}

	.ch-hero__desc {
		font-size: 34px;
		line-height: 48px;
	}

	.ch-btn,
	.ch-btn i {
		font-size: 34px;
		gap: 35px;
	}

	.ch-btn--primary {
		padding: 26px 70px;
	}

	.ch-cart,
	.ch-cart i {
		font-size: 28px;
	}

	/* Cards (2× the 1920 Figma base) */
	.ch-products {
		gap: 32px;
	}

	.ch-pcard {
		min-height: 720px;
		padding: 40px;
		border-radius: 32px;
	}

	.ch-pcard__media {
		flex: 0 0 424px;
	}

	.ch-pcard--product .ch-pcard__media img {
		height: 424px; /* fill the taller 4K media box (matches the base height rule) */
	}

	.ch-pcard__info h3,
	.ch-tcard__info h3,
	.ch-icard h3 {
		font-size: 28px;
	}

	.ch-pcard__info p,
	.ch-tcard__info p {
		font-size: 24px;
	}

	.ch-titan {
		gap: 32px;
	}

	.ch-tcard {
		padding: 48px;
		border-radius: 32px;
		gap: 32px;
	}

	.ch-tcard__media {
		flex-basis: 360px;
		border-radius: 32px;
		padding: 24px;
	}

	.ch-tcard__media img {
		max-height: 336px;
	}

	.ch-icard {
		flex-basis: 568px;
		padding: 24px 24px 40px;
		border-radius: 32px;
		gap: 32px;
	}

	.ch-section--titan::before {
		height: 2px;
	}
}

/* ===========================================================================
 * Shared header + footer overrides (page-scoped to body.ch-page) — mirrors the
 * equivalent blocks in new/homepage.css so the Charlie page's chrome matches
 * the redesigned homepage on desktop, mobile, and 4K.
 * ======================================================================== */

/* Desktop footer: brand pinned left, the four link columns clustered right */
@media (min-width: 991px) {
	body.ch-page .shop-footer__grid {
		grid-template-columns: 1fr repeat(4, minmax(0, max-content));
		gap: 100px;
		align-items: start;
	}

	body.ch-page .shop-footer__brand {
		max-width: 370px;
	}
}

/* Mobile footer: brand on top, link columns in a 3-up grid */
@media (max-width: 680px) {
	body.ch-page .shop-footer__main {
		padding: 48px 0;
	}

	body.ch-page .shop-footer__grid {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 28px 16px;
		align-items: start;
	}

	body.ch-page .shop-footer__brand {
		grid-column: 1 / -1;
		margin-bottom: 4px;
	}

	body.ch-page .shop-footer__column h3 {
		font-size: 16px;
	}

	body.ch-page .shop-footer__column a,
	body.ch-page .shop-footer__brand p {
		font-size: 15px;
		line-height: 1.9;
	}

	body.ch-page .shop-footer__bar-inner {
		gap: 12px;
	}

	body.ch-page .shop-footer__policies {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		gap: 14px;
	}

	body.ch-page .shop-footer__policies a {
		font-size: 10px;
		white-space: nowrap;
	}

	body.ch-page .shop-footer__youtube img {
		height: 22px;
	}
}

@media (max-width: 380px) {
	body.ch-page .shop-footer__bar-inner {
		flex-wrap: wrap;
		gap: 10px;
	}

	body.ch-page .shop-footer__policies {
		flex-wrap: wrap;
		gap: 8px 12px;
	}
}

/* 4K shared header + footer (mirrors new/homepage.css) */
@media (min-width: 3000px) {
	body.ch-page {
		--shop-header-height: 210px;
	}

	body.ch-page .shop-header__brand img {
		width: 388px;
	}

	body.ch-page .shop-nav__link {
		gap: 18px;
		padding: 20px 26px;
		font-size: 33px;
	}

	body.ch-page .shop-nav__caret {
		font-size: 31px;
	}

	body.ch-page .shop-header__actions {
		gap: 31px;
	}

	body.ch-page .shop-header__actions a,
	body.ch-page .shop-header__icon-btn,
	body.ch-page .shop-header__search-trigger {
		width: 88px;
		height: 88px;
		font-size: 44px;
	}

	body.ch-page .shop-desktop-search {
		width: 88px;
		height: 106px;
	}

	body.ch-page .shop-desktop-search input {
		font-size: 40px;
	}

	body.ch-page .shop-footer__main {
		padding: 158px 0;
	}

	body.ch-page .shop-footer__grid {
		gap: 220px;
	}

	body.ch-page .shop-footer__brand {
		max-width: 810px;
	}

	body.ch-page .shop-footer__brand img {
		width: 360px;
		margin-bottom: 35px;
	}

	body.ch-page .shop-footer__brand p,
	body.ch-page .shop-footer__column a {
		font-size: 35px;
	}

	body.ch-page .shop-footer__column h3 {
		margin-bottom: 26px;
		font-size: 40px;
	}

	body.ch-page .shop-footer__bar-inner {
		gap: 53px;
		padding: 62px 0;
	}

	body.ch-page .shop-footer__policies {
		gap: 106px;
	}

	body.ch-page .shop-footer__policies a {
		font-size: 35px;
	}

	body.ch-page .shop-footer__youtube img {
		height: 62px;
	}
}
