/* Gill's dec popup (flip of Growby's): form → "Find the Yeti" game → success. Every number is the Figma frames'
   (2-Pop up info 1:9639, 3-Pop up game 1:8452, 5-Pop up success 1:6354, and their - Mobile twins), measured by scripts/popup-layout.mjs
   (work/figma/layout-popup.json). Scoped to #popup-dec; the framework's popup.css / forms.css are untouched. */
#popup-dec {
	--popup-width: 660px;
	--popup-height: 600px;
	--popup-max-width: calc(100vw - 20px);
	--popup-max-height: none;
	--popup-align: flex-start;
	--close-x: 24.7px;
	--close-y: 26.3px;
	--form-width: 583.9px;
	--form-field-padding: 12.5px 10px;
	--form-input-height: 53px;
	--form-input-radius: 6px;
	--form-label-font-size: 16px;
	--form-input-font-size: 16px;
	--form-label-offset-x: 17.8px;
	--form-input-text-indent: 17.8px;
	--submit-dist: 31.5px;
	--submit-width: 235px;
	--submit-height: 45px;
	--submit-radius: 54px;
	--submit-bg: #eb0f10;
	--submit-color: #ffffff;
}
#popup-dec .popup-content {
	position: relative;
	width: var(--popup-width);
	max-width: var(--popup-max-width);
	height: var(--popup-height);
	max-height: var(--popup-max-height);
	background-color: #073767;
}
#popup-dec h2,
#popup-dec p {
	margin: 0;
}
#popup-dec picture img {
	max-width: none;
}

/* the panel background of each step (Form BG 3:37 / 3:1551 / 4:4410): the night sky and its snow (Layer_1), art behind
   the step's content. The mountains (the Form BG's Frames) are their own layer, tied to the panel's bottom edge, so they
   stay there on phones, where the panel is the screen's height. */
#popup-dec .popup-default,
#popup-dec .popup-game,
#popup-dec .popup-thanks {
	position: relative;
	overflow: hidden;
}
#popup-dec .dec-panel-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	background-color: #073767;
	background-position: center top;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-image: url("../images/hero/popup-back.png");
	background-image: image-set(url("../images/hero/popup-back.webp") type("image/webp") 1x, url("../images/hero/popup-back@2x.webp") type("image/webp") 2x, url("../images/hero/popup-back.png") 1x, url("../images/hero/popup-back@2x.png") 2x);
}
/* the mountains (56:64 / 3:1552 / 4:4411): 660x179, the panel's bottom 179px, cut by its sides as Form BG clips them */
#popup-dec .dec-mountains {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	aspect-ratio: 660 / 179;
	background-position: center bottom;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-image: url("../images/hero/mountains.png");
	background-image: image-set(url("../images/hero/mountains.webp") type("image/webp") 1x, url("../images/hero/mountains@2x.webp") type("image/webp") 2x, url("../images/hero/mountains.png") 1x, url("../images/hero/mountains@2x.png") 2x);
}
/* Figma layers baked into the panel art above (the mountains' tree/snow frames 3:1327 3:1402 3:1476 / 4:4485 4:4559,
   45:5581 45:5655 / 45:970 45:1044; the phone panel's snow layer 45:5729 / 45:1118): each tagged on its own empty box
   at its layer's place, painted by its parent's picture */
#popup-dec .dec-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
#popup-dec .dec-layer-m {
	display: none;
}
#popup-dec .dec-form-title,
#popup-dec .popup-form form,
#popup-dec .dec-game-title,
#popup-dec .dec-trees,
#popup-dec .dec-thanks {
	position: relative;
	z-index: 1;
}

/* the close: the frame's X (white bars, 3px x 27px, crossed at 45deg) */
#popup-dec .popup-close {
	top: var(--close-y);
	right: var(--close-x);
	width: 35.3px;
	height: 35.3px;
	padding: 0;
	z-index: 5;
	border: 0;
	background: transparent;
}
#popup-dec .popup-close::before,
#popup-dec .popup-close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3px;
	height: 27px;
	margin: -13.5px 0 0 -1.5px;
	border-radius: 2px;
	background-color: #ffffff;
	transform: rotate(45deg);
}
#popup-dec .popup-close::after {
	transform: rotate(-45deg);
}

