.juldesign-classic {
	--juldesign-accent: #85283a;
	--juldesign-hover: #681b2b;
	--juldesign-dark: #430f21;
	--juldesign-gold: #f4d59c;
	--juldesign-paper: #fff8ed;
}

.juldesign-pine {
	--juldesign-accent: #1c5946;
	--juldesign-hover: #154534;
	--juldesign-dark: #0c2b23;
	--juldesign-gold: #f4d59c;
	--juldesign-paper: #f6fff8;
}

.juldesign-winter {
	--juldesign-accent: #34537e;
	--juldesign-hover: #263e64;
	--juldesign-dark: #162642;
	--juldesign-gold: #d7e9ff;
	--juldesign-paper: #f6faff;
}

.juldesign-banner {
	box-sizing: border-box;
	border: 0;
	border-block-end: 2px solid var(--juldesign-gold);
	margin: 0;
	color: var(--juldesign-paper);
	background-color: var(--juldesign-dark);
	background-image:
		radial-gradient(circle at 1px 1px, rgb(255 255 255 / 14%) 1px, transparent 1.5px),
		linear-gradient(115deg, var(--juldesign-dark), var(--juldesign-accent) 53%, var(--juldesign-dark));
	background-size: 17px 17px, 100% 100%;
}

.juldesign-banner__inner {
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .375rem .875rem;
	max-inline-size: 74rem;
	margin-inline: auto;
	padding: .625rem 1rem;
	text-align: center;
}

