/*
 * Seasonal Christmas theme. Loaded only when ChristmasThemeBean.active is true,
 * and only on storefront templates (never basket / checkout / payment).
 * Everything is scoped under .fks-xmas-* / .fx-* / html.fks-xmas so it can't leak.
 */

:root {
	--fks-xmas-red: #c8102e;
	--fks-xmas-green: #1a7f37;
	--fks-xmas-gold: #f2b705;
	--fks-xmas-snow: #ffffff;
	--fks-xmas-navy: #153467;
}

/* ---------- Christmas logo (Logo-christmas.svg, swapped in by topbar.xhtml) ---------- */
/* The SVG has headroom for the hat/snow: 39.3px tall keeps the letters at Logo.png's 22px. */
.logo-img-container .topbar-logo-img.fks-xmas-logo {
	height: 39.3px;
	position: relative;
	top: -5px;
	z-index: 3;
}
@media (max-width: 767px) {
	.logo-img-container .topbar-logo-img.fks-xmas-logo {
		height: 34px;
		top: -4px;
	}
}

/* ---------- Fairy lights (shared by header + footer strings) ---------- */
.fks-xmas-lights,
.fks-xmas-village {
	position: absolute;
	left: 0;
	pointer-events: none;
	overflow: visible;
}
/* along the bottom edge of the fixed header, clear of the logo and search box */
.fks-xmas-lights {
	top: calc(100% - 4px);
	z-index: 2;
}