/* step 2, the form (g1: title 3:727, Form Fields 3:705, Submit 3:707) */
#popup-dec .popup-default {
	align-items: var(--popup-align);
}
/* the title's glyphs at 71.6 (3:727's render box): its 50px line box starts 8px lower than 63.6, and gives the 8px
   back below it, so the form stays at 147.5 (first field 160) */
#popup-dec .popup-form {
	padding-top: 71.6px;
}
#popup-dec .dec-form-title {
	width: 493px;
	max-width: 100%;
	margin: 0 auto 25.9px;
	font-size: 55px;
	line-height: 50px;
	font-weight: 400;
	letter-spacing: 0;
	text-align: center;
}
#popup-dec form.uni-style {
	color: #2a2a2a;
	font-family: 'Avenir-Roman', sans-serif;
}
#popup-dec form.uni-style input,
#popup-dec form.uni-style select,
#popup-dec form.uni-style textarea {
	border: 1.315px solid #c3c3c5;
	color: #373737;
}
#popup-dec label .f-red {
	color: #fc5147;
}
#popup-dec .form-action {
	display: flex;
	justify-content: center;
	padding-top: 0;
}
#popup-dec .promoLead {
	width: var(--submit-width);
	height: var(--submit-height);
	margin: var(--submit-dist) auto 0;
	padding: 0;
	border-radius: var(--submit-radius);
	background: var(--submit-bg);
	color: var(--submit-color);
	font-size: 20px;
	letter-spacing: 0;
	text-transform: uppercase;
	line-height: 1;
}

/* step 3, the game (3-Pop up game 3:1550): the title, then three trees in a row (221x309, 13px overlap, top 254).
   The picked tree's yeti (4:2392, 215x219 at +4,+53 of its tree) jumps out, then the prize shows. */
#popup-dec .popup-game {
	display: flex;
	flex-direction: column;
	align-items: center;
}
#popup-dec .dec-game-title {
	margin-top: 63.5px;
	font-size: 64.74px;
	line-height: 68px;
	font-weight: 400;
	text-align: center;
}
#popup-dec .dec-trees {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 54.5px;
}
#popup-dec .dec-tree {
	flex: 0 0 221px;
	width: 221px;
	height: 309px;
	padding: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.2s ease;
}
#popup-dec .dec-tree + .dec-tree {
	margin-left: -13.3px;
}
#popup-dec .dec-tree:hover:not(:disabled),
#popup-dec .dec-tree:focus-visible {
	transform: translateY(-6px);
}
#popup-dec .dec-tree-img {
	width: 100%;
	height: 100%;
	transition: opacity 0.25s ease;
}
#popup-dec .dec-jump {
	position: absolute;
	left: 0;
	top: 49px;
	width: 224px;
	height: 227px;
	opacity: 0;
	transform: translateY(40px) scale(0.6);
	transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: none;
}
#popup-dec .dec-tree.is-picked {
	z-index: 2;
}
#popup-dec .dec-tree.is-picked .dec-tree-img {
	opacity: 0;
}
#popup-dec .dec-tree.is-picked .dec-jump {
	opacity: 1;
	transform: none;
}

/* step 4, success (5-Pop up success 4:4409): title g1, then g2 (offer, check email, Keep Shopping, gaps 19/19). */
#popup-dec .popup-thanks {
	justify-content: flex-start;
	padding-top: 0;
}
#popup-dec .tracking_promo_success {
	position: absolute;
}
/* success (5-Pop up success 1:6354): one column g1, the title 1:7626 at 59 (cap to baseline, 83 tall), the prize text
   1:7199 (240.6x199) 45.7 below with the gift card art 1:7174 behind it, "Check your email" 1:7627 45.2 below, Keep
   Shopping 1:7624 23 below */
