/* =====================================================
   HEALIO — UGC video rails
   Shared by the homepage affiliate pitch and the product page.
   See inc/ugc.php for the markup and the reasoning.
   ===================================================== */

/* -----------------------------------------------------
   The clip itself — identical everywhere.
   ----------------------------------------------------- */
.ugc-card {
	position: relative;
	aspect-ratio: 9 / 16;
	border-radius: 16px;
	overflow: hidden;
	background: var(--blush-soft);
	/* The lift PSPeptides uses, tinted to Healio's wine rather than their purple. */
	box-shadow: 0 14px 34px -14px rgba(43, 10, 20, 0.42);
	-webkit-user-select: none;
	user-select: none;
	/* Kills the iOS long-press "Save Video" sheet before it can open. */
	-webkit-touch-callout: none;
	isolation: isolate;
}

.ugc-vid {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background-color: var(--blush-soft);
	/* The poster is scaled the same way the video will be, so the swap from
	   still to motion is invisible. */
	background-size: cover;
	background-position: center;
	/* Belt and braces with the shield above: the element itself is inert. */
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

/* Sits over the clip and eats every pointer event — click, drag, right-click,
   long-press. Transparent, so it costs nothing visually. Touch scrolling still
   works through it, which is what the product-page scroller needs. */
.ugc-shield {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
	cursor: default;
	-webkit-tap-highlight-color: transparent;
}

/* A hairline inside the radius stops the clip looking like it is floating on
   nothing against a pale background. */
.ugc-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
	pointer-events: none;
}

/* =====================================================
   Homepage — "Real people, real routines"
   ===================================================== */
.ugc-real {
	position: relative;
	overflow: hidden;
	padding: clamp(56px, 7vw, 96px) 0 clamp(48px, 6vw, 84px);
	background:
		radial-gradient(80% 62% at 50% 0%, rgba(233, 195, 211, 0.55) 0%, rgba(233, 195, 211, 0) 68%),
		linear-gradient(180deg, var(--cream) 0%, #FFF8FA 55%, var(--cream) 100%);
}

/* Two soft orbs, the same trick the affiliate page hero uses, so the section
   reads as part of the same family. */
.ugc-real__bg {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}
.ugc-real__orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(70px);
	opacity: 0.5;
}
.ugc-real__orb--1 {
	width: 380px;
	height: 380px;
	top: -110px;
	left: -90px;
	background: rgba(201, 103, 144, 0.32);
}
.ugc-real__orb--2 {
	width: 320px;
	height: 320px;
	bottom: -120px;
	right: -70px;
	background: rgba(233, 195, 211, 0.55);
}

.ugc-real__inner {
	position: relative;
	z-index: 1;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--pad);
	text-align: center;
}

/* "Real people, real routines." reads as one line at every width. The vw term
   is tuned to the string's own length rather than the site-wide h2 clamp, so a
   narrow phone shrinks the type instead of wrapping or overflowing. */
.ugc-real__inner h2,
.ugc-real__inner .hd--h2 {
	white-space: nowrap;
	font-size: clamp(22px, 7vw, 52px);
	margin: 0 auto;
}

.ugc-real__sub {
	max-width: 58ch;
	margin: 18px auto 0;
	color: var(--mauve);
	font-size: 17px;
	line-height: 1.6;
}

.ugc-real__rail-wrap {
	margin-top: clamp(38px, 4.6vw, 60px);
}

/* Sits above the blurred orbs rather than behind them. */
.ugc-real__cta {
	position: relative;
	z-index: 1;
	margin-top: clamp(30px, 3.6vw, 44px);
	padding: 0 var(--pad);
	text-align: center;
}

/* -----------------------------------------------------
   Homepage rail — five up, no scrolling, on desktop.
   ----------------------------------------------------- */
.ugc-rail--home {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 var(--pad);
}
.ugc-rail--home .ugc-track {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 20px;
	align-items: start;
}
/* The marquee duplicate is desktop-dead weight; the phone breakpoint below
   brings it back. */
.ugc-rail--home .ugc-card:nth-child(n + 6) {
	display: none;
}

/* All five sit on one level line; only hover breaks it. */
.ugc-rail--home .ugc-card {
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
.ugc-rail--home .ugc-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 26px 52px -18px rgba(43, 10, 20, 0.5);
}

/* =====================================================
   Product page — social proof under Add to Cart
   ===================================================== */
/* min-width:0 on both boxes so the rail can never hand a min-content width up
   to the summary column — a scrolling strip must shrink with its container,
   not widen it. */
.pdp-ugc {
	min-width: 0;
	margin: 20px 0 4px;
	padding: 15px 15px 13px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: linear-gradient(170deg, #FFFDFE 0%, var(--cream) 100%);
}

.pdp-ugc__head {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0 0 13px;
	padding: 0 2px;
}
.pdp-ugc__spark {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--blush-soft);
	color: var(--rose);
}
.pdp-ugc__spark svg { width: 15px; height: 15px; }
.pdp-ugc__copy { display: flex; flex-direction: column; min-width: 0; }
.pdp-ugc__copy b {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--wine);
	line-height: 1.25;
}
.pdp-ugc__copy span {
	font-size: 12.5px;
	color: var(--mauve);
	line-height: 1.35;
}

