/* ==========================================================================
   Home hero slider ("hs") — inc/home-hero.php + assets/js/hero-slider.js
   Each slide sets --hs-accent (category colour) and --hs-tint (soft wash).
   ========================================================================== */

.hdme-hs {
	--hs-interval: 6500ms;
	padding: 20px 0 6px;
}

/* ---- Stage: slides stack in one grid cell and cross-fade ---------------- */
.hdme-hs__stage {
	position: relative;
	display: grid;
	overflow: hidden;
	border: 1px solid rgba(21, 43, 73, 0.07);
	border-radius: 28px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(21, 43, 73, 0.05), 0 18px 48px rgba(21, 43, 73, 0.09);
	touch-action: pan-y;
}

.hdme-hs__slide {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
	align-items: center;
	gap: 20px;
	min-height: 0;
	padding: 26px 48px;
	background:
		radial-gradient(120% 90% at 100% 0%, var(--hs-tint) 0%, rgba(255, 255, 255, 0) 62%),
		linear-gradient(105deg, #ffffff 0%, #ffffff 42%, var(--hs-tint) 100%);
	opacity: 0;
	visibility: hidden;
	transition: opacity 600ms ease, visibility 0s linear 600ms;
}
.hdme-hs__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity 600ms ease, visibility 0s linear 0s;
}

/* ---- Copy ------------------------------------------------------------------ */
.hdme-hs__copy { position: relative; z-index: 2; min-width: 0; }

.hdme-hs__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 13px 6px 11px;
	border: 1px solid rgba(21, 43, 73, 0.08);
	border-radius: 999px;
	background: #fff;
	background: color-mix(in srgb, var(--hs-accent) 10%, #ffffff);
	color: var(--hs-accent);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

.hdme-scope .hdme-hs .hdme-hs__title {
	max-width: 21ch;
	margin: 14px 0 10px;
	padding: 0;
	color: var(--hdme-blue-900);
	font-size: clamp(1.9rem, 1.3rem + 1.45vw, 2.55rem);
	font-weight: 800;
	line-height: 1.07;
	letter-spacing: -0.022em;
	text-wrap: balance;
}

.hdme-hs__lead {
	max-width: 44ch;
	margin: 0;
	color: var(--hdme-grey-600);
	font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
	line-height: 1.6;
}

.hdme-hs__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0 18px;
}
.hdme-hs__actions .hdme-btn { min-height: 50px; padding-inline: 18px; border-radius: 12px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.hdme-hs__cta .hdme-hs__icon { transition: transform 180ms ease; }
.hdme-hs__cta:hover .hdme-hs__icon,
.hdme-hs__cta:focus-visible .hdme-hs__icon { transform: translateX(3px); }
.hdme-hs__cta2 { background: rgba(255, 255, 255, 0.85); }

.hdme-hs__trust {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hdme-hs__trust li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	color: var(--hdme-grey-600);
	font-size: 14px;
	line-height: 1.3;
}
.hdme-hs__trust .hdme-hs__icon { flex: 0 0 auto; color: var(--hs-accent); }

/* ---- Visual: product photo on a soft disc, floating card, thumbnails ------ */
.hdme-hs__visual {
	position: relative;
	display: grid;
	place-items: center;
	height: 330px;
	min-width: 0;
}

/* The white circle frame (photo + ring) replaces the old disc: no blend mode needed for white backgrounds. */
.hdme-hs__halo { display: none; }
.hdme-hs__photo {
	position: relative;
	display: grid;
	place-items: center;
	width: min(290px, 80%);
	height: auto;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.55), 0 0 0 15px rgba(21, 43, 73, 0.05), 0 26px 54px rgba(21, 43, 73, 0.12);
}
.hdme-hs .hdme-hs__photo img {
	position: absolute;
	inset: 13%;
	display: block;
	width: 74%;
	height: 74%;
	max-width: none;
	object-fit: contain;
}