.fx-wire {
	fill: none;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.fx-wire-a { stroke: #24452d; }
.fx-wire-b { stroke: #0c1d12; }
.fx-curl { stroke: #1b3824; stroke-width: 1.4; }
.fx-hook { fill: #9aa5b1; }
.fx-socket { fill: #1d3a24; stroke: #0c1d12; stroke-width: .6; }

.fx-bulb .lit,
.fx-bulb .glow {
	animation-duration: var(--d, 3s);
	animation-delay: var(--dl, 0s);
	animation-iteration-count: infinite;
}
.fx-bulb .glow {
	transform-box: fill-box;
	transform-origin: center;
	transition: transform .2s ease-out;
}

/* every bulb breathes in step (JS locks them to one shared clock) */
.fx-bulb .lit,
.fx-bulb .glow {
	animation-name: fx-pulse;
	animation-timing-function: ease-in-out;
}
@keyframes fx-pulse {
	0%, 100% { opacity: .25; }
	50% { opacity: 1; }
}
.fx-bulb .glow {
	animation-name: fx-pulse-glow;
}
@keyframes fx-pulse-glow {
	0%, 100% { opacity: .1; transform: scale(.7); }
	50% { opacity: 1; transform: scale(1.15); }
}

/* ---------- Footer village ---------- */
/* room above the footer for the rooftops (JS draws them 70px tall, 52px on phones) */
html.fks-xmas footer .new-footer-body {
	position: relative;
	margin-top: 56px;
}
@media (max-width: 767px) {
	html.fks-xmas footer .new-footer-body {
		margin-top: 44px;
	}
}
.fks-xmas-village {
	z-index: 1;
}
.fx-house { fill: var(--fks-xmas-navy); }
.fx-tree { fill: #0f3b2c; }
.fx-snowline {
	fill: none;
	stroke: #fff;
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.fx-snowline-thin { stroke-width: 2.4; }
.fx-window {
	fill: #ffd27a;
	animation: fx-window var(--d, 6s) ease-in-out infinite;
	animation-play-state: paused;
}
.fx-window-flicker { animation-play-state: running; }
.fx-window-bars {
	stroke: var(--fks-xmas-navy);
	stroke-width: 1.2;
}
@keyframes fx-window {
	0%, 100% { fill: #ffd27a; }
	50% { fill: #ffb347; }
	70% { fill: #4a3a1a; }
	75% { fill: #ffd27a; }
}
.fx-drift {
	fill: #fff;
	stroke: #d7e6f7;
	stroke-width: 1.5;
}

/* ---------- Baubles in the side margins (wide screens; JS decides) ---------- */
.fks-xmas-baubles {
	position: absolute;
	top: 80px; /* hangs from the bottom of the fixed header */
	left: 0;
	right: 0;
	height: 0;
	pointer-events: none;
	z-index: 1029; /* just under the fixed header (1030) */
}
.fks-bauble {
	position: absolute;
	top: 0;
	width: 30px;
	height: calc(var(--len, 100px) + 32px);
	transform-origin: 50% 0;
	animation: fks-swing var(--sw, 4s) ease-in-out var(--dl, 0s) infinite alternate;
}
/* the thread */
.fks-bauble::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	width: 1px;
	height: var(--len, 100px);
	background: linear-gradient(#d4b25a, #a8862f);
}
/* cap + ball */
.fks-bauble::after {
	content: "";
	position: absolute;
	left: 0;
	top: calc(var(--len, 100px) + 4px);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85) 0 3px, rgba(255, 255, 255, .25) 6px, transparent 11px),
		radial-gradient(circle at 50% 60%, var(--c, #c8102e) 40%, rgba(0, 0, 0, .45) 100%);
	box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .25);
}
/* gold cap, drawn as the element's own background just above the ball */
.fks-bauble {
	background: linear-gradient(90deg, #b8901f, #f3d27a 45%, #b8901f) no-repeat;
	background-size: 10px 7px;
	background-position: 50% calc(var(--len, 100px));
}
@keyframes fks-swing {
	from { transform: rotate(-5deg); }
	to { transform: rotate(5deg); }
}

/* ---------- Random decorations + snow caps (cards, product boxes, search) ---------- */
.fks-xmas-host {
	position: relative;
}
.fks-xmas-cap {
	position: absolute;
	left: -3px;
	right: -3px;
	top: -9px;
	height: 18px;
	z-index: 2;
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' viewBox='0 0 120 18'%3E%3Cpath d='M0 11 Q9 2 21 7 Q30 0 42 6 Q52 2 60 8 Q71 1 84 7 Q96 1 108 8 Q114 5 120 11 L120 13 Q116 17 112 13 L92 13 Q88 19 84 13 L62 14 Q57 20 52 14 L30 13 Q26 18 22 13 L0 13 Z' fill='%23fff' stroke='%23c4d8ef' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x;
	background-size: 120px 18px;
	filter: drop-shadow(0 1px 1px rgba(40, 70, 110, .15));
}
.fks-xmas-deco {
	position: absolute;
	z-index: 3;
	width: 36px;
	height: 42px;
	pointer-events: none;
	transform: rotate(var(--rot, 0deg));
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.fks-xmas-deco svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.fks-xmas-deco-tl { top: -16px; left: -12px; }
.fks-xmas-deco-tr { top: -16px; right: -12px; }
/* baubles hang from the top edge and sway */
.fks-xmas-deco-bauble.fks-xmas-deco-tl,
.fks-xmas-deco-bauble.fks-xmas-deco-tr {
	top: -2px;
	width: 26px;
	height: 38px;
	transform-origin: 50% 0;
	animation: fks-swing 3.6s ease-in-out infinite alternate;
}
.fks-xmas-deco-bauble.fks-xmas-deco-tl { left: 18px; }
.fks-xmas-deco-bauble.fks-xmas-deco-tr { right: 18px; }
/* holly tucked into the left edge of the header search box */
.fks-xmas-deco-search {
	left: -20px;
	top: 22px;
	width: 34px;
	height: 28px;
}
@media (max-width: 991px) {
	.fks-xmas-deco-search { display: none; }
}

/* ---------- Santa walking across the bottom of the screen ---------- */
.fks-santa {
	position: fixed;
	left: 0;
	bottom: 2px;
	z-index: 1029; /* under the header, snow and modals */
	pointer-events: auto;
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	will-change: transform;
}
.fks-santa-figure {
	width: 100%;
	height: 100%;
}
.fks-santa-left .fks-santa-figure {
	transform: scaleX(-1);
}
.fks-santa svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25));
}
/* Feet move backwards while planted, then lift and return forwards.
   The coat covers their attachment points. No head, torso or sack rotation. */
.fks-santa .santa-arm-wave { display: none; }
.fks-santa.waving .santa-arm-rest { display: none; }
.fks-santa.waving .santa-arm-wave { display: inline; }
.fks-santa.walking .santa-leg-f { animation: santa-stride var(--santa-stride, .675s) linear infinite; }
.fks-santa.walking .santa-leg-b { animation: santa-stride var(--santa-stride, .675s) linear infinite; animation-delay: var(--santa-half-stride, -.3375s); }
.fks-santa .santa-hand { transform-box: view-box; transform-origin: 124px 79px; }
.fks-santa.waving .santa-hand { animation: santa-wave .65s ease-in-out infinite; }
@keyframes santa-stride {
    0%, 100% { transform: translate(15px, 0); }
    50% { transform: translate(-15px, 0); }
    65% { transform: translate(-9px, -5px); }
    80% { transform: translate(6px, -6px); }
    90% { transform: translate(12px, -3px); }
}
@keyframes santa-wave {
    0%, 100% { transform: rotate(-7deg); }
    50% { transform: rotate(9deg); }
}
.fks-santa-bubble {
	position: absolute;
	bottom: 100%;
	left: 50%;
	margin-bottom: 4px;
	padding: 6px 12px;
	white-space: nowrap;
	transform: translateX(-50%) scale(.6);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
	background: #fff;
	color: var(--fks-xmas-red);
	font-weight: 700;
	font-size: 15px;
	border: 2px solid var(--fks-xmas-red);
	border-radius: 16px;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
}
.fks-santa-bubble::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	margin-left: -7px;
	border: 7px solid transparent;
	border-top-color: var(--fks-xmas-red);
}
.fks-santa.waving .fks-santa-bubble {
	opacity: 1;
	transform: translateX(-50%) scale(1);
}

/* ---------- Snow-capped primary buttons ---------- */
html.fks-xmas .btn-primary {
	position: relative;
}
html.fks-xmas .btn-primary::before {
	content: "";
	position: absolute;
	left: 4px;
	right: 4px;
	top: -4px;
	height: 8px;
	border-radius: 8px 8px 4px 4px;
	background:
		radial-gradient(circle at 15% 100%, var(--fks-xmas-snow) 4px, transparent 5px),
		radial-gradient(circle at 60% 100%, var(--fks-xmas-snow) 3px, transparent 4px),
		linear-gradient(var(--fks-xmas-snow), var(--fks-xmas-snow));
	background-size: 100% 100%, 100% 100%, 100% 5px;
	background-repeat: no-repeat;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
	pointer-events: none;
}

/* ---------- Festive banner ---------- */
.fks-xmas-banner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px 16px;
	position: relative;
	color: #fff;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	background:
		radial-gradient(circle at 12px 10px, #fff7dd55 1px, transparent 2px) 0 0 / 47px 37px,
		linear-gradient(100deg, #123e35, #22634d 50%, #123e35);
	border-bottom: 3px solid var(--fks-xmas-gold);
}
.fks-xmas-banner a {
	color: #fff;
	text-decoration: underline;
	font-weight: 600;
}
.fks-xmas-banner a:hover,
.fks-xmas-banner a:focus {
	color: var(--fks-xmas-gold);
}
/* ---------- Snow canvas + toggle ---------- */
.fks-xmas-snow {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 1030; /* above content, below Bootstrap modals (1050+) */
}

/* Bottom-right: the Tawk chat bubble owns bottom-left; sits above the ajax spinner (right 7px / bottom 7px). */
.fks-xmas-snow-toggle {
	position: fixed;
	right: 12px;
	bottom: 48px;
	z-index: 1031;
	width: 40px;
	height: 40px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--fks-xmas-navy);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
	opacity: .85;
}
.fks-xmas-snow-toggle:hover,
.fks-xmas-snow-toggle:focus-visible {
	opacity: 1;
}
.fks-xmas-snow-toggle[aria-pressed="false"] {
	background: #6b7280;
	text-decoration: line-through;
}

@media (max-width: 767px) {
	.fks-xmas-banner {
		font-size: 13px;
	}
}

/* Visitors who ask for less motion: lights pulse slowly (JS slows them), nothing moves;
   snow starts off but the snow button is still there. Santa doesn't visit. */
@media (prefers-reduced-motion: reduce) {
	.fx-window,
	.fks-bauble,
	.fks-xmas-deco {
		animation: none !important;
	}
	.fx-bulb .glow {
		animation-name: fx-pulse;
	}
}

@media print {
	.fks-xmas-lights,
	.fks-xmas-village,
	.fks-xmas-baubles,
	.fks-xmas-banner,
	.fks-xmas-snow,
	.fks-xmas-snow-toggle,
	.fks-xmas-deco,
	.fks-xmas-cap,
	.fks-santa {
		display: none !important;
	}
}

/* Evergreen framing is limited to homepage promotional banners. */
.banner-container .fks-garland-host { position: relative; overflow: visible; }
.fks-garland-host > .image-banner { overflow: hidden; }
.fks-promo-garland { position: absolute; inset: 0; overflow: visible; pointer-events: none; z-index: 3; }
@media print { .fks-promo-garland { display: none !important; } }
.fks-santa.dragging { cursor: grabbing; }
.fks-santa.dragging .fks-santa-figure { filter: drop-shadow(0 10px 8px #16372d50); }
.fks-santa:focus-visible { outline: 2px dashed #b78822; outline-offset: 3px; border-radius: 12px; }
.fks-santa-bubble { pointer-events: none; }

/* Rotate the complete figure, never individual limbs. The direction mirror stays intact. */
.fks-santa { --santa-facing: 1; }
.fks-santa-left { --santa-facing: -1; }
.fks-santa.dragging .fks-santa-figure {
    transform-origin: 50% 15%;
    animation: santa-dangle .85s ease-in-out infinite alternate;
}
.fks-santa.landing .fks-santa-figure {
    transform-origin: 50% 100%;
    animation: santa-land .28s ease-out both;
}
@keyframes santa-dangle {
    from { transform: rotate(-9deg) scaleX(var(--santa-facing)); }
    to { transform: rotate(9deg) scaleX(var(--santa-facing)); }
}
@keyframes santa-land {
    0% { transform: scale(var(--santa-facing), .9); }
    45% { transform: translateY(-6px) scale(var(--santa-facing), 1.02); }
    100% { transform: scale(var(--santa-facing), 1); }
}
@media (prefers-reduced-motion: reduce) {
    .fks-santa.dragging .fks-santa-figure, .fks-santa.landing .fks-santa-figure { animation: none; }
}

.fks-garland-light { animation: fks-garland-glow 2.6s ease-in-out infinite alternate; }
@keyframes fks-garland-glow { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fks-garland-light { animation: none; } }

/* Surprise is a facial expression only; the whole-body dangle keeps its existing pose. */
.fks-santa .santa-face-surprised { display: none; }
.fks-santa.dragging .santa-face-normal { display: none; }
.fks-santa.dragging .santa-face-surprised { display: inline; }
