/* Scoped visual changes. Only the decorative scene is clipped; menus remain outside it. */
body.jfht-active.jfht-header-enabled .header-middle,
body.jfht-active.jfht-header-enabled .jfht-header {
	--ts-hd-middle-color: #f7f1eb;
	--ts-hd-middle-bg: #171724;
	position: relative !important;
	isolation: isolate;
	z-index: 50;
	overflow: visible !important;
	color: #f7f1eb;
	background: radial-gradient(ellipse at 78% 35%, rgba(238, 126, 43, .36) 0%, transparent 38%),
		radial-gradient(ellipse at 18% 105%, rgba(93, 56, 116, .46) 0%, transparent 44%),
		linear-gradient(110deg, #24283d 0%, #3b2e45 48%, #62402f 100%) !important;
	border-bottom: 2px solid #d97929 !important;
	box-shadow: inset 0 1px rgba(255, 229, 184, .18), 0 3px 18px rgba(17, 13, 23, .2);
}

body.jfht-active .jfht-header > .jfht-content,
body.jfht-active.jfht-header-enabled .header-middle > .container {
	position: relative;
	z-index: 2;
	overflow: visible !important;
	background: transparent !important;
}

body.jfht-active .jfht-header > .jfht-scene {
	position: absolute !important;
	inset: 0;
	z-index: 0 !important;
	display: block;
	overflow: hidden;
	contain: paint;
	pointer-events: none !important;
	user-select: none;
}

.jfht-scene *, .jfht-scroll-layer, .jfht-scroll-layer * {
	pointer-events: none !important;
	user-select: none;
}

.jfht-rain-field {
	position: absolute;
	inset: -80% -12%;
	opacity: .27;
	background-image: repeating-linear-gradient(108deg, transparent 0 22px, rgba(209, 224, 255, .27) 23px 24px, transparent 25px 45px);
	background-size: 88px 150px;
	transform: rotate(3deg);
	animation: jfht-rain-fall 1.25s linear infinite;
}

.jfht-moon {
	position: absolute;
	top: -75px;
	left: 68%;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(244, 175, 103, .09), rgba(244, 175, 103, .035) 45%, transparent 70%);
}


.jfht-lightning-video {
	position: absolute !important;
	inset: -26% -8% -30% -8%;
	z-index: 0;
	display: block;
	width: 116% !important;
	height: 156% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: center 20%;
	background: #000;
	mix-blend-mode: screen;
	opacity: .72;
	filter: contrast(1.18) brightness(1.12) saturate(.72);
	pointer-events: none !important;
}

.jfht-pumpkin-wrap {
	position: absolute;
	bottom: -18px;
	width: var(--jfht-pumpkin-size, 118px);
	height: var(--jfht-pumpkin-size, 118px);
	margin: 0;
	z-index: 1;
	filter: drop-shadow(0 0 12px rgba(236, 115, 25, .42)) drop-shadow(0 0 24px rgba(255, 161, 54, .18));
}

.jfht-pumpkin-wrap-left { left: -4px; transform: rotate(-4deg); }
.jfht-pumpkin-wrap-right { right: -4px; transform: rotate(4deg); }

.jfht-pumpkin {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	object-fit: contain;
	margin: 0 !important;
	background: transparent !important;
}

.jfht-pumpkin-right { transform: scaleX(-1); }

body.jfht-active .jfht-header .account-control > a,
body.jfht-active .jfht-header .cart-control,
body.jfht-active .jfht-header .cart-control .woocommerce-Price-amount,
body.jfht-active .jfht-header .search-icon {
	color: #f7f1eb !important;
}

