/* ===========================================================================
   Kidsee — floating promo island + activation-code modal (inc/promo-island.php)
   Ported from the design prototype (Local Prototype/kidsee/prototypes/
   promo-island-prototype.html) after several review rounds. Uses the theme's
   own --kidsee-* tokens throughout — no parallel colour/radius system.
   Classes are BEM-ish under a single `.kidsee-promo-` namespace per the
   theme's "prefix every CSS/JS global uniquely" convention.
   =========================================================================== */

/* Chromium/WebKit's UA stylesheet excludes SVG from the [hidden] display:none
   rule — without this, an <svg hidden> still renders. */
.kidsee-promo-copy-btn svg[hidden] { display: none !important; }

/* --- Floating island ------------------------------------------------------
   Bottom-right, thumb zone. Rounded pill in the site's own violet, a percent
   medallion, two-line copy, a SALE corner tag, and a dismiss control. */

.kidsee-promo-island {
	position: fixed;
	right: 20px;
	bottom: 20px;
	/* Above .top-bar (100) and .nav-dropdown__list (200) — style-extended.css —
	   so the overlay it opens covers the header/nav too, not just the page
	   body below it. */
	z-index: 250;
	display: flex;
	align-items: center;
	animation: kidsee-promo-island-enter var(--kidsee-t-enter) var(--kidsee-out) both;
}
.kidsee-promo-island.is-floating {
	animation:
		kidsee-promo-island-enter var(--kidsee-t-enter) var(--kidsee-out) both,
		kidsee-promo-island-float 1s ease-in-out 1s infinite alternate;
}
.kidsee-promo-island.is-hidden { display: none; }

