/* Magical Big Button — structural styles. Per-instance colors/size/font are set as
   inline CSS custom properties by the [magical_big_button] shortcode, so these
   var() fallbacks only apply if something goes unset. */

/* Page builders and themes (Elementor especially) ship global CSS for every
   `a`/`button` on the site — forced uppercase text, underlines, inherited
   line-height, a theme "link color", sometimes a background reset. Below,
   every property that's never touched by our own :hover/animation rules is
   marked !important so it can't be clobbered by that global CSS regardless
   of load order. box-shadow/transform/opacity are deliberately left WITHOUT
   !important — they're actively animated by the idle/entrance features, and
   an !important here would freeze those animations (author !important
   outranks CSS Animations in the cascade, so it would win over the
   keyframes and the button would stop moving). The element+class selector
   (instead of a bare class) adds a little extra specificity for those two
   properties, since !important isn't available as a safety net for them. */
a.magical-big-button-btn,
button.magical-big-button-btn {
	box-sizing: border-box !important;
	position: relative;
	display: inline-flex !important;
	align-items: center !important;
	gap: var(--magical-big-button-gap, 10px) !important;
	overflow: hidden;
	text-decoration: none !important;
	text-transform: none !important;
	white-space: nowrap;
	line-height: normal !important;
	cursor: pointer;
	/* Reset <button>-tag defaults (popup-mode buttons render as <button>, not <a>). */
	border: none !important;
	margin: 0 !important;
	background-color: transparent !important;
	appearance: none !important;
	font-weight: 600 !important;
	letter-spacing: -0.01em !important;
	font-family: var(--magical-big-button-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif) !important;
	font-size: var(--magical-big-button-font-size, 14px) !important;
	padding: var(--magical-big-button-pad-y, 14px) var(--magical-big-button-pad-x, 24px) !important;
	border-radius: var(--magical-big-button-radius, 12px) !important;
	color: var(--magical-big-button-text, #ffffff) !important;
	background-image: linear-gradient(180deg, var(--magical-big-button-1, #ff8a3a) 0%, var(--magical-big-button-2, #ff6b00) 50%, var(--magical-big-button-3, #e55c00) 100%) !important;
	box-shadow:
		0 18px 36px -12px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.6),
		0 8px 16px -6px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.28),
		0 0 0 1px rgba(10, 10, 10, 0.15);
	transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 500ms cubic-bezier(0.16, 1, 0.3, 1),
		color 250ms ease;
}

a.magical-big-button-btn:hover,
button.magical-big-button-btn:hover {
	color: var(--magical-big-button-text-hover, var(--magical-big-button-text, #ffffff)) !important;
	box-shadow:
		0 26px 48px -12px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.7),
		0 12px 24px -6px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.36),
		0 0 0 1px rgba(10, 10, 10, 0.15);
}

.magical-big-button-btn.is-animated:hover { transform: scale(1.025); }
.magical-big-button-btn.is-animated:active { transform: scale(0.98); }

/* diagonal shine sweep */
.magical-big-button-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	transform: translateX(-100%);
}
.magical-big-button-btn.is-animated::before { transition: transform 700ms ease-out; }
.magical-big-button-btn.is-animated:hover::before { transform: translateX(100%); }

/* soft top highlight */
.magical-big-button-btn::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: inherit;
	background: radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
	opacity: 0;
}
.magical-big-button-btn.is-animated::after { transition: opacity 500ms ease-out; }
.magical-big-button-btn.is-animated:hover::after { opacity: 1; }

/* Themes commonly ship a global `svg { width: 100%; height: auto }` reset —
   !important keeps the icon at its intended size regardless. */
.magical-big-button-btn__icon {
	position: relative;
	flex: none !important;
	width: var(--magical-big-button-icon-size, 16px) !important;
	height: var(--magical-big-button-icon-size, 16px) !important;
}
.magical-big-button-btn.is-animated .magical-big-button-btn__icon { transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1); }
.magical-big-button-btn.is-animated:hover .magical-big-button-btn__icon { transform: rotate(14deg) scale(1.1); }

/* Dashicons are a font icon, not an SVG: size via font-size and center the glyph. */
.magical-big-button-btn__icon.dashicons {
	font-size: var(--magical-big-button-icon-size, 16px) !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
}
.magical-big-button-btn__icon.dashicons:before {
	line-height: 1 !important;
}

.magical-big-button-btn__label { position: relative; }