#popup-dec .dec-thanks {
	padding-top: 59px;
}
#popup-dec .thanks {
	width: fit-content;
}
#popup-dec .dec-thanks .block {
	display: block;
}
#popup-dec .dec-found {
	width: 596px;
	max-width: 100%;
	font-size: 46px;
	line-height: 55.2px;
	font-weight: 400;
	text-align: center;
	text-box: trim-both cap alphabetic;
}
#popup-dec .dec-prize {
	width: 240.6px;
	margin-top: 45.7px;
}
/* the card art: Figma's render box 351.4x240.8 at -59.7,-12.2 of the prize text (.dec-card-box, unchanged — it only
   carries the White surface/Ribbon tags, no art of its own).
   Revision (dev request, both breakpoints — looked completely off: the previous gift-card.png was a hand-patched
   re-export of the card's own Group (1:7174) widened to a 462x353 canvas and had its baked "$50 GIFT CARD*" erased
   by hand, but the erase and the card's true position inside that canvas never actually lined up, so the live
   .dec-gift copy sat ~28/24px off the card and the painted-over strip showed through). Reworked like
   wowie/20261119T0735-affordable-rto-promo-t6695375's popup card: export only the art layers that carry no effect
   of their own — "White surface" (1:7175) + "Ribbon" (1:7177), no shadow baked in, no price text in the group at
   all (1:7199 is a sibling, never part of this export) — then add Figma's shadow as CSS instead of baking it: that
   shadow belongs to the clipping Frame (1:7173, offset 0,3.6 / radius 27 / 33% black), not to 1:7174's own, much
   bigger one (offset 0,29.7 / radius 3.6) which is what the original art had baked at full strength. gift-card.png
   is now that clean export at its own render box, 4px pad on every side (figma-export.mjs's default, box
   150,171,360,250 in frame px) — so its offset is .dec-card-box's own -59.7/-12.2 less that 4px pad: no more
   hand-fit numbers to get wrong. */
#popup-dec .dec-card-box {
	position: absolute;
	left: -59.7px;
	top: -12.2px;
	width: 351.4px;
	height: 240.8px;
	pointer-events: none;
}
#popup-dec .dec-card-art img {
	position: absolute;
	left: -63.7px;
	top: -16.7px;
	width: 360px;
	height: 250px;
	z-index: 0;
	pointer-events: none;
	filter: drop-shadow(0 3.6px 27px rgba(0, 0, 0, 0.33));
}
#popup-dec .dec-card-tag {
	position: absolute;
	inset: 0;
}
#popup-dec .dec-card-tag.dec-ribbon {
	inset: auto;
	left: 0;
	top: 4.4px;
	width: 301.7px;
	height: 206.6px;
}
/* revision (dev request): the price text sat level while the card under it is turned -5.3179deg (Figma's own
   Frame 1:7173/1:14342, radians in the API field — confirmed against the live file: both the card art (1:7174/
   1:14343) and this text (1:7199/1:14368) are children of that one rotated Frame, so Figma turns them together).
   Ported like wowie/20261119T0735-affordable-rto-promo-t6695375's popup card (its own text carries
   `rotate(-5.32deg)` for the same reason) — the value here is Gill's own Figma angle, not Affordable's card's. */
#popup-dec .dec-gift {
	position: relative;
	z-index: 1;
	color: #009546;
	font-size: 43.34px;
	line-height: 48.54px;
	font-weight: 400;
	text-align: center;
	-webkit-text-stroke: 1px #009546;
	text-shadow: 1px 2px 10px rgba(0, 0, 0, 0.25);
	transform: rotate(-5.32deg);
}
#popup-dec .dec-gift .dec-50 {
	font-size: 132.39px;
	line-height: 1.1;
}
/* 27.2px: the site's Avenir Medium sets the line 375.7 wide at 27.6px where Figma draws it in 370 (round 2) */
#popup-dec .dec-check {
	margin-top: 45.2px;
	font-size: 27.2px;
	line-height: 30.8px;
	letter-spacing: 0.3px;
	text-align: center;
	white-space: nowrap;
}
#popup-dec .dec-keep {
	width: 235px;
	height: 45px;
	margin: 23px auto 0 !important;
	padding: 0;
	border-radius: 54px;
	background: #eb0f10;
	color: #ffffff;
	font-size: 20px;
	letter-spacing: 0;
	line-height: 1;
}
/* the thumbs-up yeti (Frame 5 1:7200, in Form BG): image 179x213 at -4,391 (4px pad), cut by the panel's left and
   bottom edges as Form BG clips it */
