/* Display Countdown – Llama. Colors come from settings via --dcm-* custom properties. */
.dcm-llama-countdown {
	--dcm-bg: #3d3763;
	--dcm-text: #fff;
	--dcm-accent: #fbeae2;
	box-sizing: border-box;
	background: var(--dcm-bg);
	color: var(--dcm-text);
	font-size: 15px;
	line-height: 1.4;
}

.dcm-llama-countdown *,
.dcm-llama-countdown *::before,
.dcm-llama-countdown *::after {
	box-sizing: inherit;
}

.dcm-llama-countdown__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	padding: 0.6em 1em;
}

.dcm-llama-countdown__body {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
	overflow-wrap: anywhere;
}

.dcm-llama-countdown__message a {
	color: inherit;
	text-decoration: underline;
}

.dcm-llama-countdown__timer {
	display: inline-block;
	margin: 0 0.25em;
	color: var(--dcm-accent);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Top bar */
.dcm-llama-countdown--top_bar {
	position: relative;
	z-index: 999;
	width: 100%;
}

.dcm-llama-countdown__dismiss {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75em;
	height: 2.75em;
	margin: -0.5em -0.5em -0.5em 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 1em;
	line-height: 1;
	cursor: pointer;
}

.dcm-llama-countdown__dismiss span {
	font-size: 1.5em;
}

.dcm-llama-countdown__dismiss:hover {
	background: rgba(255, 255, 255, 0.15);
}

.dcm-llama-countdown__dismiss:focus-visible {
	outline: 2px solid var(--dcm-accent);
	outline-offset: 2px;
}

/* Inline boxes: product page, cart, checkout */
.dcm-llama-countdown--product,
.dcm-llama-countdown--cart_checkout {
	margin: 1em 0;
	border-radius: 8px;
}

.dcm-llama-countdown--product .dcm-llama-countdown__body,
.dcm-llama-countdown--cart_checkout .dcm-llama-countdown__body {
	text-align: start;
}

.dcm-llama-countdown.is-ended .dcm-llama-countdown__timer {
	display: none;
}

.dcm-llama-countdown template {
	display: none;
}

.dcm-llama-countdown .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------
 * Christmas style: festive palette, ornaments, string lights, glowing
 * timer and CSS-only snow. Text contrast: white on #9e1b2c ≈ 7.6:1,
 * gold #ffd98a on #9e1b2c ≈ 5.7:1.
 * ------------------------------------------------------------------ */
.dcm-llama-countdown--style-christmas {
	--dcm-bg: #9e1b2c;
	--dcm-text: #fff;
	--dcm-accent: #ffd98a;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background:
		radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, 0.14), transparent 60%),
		linear-gradient(180deg, #b0202f 0%, #8e1626 100%);
	border-bottom: 4px solid transparent;
	border-image: repeating-linear-gradient(-45deg, #fff 0 8px, #c8102e 8px 16px) 4;
}

.dcm-llama-countdown--style-christmas .dcm-llama-countdown__inner {
	position: relative;
	z-index: 2;
	padding-inline: 3em;
}

.dcm-llama-countdown--style-christmas .dcm-llama-countdown__message {
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dcm-llama-countdown--style-christmas .dcm-llama-countdown__timer {
	padding: 0.1em 0.55em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.22);
	box-shadow: 0 0 0 1px rgba(255, 217, 138, 0.45) inset;
	animation: dcm-llama-glow 2s ease-in-out infinite;
}

.dcm-llama-countdown--style-christmas .dcm-llama-countdown__dismiss:hover {
	background: rgba(255, 255, 255, 0.18);
}

.dcm-llama-countdown--style-christmas.dcm-llama-countdown--product,
.dcm-llama-countdown--style-christmas.dcm-llama-countdown--cart_checkout {
	border-radius: 10px;
	border-image: none;
	border-bottom: 0;
	box-shadow: 0 6px 18px rgba(142, 22, 38, 0.25);
}

/* Decorative layer */
.dcm-llama-countdown__decor {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* Swinging ornaments */
.dcm-llama-countdown__ornament {
	position: absolute;
	top: -2px;
	color: rgba(255, 255, 255, 0.7);
	transform-origin: 50% 0;
	animation: dcm-llama-swing 3.2s ease-in-out infinite;
}

.dcm-llama-countdown__ornament--left {
	left: 0.9em;
}

.dcm-llama-countdown__ornament--right {
	right: 0.7em;
	animation-delay: -1.6s;
}

/* Top bar: keep the close button clear of the right ornament. */
.dcm-llama-countdown--style-christmas.dcm-llama-countdown--top_bar .dcm-llama-countdown__inner {
	padding-inline: 3em 2.6em;
}

/* Twinkling string lights along the bottom edge */
.dcm-llama-countdown__lights {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 2px;
	height: 6px;
	background:
		radial-gradient(circle, #ffd98a 0 2px, transparent 2.5px) 0 50% / 36px 6px repeat-x,
		radial-gradient(circle, #7fe0a8 0 2px, transparent 2.5px) 12px 50% / 36px 6px repeat-x,
		radial-gradient(circle, #8fd3ff 0 2px, transparent 2.5px) 24px 50% / 36px 6px repeat-x;
	animation: dcm-llama-twinkle 1.6s steps(2, jump-none) infinite;
}

/* Snow: two layers of radial-gradient flakes scrolling down at different speeds */
.dcm-llama-countdown__snow {
	position: absolute;
	inset: -120px -24px 0 0;
	opacity: 0.85;
	background-image:
		radial-gradient(circle at 20% 30%, #fff 0 1.6px, transparent 2px),
		radial-gradient(circle at 70% 10%, #fff 0 1.2px, transparent 1.6px),
		radial-gradient(circle at 45% 70%, #fff 0 2px, transparent 2.4px),
		radial-gradient(circle at 90% 55%, #fff 0 1.4px, transparent 1.8px),
		radial-gradient(circle at 8% 85%, #fff 0 1.1px, transparent 1.5px);
	background-size: 120px 120px;
	animation: dcm-llama-snow 9s linear infinite;
}

.dcm-llama-countdown__snow--far {
	opacity: 0.5;
	background-size: 70px 70px;
	animation-duration: 14s;
	animation-direction: normal;
	filter: blur(0.4px);
}

@keyframes dcm-llama-snow {

	from {
		transform: translate3d(0, 0, 0);
	}

	to {
		transform: translate3d(-20px, 120px, 0);
	}
}

@keyframes dcm-llama-swing {

	0%,
	100% {
		transform: rotate(-9deg);
	}

	50% {
		transform: rotate(9deg);
	}
}

@keyframes dcm-llama-glow {

	0%,
	100% {
		box-shadow: 0 0 0 1px rgba(255, 217, 138, 0.45) inset, 0 0 0 rgba(255, 217, 138, 0);
	}

	50% {
		box-shadow: 0 0 0 1px rgba(255, 217, 138, 0.8) inset, 0 0 14px rgba(255, 217, 138, 0.55);
	}
}

@keyframes dcm-llama-twinkle {

	0% {
		opacity: 1;
	}

	100% {
		opacity: 0.45;
	}
}

@media (max-width: 480px) {

	.dcm-llama-countdown {
		font-size: 14px;
	}

	.dcm-llama-countdown--style-christmas .dcm-llama-countdown__inner,
	.dcm-llama-countdown--style-christmas.dcm-llama-countdown--top_bar .dcm-llama-countdown__inner {
		padding-inline: 1.9em 0.5em;
	}

	.dcm-llama-countdown__ornament--right {
		display: none;
	}

	.dcm-llama-countdown__inner {
		padding: 0.5em 0.75em;
	}
}

@media (prefers-reduced-motion: reduce) {

	.dcm-llama-countdown * {
		transition: none !important;
		animation: none !important;
	}

	.dcm-llama-countdown__snow {
		display: none;
	}
}