.magical-big-button-btn__arrow {
	position: relative;
	flex: none !important;
	width: var(--magical-big-button-arrow-size, 13px) !important;
	height: var(--magical-big-button-arrow-size, 13px) !important;
	margin-left: -4px;
	opacity: 0;
	transform: translateX(-4px);
}
.magical-big-button-btn.is-animated .magical-big-button-btn__arrow {
	transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), opacity 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.magical-big-button-btn.is-animated:hover .magical-big-button-btn__arrow { opacity: 1; transform: translateX(0); }

/* without hover animation, show the arrow at rest instead of hiding it forever */
.magical-big-button-btn:not(.is-animated) .magical-big-button-btn__arrow { opacity: 1; transform: translateX(0); }

/* ------------------------------------------------------------------
 * Hover animation alternatives (Hover animation = Default uses the
 * .is-animated rules above, unchanged; these are the other choices).
 * ------------------------------------------------------------------ */

.magical-big-button-btn.hv-lift:hover {
	transform: scale(1.04) translateY(-2px);
	box-shadow:
		0 30px 54px -14px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.75),
		0 14px 26px -8px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.36),
		0 0 0 1px rgba(10, 10, 10, 0.15);
}

.magical-big-button-btn.hv-glow:hover {
	box-shadow:
		0 0 0 6px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.22),
		0 22px 44px -10px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.75),
		inset 0 1px 0 rgba(255, 255, 255, 0.36),
		0 0 0 1px rgba(10, 10, 10, 0.15);
}

.magical-big-button-btn.hv-bounce {
	transition: transform 550ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 400ms ease, color 250ms ease;
}
.magical-big-button-btn.hv-bounce:hover { transform: scale(1.08); }

/* ------------------------------------------------------------------
 * Idle animations — loop continuously at rest, pause on hover so the
 * hover animation takes clean, uncontested precedence.
 * ------------------------------------------------------------------ */

@keyframes magical-big-button-idle-breathe {
	0%, 100% {
		box-shadow:
			0 18px 36px -12px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.6),
			0 8px 16px -6px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.45),
			inset 0 1px 0 rgba(255, 255, 255, 0.28),
			0 0 0 1px rgba(10, 10, 10, 0.15);
	}
	50% {
		box-shadow:
			0 24px 50px -10px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.9),
			0 12px 26px -6px rgba(var(--magical-big-button-shadow-rgb, 255, 107, 0), 0.65),
			inset 0 1px 0 rgba(255, 255, 255, 0.28),
			0 0 0 1px rgba(10, 10, 10, 0.15);
	}
}
.magical-big-button-btn.idle-glow { animation: magical-big-button-idle-breathe 2600ms ease-in-out infinite; }
.magical-big-button-btn.idle-glow:hover { animation-play-state: paused; }

@keyframes magical-big-button-idle-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}
.magical-big-button-btn.idle-bounce { animation: magical-big-button-idle-bounce 1800ms ease-in-out infinite; }
.magical-big-button-btn.idle-bounce:hover { animation-play-state: paused; }

/* Shimmer needs a real element, not a pseudo-element — ::before/::after are
   already used by the hover shine sweep and top highlight above. */
.magical-big-button-btn__shimmer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.6) 50%, transparent 65%);
	transform: translateX(-130%);
}
.magical-big-button-btn.idle-shimmer .magical-big-button-btn__shimmer { animation: magical-big-button-idle-shimmer 2800ms ease-in-out infinite; }
.magical-big-button-btn.idle-shimmer:hover .magical-big-button-btn__shimmer { animation-play-state: paused; }
@keyframes magical-big-button-idle-shimmer {
	0% { transform: translateX(-130%); }
	55%, 100% { transform: translateX(130%); }
}

/* ------------------------------------------------------------------
 * Entrance animations — one-shot, added by assets/magical-big-button-entrance.js
 * the moment the button scrolls into view (or immediately, if it's
 * already in view on page load).
 * ------------------------------------------------------------------ */

