/* WooCommerce Hero Slider
   Theme it by overriding the variables on .whs, or set bg/fg per slide in the shortcode. */

.whs {
	--whs-fg: #fff;
	--whs-font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--whs-pad: clamp(24px, 5vw, 72px);
	--whs-ease: cubic-bezier(.2, .7, .2, 1);

	position: relative;
	width: 100%;
	overflow: hidden;
	isolation: isolate;
	font-family: var(--whs-font);
	color: var(--whs-fg);
	transition: color .4s ease;
}
.whs *,
.whs *::before,
.whs *::after { box-sizing: border-box; }

/* ---------- Track: all slides share one grid cell, so height follows the tallest ---------- */

.whs .whs__track { display: grid; margin: 0; padding: 0; }

.whs .whs__slide {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	min-height: clamp(480px, 72vh, 700px);
	background: var(--s-bg);
	color: var(--s-fg);

	/* Leaving slide stays put underneath, then hides once the new one has faded in. */
	opacity: 0;
	visibility: hidden;
	transition: opacity 0s linear .55s, visibility 0s linear .55s;
}
.whs .whs__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	transition: opacity .55s ease, visibility 0s;
}

/* ---------- Copy ---------- */

.whs .whs__copy {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 20px;
	padding: var(--whs-pad);
	padding-bottom: calc(var(--whs-pad) + 56px); /* room for the controls */
}

.whs .whs__badge {
	padding: 4px 14px;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.4;
}

.whs .whs__headline {
	margin: 0;
	padding: 0;
	max-width: 11em;
	font-family: inherit;
	font-size: clamp(2.5rem, 6.2vw, 5.5rem);
	font-weight: 700;
	line-height: .96;
	letter-spacing: -.03em;
	color: inherit;
	text-transform: none;
	text-wrap: balance;
}
.whs .whs__slide.is-active .whs__headline {
	animation: whs-rise .75s var(--whs-ease) both;
}

.whs .whs__text {
	margin: 0;
	max-width: 38ch;
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	line-height: 1.5;
	color: inherit;
	opacity: .9;
}

.whs .whs__price {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 500;
	color: inherit;
}
.whs .whs__price del { opacity: .6; margin-right: .4em; }
.whs .whs__price ins { text-decoration: none; font-weight: 700; }

.whs .whs__btn {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	padding: 0 30px;
	border-radius: 999px;
	background: var(--s-fg);
	color: var(--s-bg);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: transform .2s ease;
}
.whs .whs__btn:hover { transform: translateY(-2px); color: var(--s-bg); }
.whs .whs__btn:focus-visible { outline: 3px solid var(--s-fg); outline-offset: 4px; }

/* ---------- Media ---------- */

.whs .whs__media { position: relative; min-height: 100%; overflow: hidden; }
.whs .whs__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}
/* No image: quiet ring pattern so the slide still has a right-hand side. */
.whs .whs__media--empty::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-radial-gradient(circle at 62% 46%, transparent 0 38px, currentColor 38px 40px);
	opacity: .14;
}

/* ---------- Controls ---------- */

.whs .whs__controls {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 0 var(--whs-pad) 28px;
	pointer-events: none;
}
.whs .whs__controls > * { pointer-events: auto; }
.whs .whs__left,
.whs .whs__arrows { display: flex; align-items: center; gap: 14px; }
.whs .whs__arrows { gap: 10px; }

.whs .whs__controls button {
	appearance: none;
	margin: 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}
.whs .whs__controls button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Progress bars double as slide pickers */
.whs .whs__bars { display: flex; gap: 6px; }
.whs .whs__bar {
	position: relative;
	width: clamp(28px, 4.5vw, 52px);
	height: 24px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
}
.whs .whs__bar::before,
.whs .whs__bar-fill {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 3px;
	margin-top: -1.5px;
	border-radius: 2px;
	background: currentColor;
}
.whs .whs__bar::before { opacity: .3; }
.whs .whs__bar-fill { transform: scaleX(0); transform-origin: left center; }
.whs .whs__bar.is-active .whs__bar-fill { transform: scaleX(1); }
.whs.has-autoplay .whs__bar.is-active .whs__bar-fill {
	transform: scaleX(0);
	animation: whs-fill var(--whs-duration, 6000ms) linear forwards;
}
.whs.is-paused .whs__bar-fill,
.whs.is-hover .whs__bar-fill,
.whs.is-focus .whs__bar-fill,
.whs.is-hidden .whs__bar-fill { animation-play-state: paused !important; }

/* Pause / play */
.whs .whs__toggle {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	background: none;
	color: inherit;
}
.whs .whs__i-play { display: none; }
.whs.is-paused .whs__i-play { display: block; }
.whs.is-paused .whs__i-pause { display: none; }
.whs:not(.has-autoplay) .whs__toggle { display: none; }

/* Arrows */
.whs .whs__arrow {
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #14141a;
	transition: transform .2s ease;
}
.whs .whs__arrow:hover { transform: scale(1.07); }

.whs.is-single .whs__controls { display: none; }

/* ---------- Motion ---------- */

@keyframes whs-fill { to { transform: scaleX(1); } }
@keyframes whs-rise {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.whs .whs__slide,
	.whs .whs__slide.is-active { transition: none; }
	.whs .whs__slide.is-active .whs__headline { animation: none; }
	.whs .whs__btn,
	.whs .whs__arrow { transition: none; }
}

/* ---------- Mobile: image on top, copy underneath ---------- */

@media (max-width: 800px) {
	.whs .whs__slide {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		min-height: 0;
	}
	.whs .whs__media { order: -1; aspect-ratio: 4 / 3; min-height: 0; }
	.whs .whs__copy {
		justify-content: flex-start;
		gap: 16px;
		padding-bottom: calc(var(--whs-pad) + 64px);
	}
	.whs .whs__headline { font-size: clamp(2.1rem, 9vw, 3rem); }
}
