/*
 * Hydro Shield — homepage "Our Products" compact rail.
 * REWORKED (visual rework command): replaces the previous large editorial
 * feature-row/pair-tile composition with ONE compact, continuously
 * scrolling marquee of small product cards — deliberately reading as a
 * single unit, not five separate section-like blocks. The loop is pure
 * CSS (`.hs-rail__track` animates translateX 0 -> -50% across two
 * identical card groups) — no JS scroll-position math. Cyan stays
 * restrained: only the small arrow glyph picks it up on hover, nothing
 * else in the rail uses it.
 */

.hs-showcase {
	/* Light section (direct user request) — a deliberate tonal break from
	   Hero's dark cinematic background right above it. Headings/body text
	   below are flipped to dark-on-light accordingly; the rail cards and
	   circle rings keep their own dark surfaces (they read as elevated
	   dark elements floating on the light section, same layering idea
	   used elsewhere on dark grounds — just inverted). */
	background: var(--hs-color-off-white);
	border-top: 1px solid rgba(26, 26, 29, 0.08);
	padding-top: var(--hs-space-6);
	padding-bottom: var(--hs-space-6);
}

.hs-showcase__inner {
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 var(--hs-space-4);
}

/* ================= Row: intro (left) + circles (right) =================
 * ONE row — compact text block on the left, the 5 product circles on the
 * right — per direct user request, not stacked on top of each other. */

.hs-showcase__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--hs-space-5) var(--hs-space-6);
	margin-bottom: var(--hs-space-6);
	padding-bottom: var(--hs-space-5);
	border-bottom: 1px solid rgba(26, 26, 29, 0.08);
}

/* ================= Intro (left, compact) ================= */

.hs-showcase__intro {
	flex: 0 1 360px;
	max-width: 360px;
}


.hs-showcase__heading {
	margin: 0 0 var(--hs-space-3);
	/* Slightly smaller than the standard section-heading scale — the intro
	   is compact by design here, not a full hero-style statement. */
	font-size: clamp(1.6rem, 2.6vw, 2.15rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.005em;
	text-transform: uppercase;
	color: var(--hs-color-graphite);
}

.hs-showcase__text {
	margin: 0;
	font-size: 0.96rem;
	line-height: 1.55;
	color: var(--hs-color-grey-dark);
}

/* ================= Product circles (right) =================
 * The 5 product circles — a fast-scan visual index into the same 5 routes
 * the rail below links to. Interior is a neutral placeholder glyph only
 * (see the PHP comment) until real per-product icons/imagery exist. */

.hs-circles {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: flex-start;
	gap: var(--hs-space-4);
	flex: 1 1 auto;
}

.hs-circles__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: 132px;
	text-decoration: none;
}

.hs-circles__ring {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 116px;
	height: 116px;
	border-radius: 50%;
	background: var(--hs-color-graphite);
	border: 1px solid rgba(240, 240, 232, 0.16);
	box-shadow: 0 16px 28px -18px rgba(0, 0, 0, 0.55);
	transition: transform var(--hs-duration-base) var(--hs-ease-standard), border-color var(--hs-duration-fast) var(--hs-ease-standard), box-shadow var(--hs-duration-base) var(--hs-ease-standard);
}

/* Real per-product icon (assets/images/icons/{slug}.png) — see
   product-showcase.php's header comment. Already drawn in the site's own
   cyan accent with a transparent background, so no currentColor/hover
   recolor is needed the way the old SVG placeholder used; the ring itself
   still gets the hover lift below. */
.hs-circles__icon {
	display: block;
	width: 76px;
	height: 76px;
	object-fit: contain;
}

.hs-circles__item:hover .hs-circles__ring,
.hs-circles__item:focus-visible .hs-circles__ring {
	transform: scale(1.05);
	border-color: rgba(240, 240, 232, 0.34);
	box-shadow: 0 20px 34px -18px rgba(0, 0, 0, 0.6);
}

.hs-circles__item:focus-visible {
	outline: 2px solid var(--hs-color-accent);
	outline-offset: 4px;
	border-radius: var(--hs-radius-sm);
}

.hs-circles__name {
	font-size: 0.86rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-align: center;
	/* Dark, not the usual off-white — this label sits directly on the
	   section's own light background, outside the dark circle. */
	color: var(--hs-color-graphite);
}

