/* WH Countdown — frontend (6 layouts, volledige kleurcontrole)
 * Webhouse B.V. — gescoped onder .whcd, lettertype komt van het thema.
 *
 * Kleurvariabelen (optioneel inline gezet door de timer):
 *   --whcd-accent      accentkleur (altijd gezet)
 *   --whcd-bg-top/bottom  achtergrond van blokken/paneel (leeg = layout-standaard)
 *   --whcd-fg          cijfer-/tekstkleur (leeg = layout-standaard)
 *   --whcd-lab         labelkleur (leeg = standaard grijs)
 *   --whcd-track       baan-/ringbaankleur (leeg = standaard)
 */

.whcd,
.whcd * {
	box-sizing: border-box;
}

.whcd {
	--whcd-accent: #e11d48;
	--whcd-lab: #94a3b8;
	--whcd-track: rgba(148, 163, 184, 0.25);

	display: block;
	width: 100%;
	max-width: 640px;
	margin: 1.5em 0;
	text-align: center;
	font-family: inherit;
	line-height: 1.2;
}

.whcd-title {
	font-size: clamp(1rem, 2.4vw, 1.35rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--whcd-accent);
	margin: 0 0 0.15em;
}

.whcd-state {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--whcd-lab);
	margin: 0 0 0.7em;
}

.whcd-state:empty { display: none; }

.whcd-lab {
	display: block;
	margin-top: 0.35em;
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--whcd-lab);
}