@keyframes magical-big-button-ent-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes magical-big-button-ent-fade-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes magical-big-button-ent-scale {
	from { opacity: 0; transform: scale(0.88); }
	to { opacity: 1; transform: scale(1); }
}
@keyframes magical-big-button-ent-slide-left {
	from { opacity: 0; transform: translateX(-32px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes magical-big-button-ent-slide-right {
	from { opacity: 0; transform: translateX(32px); }
	to { opacity: 1; transform: translateX(0); }
}

/* Added by JS immediately before it starts observing scroll position — never
   present in the server-rendered HTML, so a button stays fully visible (just
   without the entrance animation) if JS fails to load for any reason, rather
   than getting stuck invisible. */
.magical-big-button-btn.magical-big-button-pre-entrance { opacity: 0; }

.magical-big-button-btn.ent-fade { animation: magical-big-button-ent-fade 550ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.magical-big-button-btn.ent-fade-rise { animation: magical-big-button-ent-fade-rise 600ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.magical-big-button-btn.ent-scale { animation: magical-big-button-ent-scale 550ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.magical-big-button-btn.ent-slide-left { animation: magical-big-button-ent-slide-left 600ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.magical-big-button-btn.ent-slide-right { animation: magical-big-button-ent-slide-right 600ms cubic-bezier(0.16, 1, 0.3, 1) both; }

@media (prefers-reduced-motion: reduce) {
	.magical-big-button-btn.magical-big-button-pre-entrance { opacity: 1; }
	.magical-big-button-btn.ent-fade,
	.magical-big-button-btn.ent-fade-rise,
	.magical-big-button-btn.ent-scale,
	.magical-big-button-btn.ent-slide-left,
	.magical-big-button-btn.ent-slide-right {
		animation: none;
	}
	.magical-big-button-btn.idle-glow,
	.magical-big-button-btn.idle-bounce,
	.magical-big-button-btn.idle-shimmer .magical-big-button-btn__shimmer {
		animation: none;
	}
}

/* ------------------------------------------------------------------
 * Popup (click action = "Open a popup")
 * ------------------------------------------------------------------ */

.magical-big-button-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.magical-big-button-popup[hidden] { display: none; }

.magical-big-button-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 20, 0.55);
}

/* Shell holds the size constraints; the dialog fills it exactly and owns
   the rounded, clipped shape (it does NOT scroll itself — border-radius +
   overflow-y:auto on the SAME element lets the scrollbar square off the
   corner it sits against once content is tall enough to scroll; a plain
   inner wrapper handles scrolling instead). The close button is a SIBLING
   of the dialog, not a child of it, so its "flush"/"floating" positions can
   sit on/outside the rounded corner without being clipped by the dialog's
   own overflow:hidden. Width/height are per-button settings, each clamped
   with min() so any value chosen degrades to internal scrolling on small
   screens rather than overflowing them. */
.magical-big-button-popup__dialog-shell {
	position: relative;
	width: 100%;
	max-width: min(var(--magical-big-button-popup-width, 480px), 100%);
	max-height: min(var(--magical-big-button-popup-height, 640px), 85vh);
	display: flex;
}
.magical-big-button-popup__dialog {
	position: relative;
	width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: #14142b;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
}
@media (max-width: 480px) {
	.magical-big-button-popup { padding: 12px; }
	.magical-big-button-popup__dialog { border-radius: 14px; }
	.magical-big-button-popup__scroll { padding: 20px; }
}

/* "Inset" (default) — button sits inside the dialog with a small margin. */
.magical-big-button-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: #f0f0f1;
	color: #1d2327;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.magical-big-button-popup__close:hover { background: #e2e2e3; }

/* "Flush" — right at the dialog's edge, still fully inside its rounded box. */
.magical-big-button-popup__dialog-shell.close-flush .magical-big-button-popup__close {
	top: 0;
	right: 0;
}

/* "Floating" — a badge that overlaps the corner, half outside the dialog. */
.magical-big-button-popup__dialog-shell.close-floating .magical-big-button-popup__close {
	top: -14px;
	right: -14px;
	background: #ffffff;
	box-shadow: 0 4px 14px -2px rgba(20, 22, 30, 0.3), 0 0 0 1px rgba(20, 22, 30, 0.06);
}
.magical-big-button-popup__dialog-shell.close-floating .magical-big-button-popup__close:hover { background: #f6f6f7; }

.magical-big-button-popup__scroll {
	min-height: 0;
	overflow-y: auto;
	padding: 32px;
}

.magical-big-button-popup__heading {
	margin: 0 0 16px;
	padding-right: 32px;
	font-size: 1.4rem;
	font-weight: 700;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.magical-big-button-popup__visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.magical-big-button-popup__dialog {
		animation: magical-big-button-popup-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
	}
}
@keyframes magical-big-button-popup-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