#popup-dec .dec-thanks-yeti {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 175px;
	height: 209px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
#popup-dec .dec-thanks-yeti img {
	position: absolute;
	left: -4px;
	top: 0;
	width: 179px;
	height: auto;
	z-index: 0;
	pointer-events: none;
}
/* the success sky's own snow (Gif Crad 1:6578 / 1:13747), baked into the panel art */
#popup-dec .dec-sky {
	position: absolute;
	left: 2px;
	top: 160px;
	width: 658px;
	height: 278px;
	pointer-events: none;
}
#popup-dec .dec-keep:hover,
#popup-dec .promoLead:hover {
	filter: brightness(1.12);
}

/* phones: full screen (rto-form-popups makes .popup-content 100% x 100% at <=567px; only its variables change here),
   with the 390 frames' own numbers. The sky (Form BG 45:5506's Layer_1) covers the panel from the top; the mountains
   (45:5507, 390x123) stay pinned to the real bottom of the panel (`bottom: 0`, their shared non-mobile rule) whatever
   the screen's height — `--popup-height`/`--popup-max-height` below are `dvh`, not `%`, so the panel is always the
   device's actual visible height, not the layout viewport's.
   Ported from wowie/20261119T0735-affordable-rto-promo-t6695375 (fe098ab, fef3b3a, 4668854, b0efc3e — the dev note's
   "full-screen phone panel, form and thank-you centred above the mountains, the game step's own snowbank, trees
   absolutely positioned on it"): the 390x905 frames' "Form BG" bands are only 692px tall, so a phone taller than that
   left spare height below the content with no single top-padding figure ever right for every device height — the
   earlier top-anchored-with-a-scroll-fallback build (round 2 here) read on real phones as the step "not staying
   fixed", exactly the client's 23 Nov report. `.popup-default`/`.popup-thanks` are flex columns whose one content
   child is centred with `justify-content: center` in the space above the mountains; `padding-bottom: 4.7vh` reserves
   their band so the free space splits evenly above and below the content. This intentionally reads differently from
   the Figma frame on a phone taller than 692px — don't revert it to chase the frame. The game step uses its own,
   taller snowbank (mountains-game-m.png) and its trees are pinned absolute to the step's own bottom edge instead. */