/* -----------------------------------------------------
   Product rail — horizontal scroller with a slim bar,
   the way SULT runs theirs.
   ----------------------------------------------------- */
.ugc-rail-wrap { min-width: 0; }

.ugc-rail--pdp {
	--ugc-pdp-w: 150px;
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	/* Not for a native scrollbar's height any more — that bar is hidden below
	   — but overflow-y:hidden still clips anything past the container's own
	   box, and the cards' drop-shadow renders below them, so this stays as
	   headroom for the shadow. */
	padding-bottom: 10px;
	scroll-snap-type: x proximity;
	overscroll-behavior-x: contain;
	/* The native scrollbar is hidden on purpose — see .ugc-scrollbar below. */
	scrollbar-width: none;
	/* Hints that there is more to the right without a hard clip. */
	-webkit-mask-image: linear-gradient(to right, #000 0%, #000 92%, rgba(0, 0, 0, 0.15) 100%);
	mask-image: linear-gradient(to right, #000 0%, #000 92%, rgba(0, 0, 0, 0.15) 100%);
}
.ugc-rail--pdp::-webkit-scrollbar { display: none; }

/* With the native bar hidden, a mouse needs something to take hold of, so the
   rail itself becomes the handle (ugc.js does the dragging). Gated to a real
   pointer: a touch device scrolls this natively and must not inherit a grab
   cursor it can never show. The shield sets cursor:default over every clip,
   which would otherwise punch holes in the grab area. */
@media (hover: hover) and (pointer: fine) {
	.ugc-rail--pdp { cursor: grab; }
	.ugc-rail--pdp.is-grabbing { cursor: grabbing; }
	.ugc-rail--pdp .ugc-shield { cursor: inherit; }
	.ugc-scrollbar { cursor: pointer; }
}
.ugc-rail--pdp .ugc-track {
	display: flex;
	gap: 10px;
	width: max-content;
	padding: 2px 2px 0;
}
.ugc-rail--pdp .ugc-card {
	flex: 0 0 auto;
	width: var(--ugc-pdp-w);
	border-radius: 12px;
	scroll-snap-align: start;
	box-shadow: 0 8px 20px -10px rgba(43, 10, 20, 0.4);
}

/* Hand-drawn scroll indicator, pink on every device. The browser's own
   ::-webkit-scrollbar only ever rendered on desktop Chrome/Safari — iOS
   Safari ignores that pseudo-element for a touch-scrolled box and shows its
   own pale system bar instead, which is what read as "white" on a phone.
   This div sits outside the scrolling rail so it is always on screen, and
   ugc.js keeps its width/position matched to the rail's real scroll state. */
.ugc-scrollbar {
	position: relative;
	height: 4px;
	margin: 10px 2px 0;
	border-radius: 999px;
	background: var(--blush-soft);
	overflow: hidden;
}
.ugc-scrollbar__thumb {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 30%;
	border-radius: inherit;
	background: var(--rose);
}

/* =====================================================
   Phones — the homepage rail becomes an auto-scrolling
   marquee, which is why the track is rendered twice.
   ===================================================== */
@media (max-width: 860px) {
	.ugc-real__sub { font-size: 15.5px; }

	.ugc-rail--home {
		max-width: none;
		padding: 0;
		overflow: hidden;
		-webkit-mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
		mask-image: linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
	}
	.ugc-rail--home .ugc-track {
		display: flex;
		width: max-content;
		gap: 14px;
		padding: 6px 0 14px;
		animation: ugc-marquee 34s linear infinite;
	}
	/* Both passes are visible now — that is what makes the wrap seamless. */
	.ugc-rail--home .ugc-card:nth-child(n + 6) { display: block; }
	.ugc-rail--home .ugc-card {
		flex: 0 0 auto;
		width: 172px;
	}
	.ugc-rail--home .ugc-card:hover {
		transform: none;
		box-shadow: 0 14px 34px -14px rgba(43, 10, 20, 0.42);
	}
	/* A finger on the strip holds it still. */
	.ugc-rail--home:active .ugc-track { animation-play-state: paused; }

	.pdp-ugc { margin-top: 18px; }
	.ugc-rail--pdp { --ugc-pdp-w: 132px; }
}

/* Two identical passes, so one pass is exactly half the track plus half a gap. */
@keyframes ugc-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(calc(-50% - 7px)); }
}

/* =====================================================
   Opt-outs
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
	.ugc-rail--home .ugc-track { animation: none; }
	.ugc-rail--home .ugc-card,
	.ugc-rail--home .ugc-card:hover { transition: none; }
}