.juldesign-banner .juldesign-banner__message {
	min-inline-size: 0;
	margin: 0;
	color: inherit;
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.juldesign-banner__star {
	color: var(--juldesign-gold);
	font-size: 1.375rem;
	line-height: 1;
}

@supports (mask-image: url('snowflake.png')) or (-webkit-mask-image: url('snowflake.png')) {
	.juldesign-banner--snow .juldesign-banner__star {
		flex: 0 0 auto;
		inline-size: 1.125rem;
		block-size: 1.125rem;
		background-color: var(--juldesign-gold);
		font-size: 0;
		-webkit-mask: url('snowflake.png') center / contain no-repeat;
		mask: url('snowflake.png') center / contain no-repeat;
	}
}

.juldesign-banner .juldesign-banner__link {
	min-inline-size: 0;
	border: 1px solid var(--juldesign-gold);
	border-radius: 50rem;
	padding: .25rem .75rem;
	color: var(--juldesign-paper);
	font-size: .875rem;
	font-weight: 650;
	line-height: 1.45;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.juldesign-banner a.juldesign-banner__link:hover {
	background-color: var(--juldesign-gold);
	color: var(--juldesign-dark);
}

.juldesign-banner a.juldesign-banner__link:focus-visible {
	outline: 2px solid var(--juldesign-paper);
	outline-offset: 3px;
}

.juldesign-active .wp-block-button:not(
	.is-style-outline,
	.wp-block-woocommerce-product-button,
	.wc-block-components-product-button,
	.wc-block-grid__product-add-to-cart
) > .wp-block-button__link:where(:not(.has-background, .has-text-color, [style]:not([style=""]))),
.juldesign-active.juldesign-woo :is(
	.woocommerce ul.products .button,
	.woocommerce .single_add_to_cart_button,
	.woocommerce .added_to_cart,
	.woocommerce-page ul.products .button,
	.woocommerce-page .single_add_to_cart_button,
	.wp-block-woocommerce-product-button:not(.is-style-outline) .wp-block-button__link,
	.wp-block-woocommerce-add-to-cart-with-options .single_add_to_cart_button,
	.wc-block-grid__product-add-to-cart .wp-block-button__link
):where(:not(.has-background, .has-text-color, [style]:not([style=""]), :disabled, .disabled, [aria-disabled="true"])),
.juldesign-preview .juldesign-preview__button {
	border-color: var(--juldesign-accent);
	background: var(--juldesign-accent);
	color: #fff;
}

/* Product grids and shortcodes can set their own button background.
 * Give the enabled WooCommerce holiday palette priority on add-to-cart buttons. */
.juldesign-active.juldesign-woo :is(
	.woocommerce ul.products li.product .button.add_to_cart_button,
	.elementor-widget-shortcode .button.add_to_cart_button,
	a.button.add_to_cart_button,
	button.button.add_to_cart_button
):where(:not(:disabled, .disabled, [aria-disabled="true"])) {
	background: var(--juldesign-cart-button-background, var(--juldesign-accent)) !important;
}

.juldesign-active.juldesign-woo .button.add_to_cart_button:is(:hover, :focus-visible) {
	--juldesign-cart-button-background: var(--juldesign-hover);
}

/* Snow edge also works on WooCommerce shortcode buttons outside product grids,
 * including buttons rendered by Elementor's free Shortcode widget. */
.juldesign-active.juldesign-button-snow :is(
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce-page a.button,
	.woocommerce-page button.button,
	a.add_to_cart_button,
	a.single_add_to_cart_button,
	.elementor-widget-shortcode a.button,
	.elementor-widget-woocommerce-product-add-to-cart a.button,
	.elementor-widget-woocommerce-product-add-to-cart button,
	.wc-block-components-button,
	.wc-block-grid__product-add-to-cart .wp-block-button__link
):where(:not(:disabled, .disabled, [aria-disabled="true"])) {
	position: relative;
	overflow: visible;
	isolation: isolate;
}

.juldesign-active.juldesign-button-snow :is(
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce-page a.button,
	.woocommerce-page button.button,
	a.add_to_cart_button,
	a.single_add_to_cart_button,
	.elementor-widget-shortcode a.button,
	.elementor-widget-woocommerce-product-add-to-cart a.button,
	.elementor-widget-woocommerce-product-add-to-cart button,
	.wc-block-components-button,
	.wc-block-grid__product-add-to-cart .wp-block-button__link
):where(:not(:disabled, .disabled, [aria-disabled="true"]))::after {
	position: absolute;
	z-index: 2;
	top: -6px;
	left: -8px;
	width: calc(100% + 16px);
	height: 14px;
	border-radius: 48% 52% 0 0 / 34% 38% 0 0;
	background: linear-gradient(180deg, #fff 0 72%, #f2f9ff 100%);
	box-shadow: 0 2px 3px rgb(33 58 76 / 25%);
	clip-path: polygon(0 25%, 6% 23%, 12% 9%, 18% 18%, 27% 6%, 34% 17%, 43% 0, 51% 17%, 60% 8%, 68% 20%, 77% 4%, 84% 16%, 92% 9%, 100% 22%, 100% 58%, 97% 64%, 94% 90%, 91% 65%, 84% 68%, 80% 55%, 76% 71%, 70% 95%, 67% 64%, 60% 69%, 55% 58%, 50% 66%, 45% 92%, 42% 61%, 35% 68%, 29% 54%, 25% 66%, 20% 90%, 17% 60%, 10% 68%, 7% 56%, 0 62%);
	content: "";
	pointer-events: none;
}

.juldesign-preview.juldesign-button-snow .juldesign-preview__button {
	position: relative;
	overflow: visible;
	isolation: isolate;
}

.juldesign-preview.juldesign-button-snow .juldesign-preview__button::after {
	position: absolute;
	z-index: 2;
	top: -6px;
	left: -8px;
	width: calc(100% + 16px);
	height: 14px;
	border-radius: 48% 52% 0 0 / 34% 38% 0 0;
	background: linear-gradient(180deg, #fff 0 72%, #f2f9ff 100%);
	box-shadow: 0 2px 3px rgb(33 58 76 / 25%);
	clip-path: polygon(0 25%, 6% 23%, 12% 9%, 18% 18%, 27% 6%, 34% 17%, 43% 0, 51% 17%, 60% 8%, 68% 20%, 77% 4%, 84% 16%, 92% 9%, 100% 22%, 100% 58%, 97% 64%, 94% 90%, 91% 65%, 84% 68%, 80% 55%, 76% 71%, 70% 95%, 67% 64%, 60% 69%, 55% 58%, 50% 66%, 45% 92%, 42% 61%, 35% 68%, 29% 54%, 25% 66%, 20% 90%, 17% 60%, 10% 68%, 7% 56%, 0 62%);
	content: "";
	pointer-events: none;
}

.juldesign-active .wp-block-button:not(
	.is-style-outline,
	.wp-block-woocommerce-product-button,
	.wc-block-components-product-button,
	.wc-block-grid__product-add-to-cart
) > .wp-block-button__link:hover:where(:not(.has-background, .has-text-color, [style]:not([style=""]))),
.juldesign-active.juldesign-woo :is(
	.woocommerce ul.products .button,
	.woocommerce .single_add_to_cart_button,
	.woocommerce .added_to_cart,
	.woocommerce-page ul.products .button,
	.woocommerce-page .single_add_to_cart_button,
	.wp-block-woocommerce-product-button:not(.is-style-outline) .wp-block-button__link,
	.wp-block-woocommerce-add-to-cart-with-options .single_add_to_cart_button,
	.wc-block-grid__product-add-to-cart .wp-block-button__link
):hover:where(:not(.has-background, .has-text-color, [style]:not([style=""]), :disabled, .disabled, [aria-disabled="true"])) {
	border-color: var(--juldesign-hover);
	background-color: var(--juldesign-hover);
	color: #fff;
}

.juldesign-active.juldesign-woo :is(
	.woocommerce span.onsale,
	.woocommerce-page span.onsale,
	.wc-block-grid__product-onsale,
	.wc-block-components-product-sale-badge
):where(:not(.has-background, .has-text-color, [style]:not([style=""]))),
.juldesign-preview .juldesign-preview__badge {
	border-color: var(--juldesign-accent);
	background: var(--juldesign-gold);
	color: var(--juldesign-dark);
}

.juldesign-snow {
	position: fixed;
	z-index: 1003;
	inset: 0;
	display: block;
	inline-size: 100%;
	block-size: 100%;
	max-inline-size: none;
	pointer-events: none;
}

.juldesign-visitor-controls {
	position: fixed;
	z-index: 1004;
	inset-inline-start: max(.75rem, env(safe-area-inset-left));
	inset-block-end: max(.75rem, env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	max-inline-size: calc(100% - 2rem);
	pointer-events: none;
}

.juldesign-visitor-control {
	min-block-size: 44px;
	border: 1px solid var(--juldesign-gold, #f4d59c);
	border-radius: 2rem;
	padding: .375rem .875rem;
	background: var(--juldesign-dark, #430f21);
	color: var(--juldesign-paper, #fff8ed);
	font: 650 .875rem/1.25 system-ui, sans-serif;
	cursor: pointer;
	pointer-events: auto;
}

.juldesign-visitor-control:hover,
.juldesign-visitor-control:focus-visible {
	background: var(--juldesign-hover, #681b2b);
}

.juldesign-has-decorations {
	--juldesign-frame-max-width: 1600px;
	--juldesign-frame-width: min(100vw, var(--juldesign-frame-max-width));
	--juldesign-top-bar-height: clamp(3rem, 4vw, 3.5rem);
	--juldesign-top-garland-spacer-height: clamp(72px, 6vw, 96px);
	--juldesign-landscape-height: clamp(110px, 13vw, 190px);
	padding-block-end: calc(var(--juldesign-landscape-height) + 18px);
}

.juldesign-has-banner.juldesign-has-decorations {
	--juldesign-scene-height: clamp(116px, calc(var(--juldesign-frame-width) * .103), 165px);
	--juldesign-greeting-landscape-height: clamp(52px, calc(var(--juldesign-frame-width) * .05), 80px);
	--juldesign-greeting-landscape-overlap: clamp(28px, 3.4vw, 52px);
	--juldesign-greeting-landscape-bottom: calc(var(--juldesign-scene-height) - 5px);
	--juldesign-top-garland-spacer-height: var(--juldesign-scene-height);
}

.juldesign-has-banner.juldesign-has-decorations .juldesign-banner--top {
	inset-block-start: calc(var(--juldesign-admin-offset, 0px) + var(--juldesign-greeting-landscape-bottom) - var(--juldesign-greeting-landscape-height) * .4);
	padding: 0;
	border: 0;
	color: var(--juldesign-paper);
	background: transparent;
	transform: translateY(-50%);
	pointer-events: none;
}

.juldesign-banner--top {
	position: fixed;
	inset-block-start: 0;
	inset-inline: 0;
	z-index: 1004;
}

.admin-bar .juldesign-banner--top {
	inset-block-start: var(--wp-admin--admin-bar--height, 32px);
}

.juldesign-banner-spacer {
	block-size: var(--juldesign-top-bar-height, clamp(3rem, 4vw, 3.5rem));
}

.juldesign-has-banner.juldesign-has-decorations .juldesign-banner-spacer {
	display: none;
}

.juldesign-has-decorations .juldesign-banner--top .juldesign-banner__inner {
	box-sizing: border-box;
	position: relative;
	z-index: 1;
	inline-size: fit-content;
	max-inline-size: calc(100vw - 2rem);
	min-block-size: 0;
	align-items: center;
	gap: 4px 12px;
	margin-inline: auto;
	padding: 5px 22px;
	border: 2px solid var(--juldesign-gold);
	border-radius: 50rem;
	background: var(--juldesign-dark);
	box-shadow: 0 4px 16px rgb(20 24 26 / 30%);
}

.juldesign-has-decorations .juldesign-banner--top::after {
	display: none;
}

.juldesign-has-decorations .juldesign-banner--top .juldesign-banner__link {
	pointer-events: auto;
}

.juldesign-has-decorations .juldesign-banner--top .juldesign-banner__message {
	font-size: clamp(14px, 1.2vw, 20px);
	text-shadow: 0 1px 2px rgb(0 0 0 / 30%);
}

.juldesign-has-decorations .juldesign-banner__star {
	flex: 0 0 auto;
	font-size: 1rem;
}

.juldesign-greeting-landscape {
	--juldesign-greeting-mask: linear-gradient(
		to bottom,
		transparent,
		#000 min(10px, var(--juldesign-greeting-landscape-overlap)),
		#000 calc(100% - 12px),
		transparent
	);
	position: fixed;
	z-index: 1001;
	inset-block-start: calc(var(--juldesign-admin-offset, 0px) + var(--juldesign-greeting-landscape-bottom) - var(--juldesign-greeting-landscape-height) - var(--juldesign-greeting-landscape-overlap));
	inset-inline: 0;
	inline-size: calc(var(--juldesign-frame-width) * .88);
	block-size: calc(var(--juldesign-greeting-landscape-height) + var(--juldesign-greeting-landscape-overlap));
	margin-inline: auto;
	background: #fdfdfd url('greeting-snowdrifts.png') center bottom / 100% var(--juldesign-greeting-landscape-height) no-repeat;
	-webkit-mask-image: var(--juldesign-greeting-mask);
	mask-image: var(--juldesign-greeting-mask);
	pointer-events: none;
}

.juldesign-decorations {
	position: fixed;
	z-index: 1002;
	box-sizing: border-box;
	inset-block: calc(var(--juldesign-admin-offset, 0px) + var(--juldesign-frame-top, 0px)) 0;
	inset-inline: 0;
	max-inline-size: var(--juldesign-frame-max-width);
	margin-inline: auto;
	border-style: solid;
	border-color: transparent;
	/* Match the top and side slices to the scale of the 1774px-wide source image. */
	border-width:
		calc(var(--juldesign-frame-width) * 212 / 1774)
		calc(var(--juldesign-frame-width) * 146 / 1774)
		var(--juldesign-landscape-height);
	border-image: url('christmas-frame.png') 212 146 195 stretch;
	pointer-events: none;
}

.juldesign-top-garland-spacer {
	block-size: var(--juldesign-top-garland-spacer-height, clamp(72px, 6vw, 96px));
}

/* Cover the area above the branches while the page scrolls behind the frame. */
.juldesign-top-garland-spacer::before {
	position: fixed;
	z-index: 1000;
	inset-block-start: calc(var(--juldesign-admin-offset, 0px) + var(--juldesign-frame-top, 0px));
	inset-inline: 0;
	block-size: calc(var(--juldesign-frame-width) * 76 / 1774);
	background: linear-gradient(to bottom, #fff 72%, transparent);
	content: "";
	pointer-events: none;
}

.juldesign-active:not(.juldesign-has-decorations) :is(
	.juldesign-decorations,
	.juldesign-greeting-landscape,
	.juldesign-top-garland-spacer
) {
	display: none;
}

.admin-bar.juldesign-active {
	--juldesign-admin-offset: var(--wp-admin--admin-bar--height, 32px);
}

.juldesign-has-decorations .juldesign-visitor-controls {
	inset-inline-start: max(16px, env(safe-area-inset-left));
	inset-block-end: calc(clamp(72px, 8vw, 120px) + env(safe-area-inset-bottom));
}

.juldesign-visitor-control:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #222;
}

.juldesign-snow[hidden],
.juldesign-visitor-control[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce), print {
	.juldesign-snow,
	.juldesign-snow-toggle {
		display: none;
	}
}

@media (max-width: 900px) {
	.juldesign-has-decorations {
		--juldesign-top-bar-height: 2.75rem;
		padding-block-end: 128px;
	}

	.juldesign-has-banner.juldesign-has-decorations {
		--juldesign-scene-height: calc(var(--juldesign-greeting-landscape-height) + 5px);
		--juldesign-greeting-landscape-height: 63px;
		--juldesign-greeting-landscape-overlap: 0px;
	}

	.juldesign-greeting-landscape {
		inline-size: 100%;
	}

	.juldesign-banner-spacer {
		block-size: var(--juldesign-top-bar-height, 2.75rem);
	}

	.juldesign-has-decorations .juldesign-banner--top .juldesign-banner__inner {
		padding-inline: 12px;
	}

	.juldesign-decorations,
	.juldesign-top-garland-spacer::before {
		display: none;
	}

	.juldesign-active:not(.juldesign-has-banner) .juldesign-decorations-toggle {
		display: none;
	}

	.juldesign-has-decorations .juldesign-visitor-controls {
		inset-block-end: calc(12px + env(safe-area-inset-bottom));
	}
}

@media print {
	.juldesign-has-decorations .juldesign-banner--top {
		padding-block-start: 0;
	}

	.juldesign-decorations,
	.juldesign-top-garland-spacer::before,
	.juldesign-visitor-controls {
		display: none;
	}
}