@keyframes kidsee-promo-island-enter {
	from { opacity: 0; transform: translateY(28px) scale(.92); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Single up/down segment played forward then reversed via `alternate` — a
   3-stop 0%/50%/100% keyframe (old approach) applies ease-in-out to each
   half independently, so velocity hits ~0 at both the bottom AND the top on
   every cycle, reading as a jerky "step" rather than one continuous arc. */
@keyframes kidsee-promo-island-float {
	from { transform: translateY(0); }
	to   { transform: translateY(-8px); }
}

.kidsee-promo-island__pill {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	background: linear-gradient(155deg, var(--kidsee-primary) 0%, var(--kidsee-primary-800) 100%);
	border-radius: var(--kidsee-r-pill);
	padding: 10px 18px 10px 10px;
	box-shadow: var(--kidsee-shadow-promo);
	border: 0;
	cursor: pointer;
	text-align: left;
	font-family: var(--kidsee-font);
	transition:
		transform var(--kidsee-t-base) var(--kidsee-out),
		box-shadow var(--kidsee-t-base) var(--kidsee-out);
}
.kidsee-promo-island__pill:hover,
.kidsee-promo-island__pill:focus-visible {
	transform: translateY(-3px);
	box-shadow: var(--kidsee-shadow-promo-h);
}
.kidsee-promo-island__pill:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.kidsee-promo-island__pill:active { transform: translateY(-1px); }

.kidsee-promo-island__pulse {
	position: absolute;
	inset: -6px;
	border-radius: var(--kidsee-r-pill);
	border: 2px solid var(--kidsee-primary-100);
	opacity: 0;
	pointer-events: none;
	animation: kidsee-promo-island-pulse 2.8s ease-out 1.4s infinite;
}
@keyframes kidsee-promo-island-pulse {
	0%   { opacity: .55; transform: scale(.94); }
	70%  { opacity: 0;   transform: scale(1.14); }
	100% { opacity: 0;   transform: scale(1.14); }
}

.kidsee-promo-island__medallion {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	background: rgba(255, 255, 255, .94);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--kidsee-primary-800);
}
.kidsee-promo-island__medallion svg { width: 22px; height: 22px; }

.kidsee-promo-island__copy { display: flex; flex-direction: column; gap: 1px; color: #fff; }
.kidsee-promo-island__eyebrow {
	font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
	opacity: .92; white-space: nowrap;
}
.kidsee-promo-island__deal { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }

.kidsee-promo-island__flag {
	position: absolute;
	top: -11px; left: -6px;
	z-index: 3;
	background: var(--kidsee-text-strong);
	color: #fff;
	font-size: 10px; font-weight: 800; letter-spacing: .08em;
	padding: 4px 9px;
	border-radius: 7px;
	transform: rotate(-9deg);
	box-shadow: 0 3px 8px rgba(25, 33, 61, .28);
	pointer-events: none;
}

@media (max-width: 640px) {
	.kidsee-promo-island__pill { padding: 9px 14px 9px 9px; gap: 10px; }
	.kidsee-promo-island__medallion { width: 36px; height: 36px; }
	.kidsee-promo-island__deal { font-size: 16px; }
}

/* --- Modal -----------------------------------------------------------------
   Centred card + dim backdrop on desktop; full-screen sheet on mobile. One
   solid violet ground (kidsee-primary-deep — a diagonal gradient would never
   let the rays fade at the hero's bottom land on an exact colour). */

.kidsee-promo-backdrop {
	position: fixed;
	inset: 0;
	/* Above the island (250) and everything else in style-extended.css — the
	   overlay must dim the sticky header/nav too, not stop at its z-index:100. */
	z-index: 300;
	background: rgba(25, 33, 61, .5);
	backdrop-filter: blur(3px);
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	opacity: 0; visibility: hidden;
	transition: opacity var(--kidsee-t-base) var(--kidsee-out);
}
.kidsee-promo-backdrop.is-open { opacity: 1; visibility: visible; }

.kidsee-promo-modal {
	position: relative;
	width: 100%; max-width: 420px; max-height: 90vh; overflow: auto;
	background: var(--kidsee-primary-deep);
	border-radius: var(--kidsee-r-card);
	box-shadow: var(--kidsee-shadow-promo-modal);
	transform: translateY(18px) scale(.96); opacity: 0;
	transition:
		transform var(--kidsee-t-base) var(--kidsee-out),
		opacity var(--kidsee-t-base) var(--kidsee-out);
}
.kidsee-promo-backdrop.is-open .kidsee-promo-modal { transform: translateY(0) scale(1); opacity: 1; }
.kidsee-promo-modal:focus { outline: none; }

@media (max-width: 640px) {
	.kidsee-promo-backdrop { padding: 0; align-items: stretch; }
	.kidsee-promo-modal {
		max-width: none; max-height: none; width: 100%; height: 100%; border-radius: 0;
		transform: translateY(100%);
		display: flex; flex-direction: column;
	}
	.kidsee-promo-backdrop.is-open .kidsee-promo-modal { transform: translateY(0); }
	.kidsee-promo-modal__body { flex: 1; justify-content: center; }
	.kidsee-promo-modal__hero { padding: 20px 24px 6px; }
	.kidsee-promo-modal__icon { width: 98px; margin-bottom: 4px; }
	.kidsee-promo-modal__title { margin-bottom: 4px; }
	.kidsee-promo-modal__body { padding: 12px 22px 18px; gap: 12px; }
	.kidsee-promo-checklist { gap: 9px; }
	.kidsee-promo-checklist__row img { width: 34px; }
}

.kidsee-promo-modal__close {
	position: absolute; top: 16px; right: 16px; z-index: 2;
	width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255, 255, 255, .22); color: #fff;
	display: flex; align-items: center; justify-content: center;
	box-shadow: none;
}
.kidsee-promo-modal__close svg { width: 16px; height: 16px; }
.kidsee-promo-modal__close:hover { background: rgba(255, 255, 255, .32); }

/* Hero — soft white "sunburst" behind the icon, over the violet ground. */
.kidsee-promo-modal__hero { position: relative; overflow: hidden; padding: 34px 28px 8px; text-align: center; }
.kidsee-promo-modal__rays {
	position: absolute; top: -30px; left: 50%; width: 320px; height: 320px;
	transform: translateX(-50%);
	background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .5) 0deg 4deg, transparent 4deg 16deg);
	opacity: .35; filter: blur(1px);
	-webkit-mask-image: radial-gradient(circle at center, #000 30%, transparent 68%);
	        mask-image: radial-gradient(circle at center, #000 30%, transparent 68%);
	pointer-events: none;
}
.kidsee-promo-modal__glow {
	position: absolute; top: 8px; left: 50%; width: 170px; height: 170px; transform: translateX(-50%);
	background: radial-gradient(circle, rgba(255, 255, 255, .30) 0%, transparent 70%);
	pointer-events: none;
}
.kidsee-promo-modal__spark { position: absolute; color: rgba(255, 255, 255, .55); pointer-events: none; }
.kidsee-promo-modal__spark svg { width: 100%; height: 100%; }
.kidsee-promo-modal__spark--a { top: 14px; left: 20px; width: 16px; }
.kidsee-promo-modal__spark--b { top: 26px; right: 26px; width: 12px; color: rgba(248, 179, 75, .75); }
.kidsee-promo-modal__spark--c { top: 64px; right: 19%; width: 9px; color: rgba(248, 179, 75, .65); }

/* The rays box has a hard rectangular edge where the hero's own
   overflow:hidden clips it before the radial mask has fully faded — this
   gradient blends that seam into the card's own ground colour instead. */
.kidsee-promo-modal__fade {
	position: absolute; left: 0; right: 0; bottom: 0; height: 64px;
	background: linear-gradient(to bottom, rgba(97, 87, 248, 0) 0%, var(--kidsee-primary-deep) 100%);
	pointer-events: none;
}

.kidsee-promo-modal__icon { position: relative; width: 132px; margin: 0 auto 8px; display: block; }

/* Plain small label — no pill/backing, so it doesn't compete with the
   headline for weight. */
.kidsee-promo-modal__eyebrow {
	position: relative;
	display: inline-flex; align-items: center; gap: 4px;
	color: rgba(255, 255, 255, .8);
	font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
	margin-bottom: 8px;
}
.kidsee-promo-modal__eyebrow svg { width: 12px; height: 12px; }

.kidsee-promo-modal__title {
	position: relative;
	font-size: clamp(23px, 5vw, 27px); font-weight: 800; letter-spacing: -.01em; line-height: 1.15;
	color: #fff; margin: 0;
}

.kidsee-promo-modal__body { padding: 14px 26px 26px; display: flex; flex-direction: column; gap: 16px; }

/* No card behind the checklist — these three rows sit straight on the
   violet ground. The icons were generated to read there on their own
   (light/gold accents), so the label text switches to white to match. */
.kidsee-promo-checklist { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.kidsee-promo-checklist__row {
	display: flex; align-items: center; gap: 12px;
	opacity: 0; transform: translateY(6px);
	transition: opacity .4s var(--kidsee-out), transform .4s var(--kidsee-out);
}
.kidsee-promo-backdrop.is-open .kidsee-promo-checklist__row { opacity: 1; transform: translateY(0); }
.kidsee-promo-checklist__row:nth-child(1) { transition-delay: .05s; }
.kidsee-promo-checklist__row:nth-child(2) { transition-delay: .14s; }
.kidsee-promo-checklist__row:nth-child(3) { transition-delay: .23s; }
.kidsee-promo-checklist__row img { width: 40px; height: auto; flex-shrink: 0; display: block; }
.kidsee-promo-checklist__row span { font-size: 15px; font-weight: 700; color: #fff; }

.kidsee-promo-modal__instruction {
	font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .88);
	text-align: center; line-height: 1.4; margin: 0;
}

/* One larger, translucent card for the code (not solid white — so it never
   competes with the solid-white Copy button below it) with its own "Your
   code" label inside, above the code itself. */
.kidsee-promo-code {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .30);
	border-radius: var(--kidsee-r-card); padding: 16px 24px 20px;
}
.kidsee-promo-code__label {
	font-size: 11.5px; font-weight: 700; color: rgba(255, 255, 255, .75);
	text-transform: uppercase; letter-spacing: .06em;
}
.kidsee-promo-code__value {
	font-weight: 800; font-size: 28px; letter-spacing: .02em; color: #fff;
	font-variant-numeric: tabular-nums;
}

.kidsee-promo-copy-btn {
	display: flex; align-items: center; justify-content: center; gap: 9px;
	background: #fff; color: var(--kidsee-primary-800); font-weight: 800; font-size: 16.5px;
	font-family: var(--kidsee-font);
	padding: 14px 20px; border-radius: var(--kidsee-r-lg); border: 0; cursor: pointer; width: 100%;
	box-shadow: 0 10px 24px rgba(25, 33, 61, .25);
	transition:
		background var(--kidsee-t-base) var(--kidsee-out),
		transform var(--kidsee-t-base) var(--kidsee-out);
}
.kidsee-promo-copy-btn svg { width: 18px; height: 18px; }
.kidsee-promo-copy-btn:hover { background: var(--kidsee-primary-050); transform: translateY(-1px); }
.kidsee-promo-copy-btn:active { transform: translateY(0); }
.kidsee-promo-copy-btn.is-copied { background: #1c7a4a; color: #fff; }

.kidsee-promo-modal__reassure {
	display: flex; align-items: center; justify-content: center; gap: 6px;
	font-size: 12.5px; color: rgba(255, 255, 255, .72); text-align: center; margin: 0;
}
.kidsee-promo-modal__reassure svg { width: 14px; height: 14px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
	.kidsee-promo-island,
	.kidsee-promo-island__pulse,
	.kidsee-promo-checklist__row {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}