body.jfht-active .jfht-header .account-control > a:hover,
body.jfht-active .jfht-header .cart-control:hover { color: #ffc485 !important; }

body.jfht-active .jfht-header .search-button input[type='submit'] {
	color: #201725 !important;
	background: #f3a050 !important;
	border-color: #f3a050 !important;
}

body.jfht-active .jfht-header .search-table { border-color: #f3a050 !important; }
body.jfht-active .jfht-header .search-field input[type='text'] { color: #20212b; background: #fff; }

/* Preserve theme positioning, hover handlers and cart-fragment replacements. */
body.jfht-active .jfht-header .dropdown-container {
	z-index: 10000 !important;
	color: #20212b;
	--ts-hd-middle-color: #20212b;
}

body.jfht-active .jfht-header .dropdown-container .form-content {
	color: #20212b;
	background-color: #fff;
	border-top: 2px solid #df843b;
}

body.jfht-active .jfht-header .jfht-logo-host {
	position: relative !important;
	display: inline-block;
	vertical-align: middle;
	line-height: 0;
	isolation: isolate;
	overflow: visible !important;
}

body.jfht-active .jfht-header .jfht-original-logo {
	/* Swap atomically: crossfading exposes both logos at once. */
	transition: none !important;
}

body.jfht-active .jfht-header .jfht-logo-media-ready .jfht-original-logo,
body.jfht-active .jfht-header .jfht-logo-media-ready img:not(.jfht-logo-media) {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

body.jfht-active .jfht-header .jfht-logo-media {
	position: absolute !important;
	left: 50%;
	top: 50%;
	z-index: 4;
	display: block !important;
	width: 118% !important;
	max-width: none !important;
	height: auto !important;
	margin: 0 !important;
	transform: translate(-50%, -50%);
	object-fit: contain;
	background: transparent !important;
	pointer-events: none !important;
	user-select: none;
	filter: drop-shadow(0 0 3px rgba(255, 148, 61, .3));
	opacity: 0;
	transition: none !important;
}

body.jfht-active .jfht-header .jfht-logo-media-ready .jfht-logo-media {
	opacity: 1;
}

body.jfht-active .jfht-header .jfht-logo-host::before,
body.jfht-active .jfht-header .jfht-logo-host::after {
	content: none !important;
	display: none !important;
}

body.jfht-active.jfht-header-enabled .header-top { border-bottom-color: rgba(239, 158, 77, .24); }

/* Suppress the old visual layers while Halloween is active. */
body.jfht-active.jfht-header-enabled .jfas-header-leaf-field,
body.jfht-active.jfht-header-enabled .jfas-logo-autumn,
body.jfht-active.jfht-header-enabled .jfas-corner-decorations,
body.jfht-active.jfht-header-enabled .jfas-corner,
body.jfht-active.jfht-scroll-enabled .jfas-scroll-leaf {
	display: none !important;
}

/* Keep the browser scrollbar draggable; the wet trail is a click-through canvas. */
html.jfht-scrollbar { scrollbar-color: #66872d #171c13; }
@supports selector(::-webkit-scrollbar) {
	html.jfht-scrollbar { scrollbar-color: auto; scrollbar-width: auto; }
}
html.jfht-scrollbar::-webkit-scrollbar { width: 14px; height: 14px; }
html.jfht-scrollbar::-webkit-scrollbar-track { background: #171c13; }
html.jfht-scrollbar::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
html.jfht-scrollbar::-webkit-scrollbar-thumb {
	min-height: 40px;
	border: 2px solid #171c13;
	border-radius: 20px;
	background: linear-gradient(90deg, #263d13 0%, #698c2a 18%, #d5e58c 30%, #97b840 39%, #536f1c 68%, #1d340d 100%);
	box-shadow: inset 0 1px 2px rgba(243,255,184,.55), inset 0 -2px 3px rgba(5,19,3,.65);
}
html.jfht-scrollbar::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(90deg, #304617, #789f36 19%, #e3edab 31%, #a9c453 40%, #607c24 70%, #223b11);
}
html.jfht-scrollbar::-webkit-scrollbar-corner { background: #171c13; }
.jfht-scroll-layer.jfht-scroll-slime {
	position: fixed !important;
	inset: 0 0 0 auto !important;
	z-index: 2147483000;
	display: block !important;
	width: 64px !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	border: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	opacity: 0;
	contain: strict;
	pointer-events: none !important;
	user-select: none;
}
.jfht-scroll-layer.jfht-slime-active { opacity: 1; }
@media (max-width: 767px), (max-width: 1024px) and (pointer: coarse) {
	.jfht-scroll-layer.jfht-scroll-slime { width: 36px !important; }
}

/* Optional visual reskin of the existing offer. Its campaign logic is untouched. */
body.jfht-active.jfht-offer-enabled .jfas-floating-trigger {
	background: linear-gradient(120deg, #242033, #171a27) !important;
	border-color: #ef9b44 !important;
	box-shadow: 0 8px 24px rgba(24, 15, 33, .28), 0 0 0 4px rgba(237, 154, 68, .1);
}

body.jfht-active.jfht-offer-enabled .jfas-floating-leaf {
	background-image: url('../images/pumpkin.png') !important;
	background-position: center !important;
	background-size: contain !important;
	filter: drop-shadow(0 0 5px rgba(227, 139, 38, .3));
}

body.jfht-active.jfht-offer-enabled .jfas-floating-copy small { color: #ffd298; }
body.jfht-active.jfht-offer-enabled .jfas-sale-wrap {
	--jfas-navy: #241d30;
	--jfas-gold: #f4ad58;
	--jfas-rust: #8d442a;
}
body.jfht-active.jfht-offer-enabled .jfas-sale-banner {
	background: radial-gradient(circle at 4% 10%, rgba(193, 89, 36, .27), transparent 48%), linear-gradient(115deg, #191725, #362339) !important;
}
body.jfht-active.jfht-offer-enabled .jfas-eyebrow { color: #ffc281; }
body.jfht-active.jfht-offer-enabled .jfas-claim-button,
body.jfht-active.jfht-offer-enabled .jfas-shop-link {
	background: #eda150 !important;
	color: #251925 !important;
}
body.jfht-active.jfht-offer-enabled .jfas-leaf-field,
body.jfht-active.jfht-offer-enabled .jfas-win-leaf { display: none !important; }
body.jfht-active.jfht-offer-enabled .jfas-sale-banner::before {
	background: url('../images/pumpkin.png') 3% 100% / 100px auto no-repeat;
	opacity: .12;
}

/* The earned code remains available for manual application, including offline checks. */
body.jfht-active .jfas-code-line:not([hidden]) { display: block !important; overflow-wrap: anywhere; }
body.jfht-active .jfas-code { user-select: all; }
.jfht-code-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.jfht-code-actions button {
	flex: 1 1 110px;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid #b7692d;
	border-radius: 6px;
	background: #fff7ec;
	color: #352039;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
}
.jfht-code-actions button:focus-visible { outline: 2px solid #963f13; outline-offset: 2px; }
.jfht-code-actions button:disabled { opacity: .6; cursor: wait; }
.jfht-code-feedback { display: block; margin-top: 8px; font-size: 12px; line-height: 1.45; }


/* Hidden tabs/headers do not need CSS weather animation. */
.jfht-offscreen .jfht-rain-field,
.jfht-page-hidden .jfht-rain-field { animation-play-state: paused; }

@media (max-width: 767px), (max-width: 1024px) and (pointer: coarse) {
	body.jfht-active.jfht-header-enabled .header-middle,
	body.jfht-active.jfht-header-enabled .jfht-header {
		background:
			radial-gradient(ellipse at 95% 100%, rgba(224, 111, 35, .24), transparent 48%),
			linear-gradient(110deg, #171d2d, #28243a 62%, #362635) !important;
		box-shadow: inset 0 1px rgba(255,229,184,.1), 0 2px 12px rgba(17,13,23,.16);
	}

	/* Allocate real space to the logo instead of enlarging a 60px overlay. */
	body.jfht-active .jfht-header.header-middle > .container > .header-center,
	body.jfht-active .ts-header .header-bottom.hidden-phone {
		display: none !important;
	}
	body.jfht-active .jfht-header .header-right > .visible-phone {
		display: inline-flex !important;
	}
	body.jfht-active .jfht-header.header-middle > .container {
		flex-wrap: nowrap !important;
		gap: 10px !important;
		min-height: 86px;
		padding: 16px max(12px, env(safe-area-inset-right)) 16px max(12px, env(safe-area-inset-left));
	}
	body.jfht-active .jfht-header.header-middle > .container > .header-left {
		flex: 1 1 0;
		min-width: 0;
		flex-wrap: nowrap;
	}
	body.jfht-active .jfht-header .logo-wrapper {
		--ts-logo-width: 100%;
		width: 240px;
		max-width: 100%;
		min-width: 0 !important;
		max-height: none;
	}
	body.jfht-active .jfht-header .jfht-logo-host {
		display: block;
		width: 100%;
		max-width: 100%;
		min-height: 44px;
		aspect-ratio: 1400 / 372;
	}
	body.jfht-active .jfht-header .jfht-original-logo {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
	}
	body.jfht-active .jfht-header .jfht-logo-media {
		left: 50% !important;
		top: 50% !important;
		width: 100% !important;
		height: 100% !important;
		max-width: 100% !important;
		max-height: 100% !important;
		object-fit: contain !important;
		mix-blend-mode: normal;
		filter: none;
	}

	/* Keep the theme's controls and their click handlers in their own flex space. */
	body.jfht-active .jfht-header.header-middle > .container > .header-right {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		gap: 2px;
		margin-left: 0;
	}
	body.jfht-active .jfht-header .header-right .search-icon .icon,
	body.jfht-active .jfht-header .header-right .account-control > a,
	body.jfht-active .jfht-header .header-right .cart-control,
	body.jfht-active .jfht-header .header-right .ts-mobile-icon-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		min-height: 44px;
		padding: 0 !important;
		color: #f7f1eb !important;
	}

	.jfht-rain-field { opacity: .07; background-size: 120px 190px; }
	.jfht-moon { display: none !important; }
	.jfht-pumpkin-wrap {
		width: 46px !important;
		height: 46px !important;
		bottom: 3px !important;
		filter: drop-shadow(0 0 5px rgba(236,115,25,.2));
	}
	.jfht-pumpkin-wrap-left { display: none !important; }
	.jfht-pumpkin-wrap-right { right: 10px !important; transform: none; opacity: .6; }
	.jfht-pumpkin-right { transform: scaleX(-1); }
	.jfht-pumpkin-poster { object-fit: contain !important; }
	.jfht-lightning-video {
		inset: 0 !important;
		width: 100% !important;
		height: 100% !important;
		object-fit: cover !important;
		object-position: 50% 18% !important;
		opacity: .23 !important;
		filter: contrast(1.12) brightness(1.02) saturate(.55) !important;
	}
	body.jfht-active.jfht-offer-enabled .jfas-floating-leaf {
		flex-basis: 30px;
		width: 30px;
		height: 30px;
	}
}
