/**
 * Gold gradient border + 3 glowing balls on Egypt pack cards.
 * Balls are JS-animated strictly along the card border perimeter (RAF).
 * Uses child overlays (not ::before) — Elementor already owns ::before on pack .e-con.
 * Applied to any carousel with data-masc-epc="1" whose cards are decorated by JS
 * (Home 34a81cf + Programs 00a307d via goldBorderWidgetIds).
 */

[data-masc-epc='1'] .masc-pack-gold-frame {
	position: relative;
	isolation: isolate;
	overflow: visible !important;
}

/* Keep gold ring outside any Elementor overflow:hidden on nested .e-con */
[data-masc-epc='1'] .masc-pack-gold-frame.e-con,
[data-masc-epc='1'] .swiper-slide > .elementor-element.masc-pack-gold-frame,
[data-masc-epc='1'] .swiper-slide > .elementor-element {
	overflow: visible !important;
}

[data-masc-epc='1'] .masc-pack-gold-frame > :not(.masc-pack-gold-border):not(.masc-pack-gold-ball):not(.masc-pack-gold-ball--b):not(.masc-pack-gold-ball--c) {
	position: relative;
	z-index: 1;
}

/* ── Shared: no pointer events ─────────────────────────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-border,
[data-masc-epc='1'] .masc-pack-gold-ball,
[data-masc-epc='1'] .masc-pack-gold-ball--b,
[data-masc-epc='1'] .masc-pack-gold-ball--c {
	pointer-events: none;
}

/* ── Static gold gradient ring ─────────────────────────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-border {
	position: absolute;
	inset: 0;
	border-radius: var(--masc-pack-radius, 12px);
	z-index: 20;
	padding: 2px;
	background: linear-gradient(
		135deg,
		#6b4500 0%,
		#9d7a54 12%,
		#ffe27a 28%,
		#ffd700 50%,
		#c9a227 72%,
		#8b6914 88%,
		#6b4500 100%
	);
	-webkit-mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask:
		linear-gradient(#000 0 0) content-box,
		linear-gradient(#000 0 0);
	mask-composite: exclude;
	box-shadow:
		0 0 18px rgba(255, 215, 0, 0.28),
		0 0 6px rgba(255, 226, 122, 0.4);
}

/* ── Shared ball base styles ────────────────────────────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-ball,
[data-masc-epc='1'] .masc-pack-gold-ball--b,
[data-masc-epc='1'] .masc-pack-gold-ball--c {
	position: absolute;
	left: 0;
	top: 0;
	border-radius: 50%;
	z-index: 25;
	/* will-change only while animating — set via JS when RAF is active */
}

/* ── Primary ball — largest, brightest ─────────────────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-ball {
	width: 7px;
	height: 7px;
	margin-left: -3.5px;
	margin-top: -3.5px;
	background: radial-gradient(circle at center, #ffffff 0%, #fff8d2 20%, #ffd700 70%);
	box-shadow:
		0 0 3px 1px rgba(255, 255, 255, 0.95),
		0 0 8px 3px rgba(255, 215, 0, 0.9),
		0 0 16px 7px rgba(255, 165, 0, 0.6),
		0 0 28px 12px rgba(255, 200, 0, 0.28);
}

/* ── Secondary ball — medium size, warm orange tint ────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-ball--b {
	width: 5px;
	height: 5px;
	margin-left: -2.5px;
	margin-top: -2.5px;
	background: radial-gradient(circle at center, #ffffff 0%, #fff3b0 25%, #ffb300 75%);
	box-shadow:
		0 0 2px 1px rgba(255, 255, 255, 0.9),
		0 0 6px 2px rgba(255, 200, 0, 0.85),
		0 0 12px 5px rgba(255, 140, 0, 0.55),
		0 0 22px 9px rgba(255, 180, 0, 0.22);
	opacity: 0.88;
}

/* ── Tertiary ball — smallest, most subtle, deep amber ─────────────────── */
[data-masc-epc='1'] .masc-pack-gold-ball--c {
	width: 4px;
	height: 4px;
	margin-left: -2px;
	margin-top: -2px;
	background: radial-gradient(circle at center, #fffde0 0%, #ffd700 45%, #cc8800 100%);
	box-shadow:
		0 0 2px 1px rgba(255, 255, 255, 0.8),
		0 0 5px 2px rgba(255, 215, 0, 0.75),
		0 0 10px 4px rgba(255, 150, 0, 0.45),
		0 0 20px 8px rgba(255, 180, 0, 0.2);
	opacity: 0.72;
}

/* ── Shared luminous wave (::after) ─────────────────────────────────────── */
[data-masc-epc='1'] .masc-pack-gold-ball::after,
[data-masc-epc='1'] .masc-pack-gold-ball--b::after,
[data-masc-epc='1'] .masc-pack-gold-ball--c::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 215, 0, 0.55);
	transform: translate(-50%, -50%) scale(1);
}

/* Primary ball pulse: 2 s */
[data-masc-epc='1'] .masc-pack-gold-ball::after {
	animation: masc-ball-pulse 2s ease-out infinite;
}

/* Secondary ball pulse: slower, offset */
[data-masc-epc='1'] .masc-pack-gold-ball--b::after {
	animation: masc-ball-pulse 2.5s ease-out infinite;
	animation-delay: -0.9s;
}

/* Tertiary ball pulse: fastest, most subtle */
[data-masc-epc='1'] .masc-pack-gold-ball--c::after {
	animation: masc-ball-pulse 1.8s ease-out infinite;
	animation-delay: -0.4s;
}

@keyframes masc-ball-pulse {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.7;
	}
	100% {
		transform: translate(-50%, -50%) scale(5.5);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	[data-masc-epc='1'] .masc-pack-gold-ball::after,
	[data-masc-epc='1'] .masc-pack-gold-ball--b::after,
	[data-masc-epc='1'] .masc-pack-gold-ball--c::after {
		animation: none;
		opacity: 0;
	}
}

@media (max-width: 767px) {
	[data-masc-epc='1'] .masc-pack-gold-border {
		padding: 2px;
	}
}