@media (max-width: 567px) {
	#popup-dec {
		--popup-width: 100%;
		--popup-height: 100dvh;
		--popup-max-height: 100dvh;
		--popup-max-width: 100%;
		--popup-align: flex-start;
		--close-x: 12.7px;
		--close-y: 11.3px;
		--form-width: 350px;
		--form-width-mobile: 350px;
		--form-field-padding: 8px 0px;
		--form-field-padding-mobile: 8px 0px;
		--form-input-height: 53px;
		--form-input-radius: 6px;
		--form-input-radius-mobile: 6px;
		--form-label-font-size: 16px;
		--form-label-font-size-mobile: 16px;
		--form-input-font-size: 16px;
		--form-input-font-size-mobile: 16px;
		--form-label-offset-x: 17.75px;
		--form-input-text-indent: 17.75px;
		--submit-dist: 25px;
	}
	#popup-dec .dec-panel-bg {
		background-size: cover;
		background-image: url("../images/hero/popup-back-m.png");
		background-image: image-set(url("../images/hero/popup-back-m.webp") type("image/webp") 1x, url("../images/hero/popup-back-m@2x.webp") type("image/webp") 2x, url("../images/hero/popup-back-m.png") 1x, url("../images/hero/popup-back-m@2x.png") 2x);
	}
	#popup-dec .dec-mountains {
		aspect-ratio: 390 / 124;
		background-image: url("../images/hero/mountains-m.png");
		background-image: image-set(url("../images/hero/mountains-m.webp") type("image/webp") 1x, url("../images/hero/mountains-m@2x.webp") type("image/webp") 2x, url("../images/hero/mountains-m.png") 1x, url("../images/hero/mountains-m@2x.png") 2x);
	}
	/* revision (dev request): the game step's own snowbank (1:8454/1:16715, its "Pop up game" Form BG stacks three
	   snow frames 1:16716/1:16790/1:16864 at 390x329 under the trees) is a taller, different snow shape than the
	   124px-tall range shared by the form and thank-you steps above — on mobile only; its desktop export already
	   matches the shared 660x179 mountains.png. mountains-game-m.png is that composite at its own render bounds. */
	#popup-dec .dec-mountains-game {
		aspect-ratio: 390 / 329;
		background-image: url("../images/hero/mountains-game-m.png");
		background-image: image-set(url("../images/hero/mountains-game-m.webp") type("image/webp") 1x, url("../images/hero/mountains-game-m@2x.webp") type("image/webp") 2x, url("../images/hero/mountains-game-m.png") 1x, url("../images/hero/mountains-game-m@2x.png") 2x);
	}
	/* ported (fe098ab/b0efc3e): the mountains keep the shared `bottom: 0` rule above (the 390x905 frame's "Form BG"
	   band is only 692px tall, painted at 568.7-692 of that frame, but the 905 canvas is just Figma's artboard, not a
	   designed height, and the panel is now `dvh`, not a fixed px figure, so there is no single number that is still
	   correct on every phone). `bottom: 0` keeps them flush with the real bottom of the panel at their own size on
	   every device; the content above is centred in the space they leave, not pinned under the close button. The
	   game step already used `bottom: 0` for its own mountains, so it needs no change here. */
	#popup-dec .popup-default,
	#popup-dec .popup-thanks {
		flex-direction: column;
		justify-content: center;
		/* ported (b0efc3e): `vh`, not `vw` — this reserves space in the panel's own height (it's `100dvh` on this
		   breakpoint), not its width, so the padding needs to scale with the device's height, not the mountains'
		   width-relative aspect-ratio */
		padding-bottom: 4.7vh;
	}
	/* ported (fe098ab): `.popup-default` above now centres this block itself (flex column, `justify-content: center`,
	   padded for the mountains), so no fixed top padding is needed to land the title under the close button — that
	   number only ever held on a phone exactly as tall as the 692px frame. Horizontal padding stays 0: --form-width
	   already carries the side margins. */
	#popup-dec .popup-form {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-form-title {
		margin-bottom: 16px;
		font-size: 43px;
		line-height: 50px;
	}
	#popup-dec .dec-game-title {
		margin-top: 61px;
		font-size: 49.74px;
		line-height: 59.7px;
	}
	/* game, phones: one tree at the back (83.5,220), two in front (-30,345) and (199,345), each 221x309. Placed
	   absolute in vw of the full-bleed popup, each tree at its own Figma render-box position, so the trio tracks the
	   viewport on any phone width (375, 360, 320), not just a fixed 390px row.
	   Ported (4668854): .dec-trees was still sitting in normal flow (`position: relative`, pushed down by
	   `margin-top: 40px` below the title, with the whole game-title+trees group wrapped in a centring flex column
	   whose own height could exceed a short phone's 100dvh panel) — an iPhone SE overflowed before the title even
	   finished, forcing the whole popup to scroll and leaving the trees off-screen: the client's 23 Nov "mobile game
	   screen doesn't stay fixed and appears to be cut off". Absolute now, pinned to #dec-game's own bottom edge (its
	   `relative` box in the markup, the same way .dec-mountains is already pinned with `bottom: 0`), with no wrapping
	   group around the title and trees (no longer needed: #dec-game is already the flex column, `align-items: center`,
	   from the non-mobile `.popup-game` rule above) — it's out of flow entirely and lands standing on the snow bank at
	   the panel's true bottom on every phone, tall or short, instead of wherever flow happened to leave it. */
	#popup-dec .dec-trees {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 167.692vw;
	}
	#popup-dec .dec-tree {
		position: absolute;
		width: 56.667vw;
		height: 79.231vw;
	}
	#popup-dec .dec-tree + .dec-tree {
		margin-left: 0;
	}
	#popup-dec .dec-tree[data-pick="1"] {
		left: 21.282vw;
		top: 56.410vw;
	}
	#popup-dec .dec-tree[data-pick="2"] {
		left: -7.692vw;
		top: 88.462vw;
	}
	#popup-dec .dec-tree[data-pick="3"] {
		left: 51.026vw;
		top: 88.462vw;
	}
	/* tree 1 sits behind trees 2 and 3 (its 79.231vw-tall button reaches into their 88.462vw top, per Figma's own
	   stacking), so its hit box still covered ground they paint on top of, swallowing taps meant for them. Trees 2
	   and 3 never overlap each other, so only tree 1 needs this: its button now covers just the crown no one
	   paints over, while its picture keeps painting at the full size it always had. */
	#popup-dec .dec-tree[data-pick="1"] {
		height: 28vw;
		overflow: visible;
	}
	#popup-dec .dec-tree[data-pick="1"] .dec-tree-img {
		position: absolute;
		top: 0;
		left: 0;
		width: 56.667vw;
		height: 79.231vw;
	}
	#popup-dec .dec-jump {
		left: 2.256vw;
		top: 8.795vw;
		width: 52.564vw;
		height: 53.333vw;
	}
	/* success, phones (1:12927): the title 1:14795 and the prize 1:14368 42.7 below it (g1), "Check your email" 1:14794
	   49.3 below and Keep Shopping 25 below that (g2).
	   Ported (fe098ab): `.popup-thanks` above now centres this block itself the same way the form step does, so it
	   no longer needs its own top padding or a scroll fallback to reach the CTA — the earlier top-anchored-plus-
	   overflow-y:auto build (round 2 here) still clipped the CTA on a short real phone and re-settled on every resize
	   of the browser's own chrome, reading as the client's 23 Nov "success screen... doesn't stay in place" too. The
	   sky/mountains panel and the standing yeti (its own flex siblings in .popup-thanks) are untouched. */
	#popup-dec .dec-thanks {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-found {
		width: 390px;
		font-size: 41px;
		line-height: 50px;
	}
	#popup-dec .dec-prize {
		margin-top: 42.7px;
	}
	#popup-dec .dec-check {
		margin-top: 49.3px;
		font-size: 26px;
		line-height: 28.6px;
		letter-spacing: 0.3px;
	}
	#popup-dec .dec-keep {
		margin-top: 25px !important;
	}
	#popup-dec .dec-sky {
		left: 1px;
		top: 158px;
		width: 389px;
		height: 273px;
	}
	/* the thumbs-up yeti (45:2336) stands on the snow at 222,485 (image 172x216), cut by the frame's right edge; its
	   feet are tied to the panel's bottom edge with the mountains: the image ends 9px below it (the art 5px) */
	#popup-dec .dec-layer-m {
		display: block;
	}
	#popup-dec .dec-thanks-yeti {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
	}
	#popup-dec .dec-thanks-yeti img {
		top: auto;
		left: 56.923vw;
		bottom: -2.308vw;
		width: 44.103vw;
		z-index: 1;
		clip-path: none;
	}
	/* the yeti hangs 5px below the frame's panel (45:2336): open only the panel's bottom edge */
	#popup-dec .popup-content {
		overflow: visible;
		clip-path: inset(0 0 -5px 0);
	}
}
