/* Christmas hours pop-up. Colours come from the theme (--brand, --brand-deep, --navy, --accent). */
.cmxh {
	--cmxh-brand: var(--brand, var(--cmxh-fallback, #0c71c3));
	--cmxh-brand-deep: var(--brand-deep, color-mix(in srgb, var(--cmxh-brand) 82%, #000));
	--cmxh-ink: var(--navy, #0d2033);
	--cmxh-gold: #f2c14e;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 1rem;
	font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
}
.cmxh[hidden] { display: none; }

.cmxh__backdrop {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--cmxh-brand) 55%, rgb(8 16 26 / .72));
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	animation: cmxh-fade .35s ease both;
}

.cmxh__card {
	position: relative;
	width: min(100%, 400px);
	margin-top: 84px; /* room for the tree above the card */
	padding: 4.4rem 2rem 2rem;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 30px 70px -20px rgb(8 16 26 / .55);
	text-align: center;
	color: var(--cmxh-ink);
	animation: cmxh-pop .45s cubic-bezier(.2, .9, .3, 1.25) both;
}

.cmxh__tree {
	position: absolute;
	left: 50%;
	top: -106px;
	width: 116px;
	height: auto;
	transform: translateX(-50%);
	filter: drop-shadow(0 8px 10px rgb(0 0 0 / .18));
	animation: cmxh-sway 4.5s ease-in-out infinite;
	transform-origin: 50% 100%;
}

.cmxh__close {
	position: absolute;
	top: .75rem;
	right: .75rem;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cmxh-ink);
	cursor: pointer;
}
.cmxh__close svg { width: 22px; height: 22px; fill: none; }
.cmxh__close:hover { background: color-mix(in srgb, var(--cmxh-brand) 10%, #fff); }

.cmxh__title {
	margin: 0 0 .75rem;
	font-size: clamp(1.35rem, 4.5vw, 1.6rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--cmxh-ink);
}
.cmxh__text {
	margin: 0 0 1.6rem;
	font-size: 1.02rem;
	line-height: 1.55;
	color: color-mix(in srgb, var(--cmxh-ink) 85%, #fff);
}

.cmxh__btn {
	display: block;
	width: 100%;
	max-width: 280px;
	margin: 0 auto;
	padding: .95rem 1.5rem;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--cmxh-brand), var(--cmxh-brand-deep));
	color: #fff;
	font-size: 1.05rem;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--cmxh-brand) 75%, transparent);
	transition: transform .15s ease, box-shadow .15s ease;
}
.cmxh__btn:hover, .cmxh__btn:focus-visible { transform: translateY(-1px); color: #fff; box-shadow: 0 14px 28px -8px color-mix(in srgb, var(--cmxh-brand) 85%, transparent); }
.cmxh__card:focus { outline: none; }
.cmxh__close:focus-visible, .cmxh__btn:focus-visible { outline: 2px solid var(--cmxh-brand); outline-offset: 3px; }

/* The tree drops in with a little bounce and its lights twinkle. */
.cmxh__card .cmxh__tree { animation: cmxh-drop .8s cubic-bezier(.2, .9, .3, 1.35) .15s both, cmxh-sway 4.5s ease-in-out 1s infinite; }
.cmxh__light { transform-box: fill-box; transform-origin: center; animation: cmxh-blink 1.6s ease-in-out infinite; }
.cmxh__light--2, .cmxh__light--5 { animation-delay: -.4s; }
.cmxh__light--3, .cmxh__light--7 { animation-delay: -.8s; }
.cmxh__light--4, .cmxh__light--8 { animation-delay: -1.2s; }
.cmxh__light--6 { animation-delay: -.2s; }
.cmxh__garland { animation: cmxh-garland 3s linear infinite; }
/* The star stays still and glows: a warm halo behind it that brightens and fades. */
.cmxh__glow { animation: cmxh-glow 2.4s ease-in-out infinite; }

/* Gentle snow falling behind the card. */
.cmxh__snow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cmxh__snow i { position: absolute; top: -12px; width: 7px; height: 7px; border-radius: 50%; background: #fff; opacity: .85; animation: cmxh-snow 9s linear infinite; }
.cmxh__snow i:nth-child(3n) { width: 5px; height: 5px; opacity: .6; animation-duration: 12s; }
.cmxh__snow i:nth-child(4n) { width: 9px; height: 9px; opacity: .5; animation-duration: 14s; }
.cmxh__snow i:nth-child(1) { left: 4%; animation-delay: -1s; }
.cmxh__snow i:nth-child(2) { left: 11%; animation-delay: -6s; }
.cmxh__snow i:nth-child(3) { left: 17%; animation-delay: -3s; }
.cmxh__snow i:nth-child(4) { left: 23%; animation-delay: -9s; }
.cmxh__snow i:nth-child(5) { left: 29%; animation-delay: -4.5s; }
.cmxh__snow i:nth-child(6) { left: 35%; animation-delay: -11s; }
.cmxh__snow i:nth-child(7) { left: 41%; animation-delay: -2s; }
.cmxh__snow i:nth-child(8) { left: 47%; animation-delay: -7.5s; }
.cmxh__snow i:nth-child(9) { left: 53%; animation-delay: -5s; }
.cmxh__snow i:nth-child(10) { left: 59%; animation-delay: -12s; }
.cmxh__snow i:nth-child(11) { left: 65%; animation-delay: -.5s; }
.cmxh__snow i:nth-child(12) { left: 71%; animation-delay: -8s; }
.cmxh__snow i:nth-child(13) { left: 77%; animation-delay: -3.5s; }
.cmxh__snow i:nth-child(14) { left: 83%; animation-delay: -10s; }
.cmxh__snow i:nth-child(15) { left: 88%; animation-delay: -6.5s; }
.cmxh__snow i:nth-child(16) { left: 93%; animation-delay: -1.5s; }
.cmxh__snow i:nth-child(17) { left: 97%; animation-delay: -9.5s; }
.cmxh__snow i:nth-child(18) { left: 8%; animation-delay: -13s; }

/* Sparkles and rings floating around the card. */
.cmxh__spark, .cmxh__ring { position: absolute; pointer-events: none; animation: cmxh-float 5s ease-in-out infinite; }
.cmxh__spark { animation-name: cmxh-float, cmxh-sparkle; animation-duration: 5s, 1.8s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; width: 18px; height: 18px; background: var(--cmxh-gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.cmxh__ring { width: 12px; height: 12px; border: 2px solid color-mix(in srgb, var(--accent, #c9a2ff) 70%, #fff); border-radius: 50%; }
.cmxh__spark--1 { left: calc(50% - 230px); top: calc(50% - 180px); }
.cmxh__spark--2 { left: calc(50% + 150px); top: calc(50% - 230px); animation-delay: -1.5s; width: 14px; height: 14px; }
.cmxh__spark--3 { left: calc(50% + 230px); top: calc(50% - 120px); animation-delay: -3s; width: 12px; height: 12px; }
.cmxh__ring--1 { left: calc(50% - 215px); top: calc(50% - 130px); animation-delay: -2s; }
.cmxh__ring--2 { left: calc(50% + 200px); top: calc(50% - 250px); animation-delay: -.8s; }
.cmxh__ring--3 { left: calc(50% + 205px); top: calc(50% - 60px); animation-delay: -3.6s; }

@keyframes cmxh-fade { from { opacity: 0; } }
@keyframes cmxh-pop { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes cmxh-sway { 0%, 100% { transform: translateX(-50%) rotate(-2deg); } 50% { transform: translateX(-50%) rotate(2deg); } }
@keyframes cmxh-glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes cmxh-drop { from { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(.7); } 70% { opacity: 1; } }
@keyframes cmxh-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@keyframes cmxh-garland { to { stroke-dashoffset: -14; } }
@keyframes cmxh-snow { 0% { transform: translate(0, 0); } 25% { transform: translate(10px, 25vh); } 50% { transform: translate(-8px, 50vh); } 75% { transform: translate(8px, 75vh); } 100% { transform: translate(0, 105vh); } }
@keyframes cmxh-sparkle { 0%, 100% { scale: 1; } 50% { scale: .55; } }
@keyframes cmxh-float { 0%, 100% { transform: translateY(0) rotate(0); opacity: .95; } 50% { transform: translateY(-10px) rotate(20deg); opacity: .6; } }

@media (max-width: 560px) {
	.cmxh__card { padding: 4rem 1.4rem 1.6rem; }
	.cmxh__spark--1, .cmxh__ring--1 { left: 6%; }
	.cmxh__spark--3, .cmxh__ring--3, .cmxh__ring--2, .cmxh__spark--2 { left: auto; right: 6%; }
}

@media (prefers-reduced-motion: reduce) {
	.cmxh *, .cmxh__backdrop { animation: none !important; transition: none !important; }
}