.whcd-expired {
	margin-top: 0.2em;
	padding: 0.9em 1em;
	border-radius: 12px;
	background: linear-gradient(180deg, var(--whcd-bg-top, #1e293b) 0%, var(--whcd-bg-bottom, #0f172a) 100%);
	color: var(--whcd-fg, #ffffff);
	font-weight: 700;
	font-size: 1rem;
}

/* ============================================================
   1) BLOKKEN (cards)
   ============================================================ */
.whcd-cards {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(8px, 2vw, 16px);
}

.whcd-cards .whcd-cell {
	position: relative;
	flex: 1 1 0;
	min-width: 64px;
	max-width: 120px;
	padding: 0.7em 0.4em 0.6em;
	border-radius: 14px;
	background: linear-gradient(180deg, var(--whcd-bg-top, #1e293b) 0%, var(--whcd-bg-bottom, #0f172a) 100%);
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
	overflow: hidden;
}

.whcd-cards .whcd-cell::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--whcd-accent);
	opacity: 0.85;
}

.whcd-cards .whcd-num {
	display: block;
	font-size: clamp(1.7rem, 6.5vw, 2.8rem);
	font-weight: 800;
	color: var(--whcd-fg, #ffffff);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	letter-spacing: -0.02em;
}

.whcd-cards .whcd-tick .whcd-num { animation: whcd-pop 0.45s ease; }
.whcd-cards .whcd-tick::after {
	content: "";
	position: absolute;
	left: 50%; bottom: 0;
	width: 40%; height: 3px;
	transform: translateX(-50%);
	background: var(--whcd-accent);
	border-radius: 3px;
	animation: whcd-flash 0.45s ease;
}

@keyframes whcd-pop {
	0% { transform: translateY(0); }
	35% { transform: translateY(-3px); }
	100% { transform: translateY(0); }
}
@keyframes whcd-flash {
	0% { opacity: 0.9; width: 60%; }
	100% { opacity: 0; width: 20%; }
}

/* ============================================================
   2) FLIP
   ============================================================ */
.whcd-flip {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(8px, 2vw, 16px);
	perspective: 600px;
}

.whcd-flip .whcd-fcell {
	position: relative;
	flex: 1 1 0;
	min-width: 64px;
	max-width: 120px;
	padding: 0.7em 0.4em 0.6em;
	border-radius: 12px;
	background: linear-gradient(180deg, var(--whcd-bg-top, #1e293b) 0%, var(--whcd-bg-bottom, #0f172a) 100%);
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
	overflow: hidden;
}

.whcd-flip .whcd-fhinge {
	position: absolute;
	left: 0; right: 0;
	top: calc(0.7em + 0.55em);
	height: 1px;
	background: rgba(0, 0, 0, 0.45);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
	pointer-events: none;
}

.whcd-flip .whcd-fnum {
	display: block;
	font-size: clamp(1.7rem, 6.5vw, 2.8rem);
	font-weight: 800;
	color: var(--whcd-fg, #ffffff);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	transform-origin: center top;
	backface-visibility: hidden;
}

.whcd-flip .whcd-flipping .whcd-fnum { animation: whcd-flip 0.5s cubic-bezier(0.3, 0.8, 0.4, 1); }
.whcd-flip .whcd-flipping { box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28), inset 0 0 0 1px var(--whcd-accent); }

@keyframes whcd-flip {
	0% { transform: rotateX(-90deg); opacity: 0.2; }
	60% { transform: rotateX(12deg); opacity: 1; }
	100% { transform: rotateX(0); }
}

/* ============================================================
   3) RINGEN
   ============================================================ */
.whcd-rings {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(10px, 2.5vw, 22px);
}

.whcd-rings .whcd-ring {
	position: relative;
	width: clamp(64px, 18vw, 92px);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.whcd-rings .whcd-ring-svg {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1 / 1;
}

.whcd-rings .whcd-ring-track {
	fill: none;
	stroke: var(--whcd-track);
	stroke-width: 5;
}

.whcd-rings .whcd-ring-arc {
	fill: none;
	stroke: var(--whcd-accent);
	stroke-width: 5;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.6s linear;
}

.whcd-rings .whcd-ring-num {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: clamp(64px, 18vw, 92px);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(1.1rem, 3.6vw, 1.5rem);
	font-weight: 800;
	color: var(--whcd-fg, #0f172a);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

.whcd-rings .whcd-ring .whcd-lab { position: static; margin-top: 0.2em; }

/* ============================================================
   4) MINIMAAL
   ============================================================ */
.whcd-min {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	gap: 0.12em;
	flex-wrap: wrap;
	color: var(--whcd-fg, #0f172a);
}

.whcd-min-num {
	display: inline-flex;
	align-items: baseline;
	font-size: clamp(1.8rem, 6vw, 2.6rem);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	letter-spacing: -0.02em;
}

.whcd-min-u {
	font-size: 0.42em;
	font-weight: 700;
	margin-left: 0.12em;
	color: var(--whcd-accent);
	text-transform: lowercase;
}

.whcd-min .whcd-colon {
	font-size: clamp(1.8rem, 6vw, 2.6rem);
	font-weight: 700;
	color: var(--whcd-accent);
	animation: whcd-blink 1s steps(1) infinite;
}

.whcd-min-days { margin-right: 0.25em; }

@keyframes whcd-blink {
	0%, 50% { opacity: 1; }
	51%, 100% { opacity: 0.25; }
}

/* ============================================================
   5) DIGITAAL (LED-paneel)
   ============================================================ */
.whcd-digital { display: flex; justify-content: center; }

.whcd-digital .whcd-dpanel {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.15em;
	padding: 0.7em 1em;
	border-radius: 14px;
	background:
		radial-gradient(120% 140% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
		linear-gradient(180deg, var(--whcd-bg-top, #0b1220) 0%, var(--whcd-bg-bottom, #060a14) 100%);
	box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.whcd-digital .whcd-dcell {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 1.7em;
}

.whcd-digital .whcd-dnum {
	font-size: clamp(1.6rem, 6vw, 2.6rem);
	font-weight: 800;
	letter-spacing: 0.06em;
	color: var(--whcd-fg, var(--whcd-accent));
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	text-shadow: 0 0 10px color-mix(in srgb, var(--whcd-accent) 55%, transparent);
}

.whcd-digital .whcd-dcell .whcd-lab { color: rgba(148, 163, 184, 0.8); }

.whcd-digital .whcd-dcolon {
	font-size: clamp(1.6rem, 6vw, 2.6rem);
	font-weight: 800;
	line-height: 1;
	color: var(--whcd-accent);
	opacity: 0.85;
	align-self: flex-start;
	animation: whcd-blink 1s steps(1) infinite;
}

.whcd-digital .whcd-dcell-s .whcd-dnum { animation: whcd-glow 1s ease-in-out infinite; }

@keyframes whcd-glow {
	0%, 100% { text-shadow: 0 0 8px color-mix(in srgb, var(--whcd-accent) 40%, transparent); }
	50% { text-shadow: 0 0 16px color-mix(in srgb, var(--whcd-accent) 80%, transparent); }
}

/* ============================================================
   6) BALK
   ============================================================ */
.whcd-bar { width: 100%; }

.whcd-bar .whcd-bar-label {
	font-size: clamp(1.3rem, 5vw, 2rem);
	font-weight: 800;
	color: var(--whcd-fg, #0f172a);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	letter-spacing: 0.01em;
	margin-bottom: 0.45em;
}

.whcd-bar .whcd-bar-track {
	position: relative;
	height: 18px;
	border-radius: 999px;
	background: var(--whcd-track);
	overflow: hidden;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
}

.whcd-bar .whcd-bar-fill {
	height: 100%;
	width: 100%;
	border-radius: 999px;
	background-color: var(--whcd-accent);
	background-image: linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.18) 25%, transparent 25%,
		transparent 50%, rgba(255, 255, 255, 0.18) 50%,
		rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent
	);
	background-size: 1.2em 1.2em;
	animation: whcd-stripes 1s linear infinite;
	transition: width 0.6s linear;
}

@keyframes whcd-stripes {
	0% { background-position: 0 0; }
	100% { background-position: 1.2em 0; }
}

/* ============================================================
   States + responsive + reduced motion
   ============================================================ */
.whcd--pre .whcd-body { opacity: 0.92; }

.whcd-fallback {
	font-weight: 700;
	color: var(--whcd-lab);
}

@media (prefers-reduced-motion: reduce) {
	.whcd-cards .whcd-tick .whcd-num,
	.whcd-flip .whcd-flipping .whcd-fnum,
	.whcd-digital .whcd-dcell-s .whcd-dnum { animation: none; }
	.whcd-cards .whcd-tick::after { animation: none; opacity: 0; }
	.whcd-min .whcd-colon,
	.whcd-digital .whcd-dcolon { animation: none; }
	.whcd-bar .whcd-bar-fill { animation: none; }
}

@media (max-width: 380px) {
	.whcd-cards .whcd-cell,
	.whcd-flip .whcd-fcell { min-width: 58px; }
}

/* ============================================================
   Uitlijning (homepage mobiel/desktop, productpagina)
   ============================================================ */
.whcd--align-center { margin-left: auto; margin-right: auto; text-align: center; }
.whcd--align-left { margin-left: 0; margin-right: auto; text-align: left; }
.whcd--align-right { margin-left: auto; margin-right: 0; text-align: right; }

.whcd--align-left .whcd-cards,
.whcd--align-left .whcd-flip,
.whcd--align-left .whcd-rings,
.whcd--align-left .whcd-digital,
.whcd--align-left .whcd-min { justify-content: flex-start; }

.whcd--align-right .whcd-cards,
.whcd--align-right .whcd-flip,
.whcd--align-right .whcd-rings,
.whcd--align-right .whcd-digital,
.whcd--align-right .whcd-min { justify-content: flex-end; }