/* ================= Rail ================= */

.hs-rail {
	overflow: hidden;
	width: 100%;
	/* Soft edge fade so the marquee reads as bleeding continuously past the
	   viewport edges rather than hard-cutting mid-card. */
	-webkit-mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent);
	mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent);
}

.hs-rail__track {
	display: flex;
	width: max-content;
	animation: hs-rail-scroll 38s linear infinite;
}

.hs-rail__track.is-paused,
.hs-rail:hover .hs-rail__track,
.hs-rail__track:focus-within {
	animation-play-state: paused;
}

.hs-rail__group {
	display: flex;
	flex-shrink: 0;
	gap: var(--hs-space-4);
	padding: 0 var(--hs-space-2);
}

@keyframes hs-rail-scroll {
	from {
		transform: translateX(0);
	}
	to {
		/* Exactly half the track's width — the two groups are identical, so
		   this lands precisely back on the first group's start position. */
		transform: translateX(-50%);
	}
}

/* ================= Cards =================
 * MASTER-AUDIT REDESIGN: the previous full-bleed cinematic-scrim card (image
 * as the whole card background, floating scrimmed text) read as a gallery/
 * portfolio tile, not a product one — same critique already resolved on the
 * /products catalogue page's own cards (assets/css/page-products.css'
 * .hs-cat-card). Rebuilt onto that exact same commerce hierarchy: a
 * CONTAINED square product photo in normal block flow, then a separate
 * solid-background info panel below it (kicker, name, short info, a real
 * filled CTA button) — not stacked absolute layers, so the card's height is
 * simply image + info. */

.hs-rail__card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 240px;
	flex-shrink: 0;
	border: 1px solid rgba(240, 240, 232, 0.14);
	border-radius: 10px;
	overflow: hidden;
	background: var(--hs-color-graphite);
	transition: transform var(--hs-duration-base) var(--hs-ease-standard), border-color var(--hs-duration-fast) var(--hs-ease-standard), box-shadow var(--hs-duration-base) var(--hs-ease-standard);
}

/* BUG FIX (direct report, screenshot-confirmed): the "View Product" button
   sat at a different height from card to card, because a card whose short
   text wraps to 2 lines (e.g. Colour Wrap) is taller than one that stays
   on 1 line (e.g. Coating), and nothing pinned the button to the bottom.
   Making the link a flex column that fills the card's full (flex-stretched)
   height, plus flex:1 on the info panel below, gives the button somewhere
   to sit via margin-top:auto regardless of how many lines the text above
   it takes — see .hs-rail__card-body/.hs-rail__card-action below. */
.hs-rail__card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.hs-rail__card:hover,
.hs-rail__card:focus-within {
	transform: translateY(-4px);
	border-color: rgba(240, 240, 232, 0.34);
	box-shadow: 0 20px 36px -20px rgba(0, 0, 0, 0.55);
}

.hs-rail__card-link:focus-visible {
	outline: 2px solid var(--hs-color-accent);
	outline-offset: 2px;
}

/* Contained square product photo — a real product-listing photo, not a
   full-card cinematic background. */
.hs-rail__card-media {
	position: relative;
	display: block;
	flex-shrink: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--hs-color-bg);
}

.hs-rail__card-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--hs-ease-standard);
}

.hs-rail__card:hover .hs-rail__card-media img,
.hs-rail__card:focus-within .hs-rail__card-media img {
	transform: scale(1.06);
}

/* Solid product-information panel BELOW the photo, not scrimmed text
   floating over it. */
.hs-rail__card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px 16px 16px;
	border-top: 1px solid rgba(240, 240, 232, 0.1);
}

/* Name + price sit on one row (2026-09-22, direct request — real prices
   on the rail cards) so the price doesn't need its own separate line/
   extra card height; name still wraps normally if it ever needs to. */
.hs-rail__card-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.hs-rail__card-name {
	display: block;
	font-size: 1.02rem;
	font-weight: 700;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	color: var(--hs-color-off-white);
}

.hs-rail__card-price {
	flex: 0 0 auto;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--hs-color-accent);
	white-space: nowrap;
}

.hs-rail__card-text {
	display: block;
	margin-bottom: 12px;
	font-size: 0.8rem;
	line-height: 1.45;
	color: rgba(240, 240, 232, 0.68);
}