.hdme-hs__card {
	position: absolute;
	z-index: 3;
	left: 0;
	bottom: 6px;
	display: grid;
	gap: 3px;
	width: 214px;
	padding: 13px 16px 14px;
	border: 1px solid rgba(21, 43, 73, 0.07);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 14px 34px rgba(21, 43, 73, 0.16);
	color: var(--hdme-grey-800);
	text-decoration: none;
	transition: transform 200ms ease, box-shadow 200ms ease;
}
.hdme-hs__card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(21, 43, 73, 0.2); color: var(--hdme-grey-900); }
.hdme-hs__card-label {
	color: var(--hs-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.hdme-hs__card-name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}
.hdme-hs__card-price { color: var(--hdme-blue-800); font-size: 15px; font-weight: 800; }
.hdme-hs__card-price--note { color: var(--hs-accent); font-size: 13px; font-weight: 700; }
.hdme-hs__card-was { margin-left: 6px; color: var(--hdme-grey-500); font-size: 12.5px; font-weight: 600; }

.hdme-hs__thumbs {
	position: absolute;
	z-index: 3;
	top: 50%;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transform: translateY(-50%);
}
.hdme-hs__thumb,
.hdme-hs__more {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	overflow: hidden;
	border: 1px solid rgba(21, 43, 73, 0.08);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 24px rgba(21, 43, 73, 0.12);
	text-decoration: none;
	transition: transform 200ms ease, border-color 200ms ease;
}
.hdme-hs__thumb:hover,
.hdme-hs__more:hover { transform: translateY(-2px); border-color: var(--hs-accent); }
.hdme-hs .hdme-hs__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	padding: 7px;
	object-fit: contain;
}
.hdme-hs__more {
	align-content: center;
	gap: 0;
	background: var(--hs-accent);
	color: #fff;
	line-height: 1.1;
	text-align: center;
}
.hdme-hs__more strong { font-size: 17px; font-weight: 800; }
.hdme-hs__more span { font-size: 11px; font-weight: 600; opacity: 0.9; }
.hdme-hs__more:hover { color: #fff; }

/* ---- Entrance motion for the slide that becomes active ------------------- */
@keyframes hdme-hs-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hdme-hs-pop  { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.hdme-hs__slide.is-active .hdme-hs__copy > * { animation: hdme-hs-rise 600ms cubic-bezier(.2, .7, .2, 1) both; }
.hdme-hs__slide.is-active .hdme-hs__copy > :nth-child(2) { animation-delay: 60ms; }
.hdme-hs__slide.is-active .hdme-hs__copy > :nth-child(3) { animation-delay: 120ms; }
.hdme-hs__slide.is-active .hdme-hs__copy > :nth-child(4) { animation-delay: 180ms; }
.hdme-hs__slide.is-active .hdme-hs__copy > :nth-child(5) { animation-delay: 240ms; }
.hdme-hs__slide.is-active .hdme-hs__photo { animation: hdme-hs-pop 800ms cubic-bezier(.2, .7, .2, 1) both; }
.hdme-hs__slide.is-active .hdme-hs__card { animation: hdme-hs-rise 700ms 220ms cubic-bezier(.2, .7, .2, 1) both; }
.hdme-hs__slide.is-active .hdme-hs__thumbs > * { animation: hdme-hs-rise 600ms cubic-bezier(.2, .7, .2, 1) both; }
.hdme-hs__slide.is-active .hdme-hs__thumbs > :nth-child(1) { animation-delay: 260ms; }
.hdme-hs__slide.is-active .hdme-hs__thumbs > :nth-child(2) { animation-delay: 320ms; }
.hdme-hs__slide.is-active .hdme-hs__thumbs > :nth-child(3) { animation-delay: 380ms; }

/* ---- Navigation: arrows + labelled category tabs with progress --------- */
.hdme-hs__nav {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
}

.hdme-hs__tabs {
	display: flex;
	flex: 1 1 auto;
	gap: 6px;
	min-width: 0;
	padding: 4px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.hdme-hs__tabs::-webkit-scrollbar { display: none; }

.hdme-scope .hdme-hs .hdme-hs__tab {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 16px;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: 12px;
	-webkit-appearance: none;
	appearance: none;
	/* The progress line is a background strip along the bottom of the tab. (Safari positions a
	   button's ::after against its inner text box, which put the line through the label.) */
	background-color: transparent;
	background-image: linear-gradient(var(--hs-accent), var(--hs-accent));
	background-repeat: no-repeat;
	background-position: 12px calc(100% - 5px);
	background-size: 0 2px;
	box-shadow: none;
	color: var(--hdme-grey-600);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.hdme-scope .hdme-hs .hdme-hs__tab:hover { background-color: rgba(255, 255, 255, 0.8); color: var(--hdme-grey-900); }
.hdme-scope .hdme-hs .hdme-hs__tab.is-active {
	border-color: rgba(21, 43, 73, 0.1);
	background-color: #fff;
	background-image: linear-gradient(color-mix(in srgb, var(--hs-accent) 35%, transparent), color-mix(in srgb, var(--hs-accent) 35%, transparent));
	background-size: calc(100% - 24px) 2px;
	box-shadow: 0 4px 14px rgba(21, 43, 73, 0.08);
	color: var(--hs-accent);
}
.hdme-hs__tab .hdme-hs__icon { flex: 0 0 auto; opacity: 0.85; }
@keyframes hdme-hs-progress { from { background-size: 0 2px; } to { background-size: calc(100% - 24px) 2px; } }
.hdme-scope .hdme-hs.is-playing .hdme-hs__tab.is-active {
	background-image: linear-gradient(var(--hs-accent), var(--hs-accent));
	animation: hdme-hs-progress var(--hs-interval) linear both;
}

.hdme-scope .hdme-hs .hdme-hs__arrow,
.hdme-scope .hdme-hs .hdme-hs__pause {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--hdme-grey-200);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(21, 43, 73, 0.06);
	color: var(--hdme-grey-700);
	cursor: pointer;
	transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}
.hdme-scope .hdme-hs .hdme-hs__arrow:hover,
.hdme-scope .hdme-hs .hdme-hs__pause:hover { border-color: var(--hdme-blue-300); color: var(--hdme-blue-700); }
.hdme-scope .hdme-hs .hdme-hs__pause { width: 38px; height: 38px; }
.hdme-hs__play-icon { display: none; }
.hdme-hs__pause[aria-pressed="true"] .hdme-hs__pause-icon { display: none; }
.hdme-hs__pause[aria-pressed="true"] .hdme-hs__play-icon { display: block; }

.hdme-hs :focus-visible { outline: 3px solid var(--hdme-blue-400); outline-offset: 2px; }

/* ---- Laptop / small desktop ---------------------------------------------- */
/* Spacing to the first home section, as with the previous hero. */
body.home.hdme-scope .hdme-home > .hdme-hs + .hdme-section { padding-top: 28px; }

@media (max-width: 1199px) {
	.hdme-hs__slide { padding: 24px 36px; }
	.hdme-hs__visual { height: 310px; }
	.hdme-hs__photo { width: min(256px, 78%); }
}

/* ---- Tablet: stacked, photo on top --------------------------------------- */
@media (max-width: 899px) {
	.hdme-hs__stage { border-radius: 22px; }
	.hdme-hs__slide {
		grid-template-columns: minmax(0, 1fr);
		align-content: start;
		gap: 8px;
		min-height: 0;
		padding: 16px 28px 24px;
		background:
			radial-gradient(90% 60% at 50% 0%, var(--hs-tint) 0%, rgba(255, 255, 255, 0) 70%),
			linear-gradient(180deg, var(--hs-tint) 0%, #ffffff 58%);
	}
	.hdme-hs__visual { order: -1; height: 262px; max-width: 560px; width: 100%; margin: 0 auto; }
	.hdme-hs__photo { width: min(218px, 58%); }
	.hdme-hs__card { bottom: 16px; width: 200px; }
	.hdme-scope .hdme-hs .hdme-hs__title { max-width: 22ch; margin-top: 14px; }
	.hdme-hs__lead { max-width: 60ch; }
	.hdme-hs__actions { margin: 22px 0 18px; }
}

/* ---- Phone ----------------------------------------------------------------- */
@media (max-width: 599px) {
	/* Phone: one centred column — photo circle, product chip under it, centred copy, full-width buttons. */
	.hdme-hs { padding-top: 12px; }
	body.home.hdme-scope .hdme-home > .hdme-hs + .hdme-section { padding-top: 24px; }
	.hdme-hs__stage { border-radius: 20px; margin-inline: -4px; }
	.hdme-hs__slide {
		gap: 0;
		padding: 18px 16px 18px;
		background:
			radial-gradient(80% 55% at 50% 0%, var(--hs-tint) 0%, rgba(255, 255, 255, 0) 75%),
			linear-gradient(180deg, var(--hs-tint) 0%, #ffffff 62%);
	}
	.hdme-hs__visual {
		display: flex;
		flex-direction: column;
		align-items: center;
		height: auto;
		padding-bottom: 4px;
	}
	.hdme-hs__photo {
		width: min(236px, 64vw);
		box-shadow: 0 0 0 9px rgba(255, 255, 255, 0.6), 0 0 0 10px rgba(21, 43, 73, 0.05), 0 16px 32px rgba(21, 43, 73, 0.12);
	}
	.hdme-hs .hdme-hs__photo img { inset: 8%; width: 84%; height: 84%; }

	/* Other products + product count: a small centred row under the product chip. */
	.hdme-hs__thumbs {
		position: static;
		flex-direction: row;
		justify-content: center;
		gap: 8px;
		margin-top: 12px;
		transform: none;
	}
	.hdme-hs__thumb,
	.hdme-hs__more { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 6px 14px rgba(21, 43, 73, 0.10); }
	.hdme-hs .hdme-hs__thumb img { padding: 5px; }
	.hdme-hs__more strong { font-size: 14px; }
	.hdme-hs__more span { font-size: 9.5px; }

	/* Product chip: name + price on one line, centred just under the circle. */
	.hdme-hs__card {
		position: relative;
		left: auto;
		bottom: auto;
		display: flex;
		align-items: baseline;
		gap: 8px;
		width: auto;
		max-width: calc(100% - 8px);
		margin: -12px auto 0;
		padding: 8px 14px;
		border-radius: 999px;
		box-shadow: 0 8px 20px rgba(21, 43, 73, 0.14);
	}
	.hdme-hs__card-label,
	.hdme-hs__card-was { display: none; }
	.hdme-hs__card-name {
		display: block;
		min-width: 0;
		overflow: hidden;
		flex: 1 1 auto;
		font-size: 13px;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.hdme-hs__card-price { flex: 0 0 auto; max-width: 60%; overflow: hidden; font-size: 13.5px; white-space: nowrap; text-overflow: ellipsis; }
	.hdme-hs__card-price--note { font-size: 12.5px; }

	.hdme-hs__copy { padding-top: 14px; text-align: center; }
	.hdme-hs__eyebrow { font-size: 12px; padding: 5px 11px 5px 9px; }
	.hdme-scope .hdme-hs .hdme-hs__title {
		max-width: 22ch;
		margin: 10px auto 8px;
		font-size: clamp(1.32rem, 1.1rem + 1.5vw, 1.55rem);
		line-height: 1.15;
		min-height: 2.3em;   /* two lines on every slide, so all slides share one height */
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.hdme-hs__lead { max-width: 34ch; min-height: 4.65em; margin-inline: auto; font-size: 0.98rem; line-height: 1.55; }   /* room for three lines */
	/* Two compact buttons side by side. */
	.hdme-hs__actions { flex-wrap: nowrap; gap: 8px; margin: 16px 0 2px; }
	.hdme-hs__actions .hdme-btn { flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; padding: 0 8px; gap: 5px; border-radius: 10px; font-size: 13.5px; }
	.hdme-hs__long { display: none; }   /* "Check insurance" at phone width */
	.hdme-hs__actions .hdme-btn > span { white-space: normal; line-height: 1.15; text-align: center; }   /* wrap rather than clip on narrow phones */
	.hdme-hs__cta .hdme-hs__icon { display: none; }   /* no room for the arrow at phone width */
	.hdme-hs__trust { justify-content: center; gap: 6px 14px; margin-top: 12px; }
	.hdme-hs__trust li { gap: 5px; font-size: 12px; }
	.hdme-hs__trust .hdme-hs__icon { width: 14px; height: 14px; }

	.hdme-hs__nav { gap: 6px; margin-top: 10px; }
	.hdme-scope .hdme-hs .hdme-hs__arrow { display: none; }
	.hdme-scope .hdme-hs .hdme-hs__tab { height: 40px; padding: 0 13px; font-size: 13px; }
}

@media (max-width: 379px) {
	.hdme-hs__actions .hdme-btn { font-size: 13px; padding: 0 6px; }
}
@media (max-width: 339px) {
	.hdme-hs__actions .hdme-btn { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
	.hdme-hs__slide,
	.hdme-hs__slide.is-active { transition: none; }
	.hdme-hs__slide.is-active *,
	.hdme-scope .hdme-hs.is-playing .hdme-hs__tab.is-active { animation: none !important; }
	.hdme-hs__card, .hdme-hs__thumb, .hdme-hs__more, .hdme-hs__cta .hdme-hs__icon { transition: none; }
}