/* A real filled commerce CTA — same primary-button treatment as every other
   product tile on this site (.hs-cat-card__cta), with a small cyan arrow as
   the one accent. Replaces the previous floating "Buy Now" pill.
   BUG FIX (direct report, screenshot-confirmed): margin-top:auto pins this
   to the bottom of the flex-column info panel (.hs-rail__card-body, now
   flex:1) so it lines up at the same height across every card regardless
   of whether the name/short-text above it wraps to 1 or 2 lines. */
.hs-rail__card-action {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	margin-top: auto;
	padding: 10px 12px;
	border-radius: var(--hs-radius-sm);
	background: var(--hs-color-off-white);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--hs-color-graphite);
	transition: background var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-rail__card-action-arrow {
	display: inline-block;
	color: var(--hs-color-accent);
	transition: transform var(--hs-duration-fast) var(--hs-ease-standard);
}

.hs-rail__card:hover .hs-rail__card-action,
.hs-rail__card:focus-within .hs-rail__card-action {
	background: #ffffff;
}

.hs-rail__card:hover .hs-rail__card-action-arrow,
.hs-rail__card:focus-within .hs-rail__card-action-arrow {
	transform: translateX(3px);
}

/* ================= Responsive ================= */

@media (max-width: 639.98px) {
	.hs-showcase {
		padding-top: var(--hs-space-5);
		padding-bottom: var(--hs-space-5);
	}

	.hs-showcase__row {
		flex-direction: column;
		align-items: flex-start;
		margin-bottom: var(--hs-space-5);
		padding-bottom: var(--hs-space-4);
	}

	/* MOBILE BUG FIX (2026-09-25): `.hs-showcase__intro`'s base rule is
	   `flex: 0 1 360px` — a WIDTH constraint that only makes sense in the
	   desktop row's horizontal main axis. Once .hs-showcase__row switches
	   to flex-direction:column above, that same 360px flex-basis becomes a
	   forced HEIGHT instead, boxing the (much shorter) intro text into an
	   invisible 360px-tall block and pushing everything after it down —
	   this was the actual cause of the large empty gap above the product
	   circles at narrow widths, confirmed via computed-style inspection
	   (.hs-showcase__intro measured exactly 360px tall for ~3 lines of
	   text). `max-width: none` alone never fixed this since flex-basis and
	   max-width are independent properties. `flex-basis: auto` lets the
	   block size to its real text content again. */
	.hs-showcase__intro {
		flex: 1 1 auto;
		max-width: none;
	}

	/* Product circles: flex-wrap → CSS Grid, so the column count is
	   explicit and predictable at every width instead of depending on
	   whatever happens to fit per row (which is what turned into a single
	   cramped column at very narrow phone widths). 3 columns (3+2 rows)
	   for normal/medium mobile; an even-narrower tier below drops to 2
	   columns (see the 359.98px breakpoint further down) rather than
	   letting 3 columns get uncomfortably tight. */
	.hs-circles {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		width: 100%;
		gap: var(--hs-space-4) var(--hs-space-3);
	}

	.hs-circles__item {
		width: auto;
		justify-self: center;
	}

	.hs-circles__ring {
		width: 76px;
		height: 76px;
	}

	.hs-circles__icon {
		width: 50px;
		height: 50px;
	}

	.hs-rail__card {
		width: 200px;
	}

	.hs-rail__group {
		gap: var(--hs-space-3);
	}

	.hs-rail__track {
		animation-duration: 26s;
	}
}

/* Extremely narrow phones (down to ~251px tested) — 3 columns of circles
   gets uncomfortably tight once the available width itself is only
   ~200-270px after page padding, so this tier drops to 2 columns (2+2+1
   rows) instead of squeezing a 3rd column or (the pre-fix behaviour)
   falling back to one cramped column per row. */
@media (max-width: 359.98px) {
	.hs-circles {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ================= Reduced motion ================= */

@media (prefers-reduced-motion: reduce) {
	.hs-rail__track {
		animation: none;
	}

	/* Only the 5 real cards remain — the decorative duplicate group would
	   otherwise just sit there motionless, visually doubling every card. */
	.hs-rail__group[aria-hidden='true'] {
		display: none;
	}
}
