/* Creativa Engage – Ruleta de premios */

.ce-modal, .ce-floating, .ce-wheel, .ce-checkout-consent {
	--ce-primary: #E6007E;
	--ce-secondary: #7B3FA0;
	--ce-ink: #1d1a33;
	--ce-muted: #6b6684;
	--ce-line: #e7e2f1;
	--ce-gold: #f6a821;
	--ce-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.ce-modal *, .ce-modal *::before, .ce-modal *::after, .ce-wheel *, .ce-floating * { box-sizing: border-box; }
html.ce-lock, html.ce-lock body { overflow: hidden !important; }

/* ------------------------------------------------------------------ Ruleta */
.ce-wheel-holder { width: 100%; max-width: 420px; margin: 0 auto; position: relative; z-index: 2; }
.ce-wheel { position: relative; width: 100%; aspect-ratio: 1 / 1; user-select: none; -webkit-user-select: none; }
.ce-wheel__frame, .ce-wheel__rotor { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.ce-wheel__frame { filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.ce-wheel__rotor { will-change: transform; transform-origin: 50% 50%; }
.ce-seg-text { font-family: var(--ce-font); letter-spacing: .2px; paint-order: stroke; stroke: rgba(0,0,0,.12); stroke-width: 2px; }

.ce-bulb { transition: fill .2s; }
.ce-bulb--a { animation: ce-bulb 1.2s infinite; }
.ce-bulb--b { animation: ce-bulb 1.2s infinite .6s; }
.ce-wheel.is-spinning .ce-bulb--a { animation-duration: .25s; }
.ce-wheel.is-spinning .ce-bulb--b { animation-duration: .25s; animation-delay: .125s; }
@keyframes ce-bulb {
	0%, 100% { fill: #fff6cf; filter: drop-shadow(0 0 4px #ffd86b); }
	50% { fill: #8a6a2a; filter: none; }
}

.ce-wheel__gloss {
	position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
	background: radial-gradient(circle at 32% 22%, rgba(255,255,255,.32), rgba(255,255,255,0) 46%),
	            radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,.18) 100%);
}

.ce-wheel__hub {
	position: absolute; left: 50%; top: 50%; width: 23%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
	border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffffff, #f1eef8);
	box-shadow: 0 0 0 4px #ffe7a3, 0 0 0 7px var(--ce-gold), 0 10px 24px rgba(0,0,0,.35), inset 0 -4px 10px rgba(60,40,120,.12);
	display: grid; place-items: center; z-index: 3;
}
.ce-wheel__logo {
	width: 64%; height: 64%; object-fit: contain; display: block;
	animation: ce-logo-spin 7s linear infinite;
	filter: drop-shadow(0 2px 3px rgba(0,0,0,.15));
}
.ce-wheel.is-spinning .ce-wheel__logo { animation-duration: .7s; }
.ce-wheel.is-done .ce-wheel__hub { animation: ce-hub-pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes ce-logo-spin { to { transform: rotate(360deg); } }
@keyframes ce-hub-pop { 0% { transform: translate(-50%,-50%) scale(1); } 40% { transform: translate(-50%,-50%) scale(1.18); } 100% { transform: translate(-50%,-50%) scale(1); } }

.ce-wheel__pointer {
	position: absolute; left: 50%; top: -3.5%; width: 11%; transform: translateX(-50%); transform-origin: 50% 30%;
	z-index: 4; filter: drop-shadow(0 5px 6px rgba(0,0,0,.35));
}
.ce-wheel__pointer svg { display: block; width: 100%; height: auto; }
.ce-pin-dot { fill: var(--ce-primary); }
.ce-wheel__pointer.is-tick { animation: ce-tick .18s ease-out; }
@keyframes ce-tick { 0% { transform: translateX(-50%) rotate(0); } 35% { transform: translateX(-50%) rotate(-16deg); } 100% { transform: translateX(-50%) rotate(0); } }

/* ------------------------------------------------------------------ Modal */
.ce-modal {
	position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center; padding: 16px;
	font-family: var(--ce-font); color: var(--ce-ink); visibility: hidden; pointer-events: none;
	line-height: 1.45; -webkit-font-smoothing: antialiased;
}
.ce-modal.is-open { visibility: visible; pointer-events: auto; }
.ce-modal__backdrop {
	position: absolute; inset: 0; background: rgba(16, 12, 36, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	opacity: 0; transition: opacity .35s ease;
}
.ce-modal.is-open .ce-modal__backdrop { opacity: 1; }

.ce-modal__card {
	position: relative; width: min(940px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
	display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; border-radius: 28px;
	box-shadow: 0 40px 120px rgba(10, 5, 40, .5);
	opacity: 0; transform: translateY(24px) scale(.94); transition: opacity .35s ease, transform .55s cubic-bezier(.2,1.3,.4,1);
	scrollbar-width: none;
}
.ce-modal__card::-webkit-scrollbar { display: none; }
.ce-modal.is-open .ce-modal__card { opacity: 1; transform: none; }

.ce-modal__close {
	position: absolute; top: 14px; right: 14px; z-index: 10; width: 38px; height: 38px; border-radius: 50%;
	border: 0; padding: 0; margin: 0; cursor: pointer; font-size: 24px; line-height: 38px; text-align: center;
	color: var(--ce-muted); background: #f4f1fa; transition: background .2s, color .2s, transform .2s; box-shadow: none; text-transform: none;
}
.ce-modal__close:hover, .ce-modal__close:focus { background: var(--ce-ink); color: #fff; transform: rotate(90deg); }

.ce-modal__stage {
	position: relative; overflow: hidden; padding: 48px 36px; display: grid; place-items: center;
	background: radial-gradient(120% 90% at 50% 0%, #2c2160 0%, #15112e 60%, #0e0b22 100%);
}
.ce-modal__stage::before {
	content: ""; position: absolute; inset: 0; opacity: .5;
	background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.2px);
	background-size: 26px 26px; mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 70%);
	-webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 70%);
}
.ce-blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; animation: ce-float 9s ease-in-out infinite; }
.ce-blob--1 { width: 55%; height: 55%; left: -12%; top: -10%; background: #E6007E; }
.ce-blob--2 { width: 50%; height: 50%; right: -15%; bottom: -12%; background: #2E6DB4; animation-delay: -3s; }
.ce-blob--3 { width: 38%; height: 38%; right: 8%; top: 4%; background: #F7931E; opacity: .35; animation-delay: -6s; }
@keyframes ce-float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6%, 8%) scale(1.08); } }

.ce-modal__content { position: relative; padding: 46px 42px 32px; display: flex; flex-direction: column; justify-content: center; }

.ce-eyebrow {
	display: inline-block; align-self: flex-start; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
	color: var(--ce-primary); background: color-mix(in srgb, var(--ce-primary) 10%, #fff); margin-bottom: 14px; letter-spacing: .2px;
}
.ce-modal .ce-title { font-family: var(--ce-font); font-size: clamp(24px, 2.6vw, 31px); line-height: 1.12; font-weight: 800; letter-spacing: -.6px; margin: 0 0 10px; color: var(--ce-ink); }
.ce-modal .ce-sub { font-size: 15px; color: var(--ce-muted); margin: 0 0 22px; }
.ce-modal .ce-sub strong { color: var(--ce-ink); }

.ce-form-spin { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ce-form-spin.is-locked { opacity: .55; pointer-events: none; }
.ce-input { display: block; margin: 0; }
.ce-input > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ce-ink); margin: 0 0 6px 2px; }
.ce-input em { font-style: normal; font-weight: 500; color: var(--ce-muted); }
.ce-modal .ce-input input {
	width: 100%; height: 50px; padding: 0 16px; margin: 0; font: 500 16px var(--ce-font); color: var(--ce-ink);
	background: #faf9fd; border: 1.5px solid var(--ce-line); border-radius: 14px; outline: none; box-shadow: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
.ce-modal .ce-input input:focus { border-color: var(--ce-primary); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ce-primary) 15%, transparent); }

.ce-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--ce-muted); cursor: pointer; margin: 0; }
.ce-check input {
	appearance: none; -webkit-appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin: 0; border-radius: 6px;
	border: 1.5px solid #cfc8e0; background: #fff; display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.ce-check input::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px) scale(0); transition: transform .15s; }
.ce-check input:checked { background: var(--ce-primary); border-color: var(--ce-primary); }
.ce-check input:checked::after { transform: rotate(-45deg) translate(1px,-1px) scale(1); }
.ce-check input:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ce-primary) 25%, transparent); }
.ce-check a { color: var(--ce-ink); text-decoration: underline; }

.ce-error { font-size: 13.5px; font-weight: 600; color: #c4123b; background: #fff0f3; border-radius: 10px; padding: 10px 12px; }

.ce-modal .ce-cta, .ce-modal a.ce-cta {
	position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; height: 56px; padding: 0 26px; margin: 6px 0 0; border: 0; border-radius: 999px; cursor: pointer;
	font: 800 17px var(--ce-font); letter-spacing: .2px; text-transform: none; text-decoration: none; color: #fff !important;
	background: linear-gradient(135deg, var(--ce-primary), var(--ce-secondary));
	box-shadow: 0 12px 28px color-mix(in srgb, var(--ce-primary) 40%, transparent);
	transition: transform .2s, box-shadow .2s, filter .2s;
}
.ce-modal .ce-cta::after {
	content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg);
	animation: ce-shine 3.2s ease-in-out infinite;
}
@keyframes ce-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.ce-modal .ce-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px color-mix(in srgb, var(--ce-primary) 50%, transparent); }
.ce-modal .ce-cta:disabled { cursor: default; filter: saturate(.8); transform: none; }
.ce-cta__spinner { display: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: ce-rot .7s linear infinite; }
.ce-cta.is-loading .ce-cta__spinner { display: inline-block; }
@keyframes ce-rot { to { transform: rotate(360deg); } }

.ce-legal { font-size: 11.5px; color: var(--ce-muted); margin-top: 4px; }
.ce-legal summary { cursor: pointer; font-weight: 600; list-style: none; text-align: center; }
.ce-legal summary::-webkit-details-marker { display: none; }
.ce-legal summary::after { content: " ▾"; }
.ce-legal[open] summary::after { content: " ▴"; }
.ce-legal dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 0; padding: 12px; background: #faf9fd; border-radius: 12px; }
.ce-legal dt { font-weight: 700; color: var(--ce-ink); margin: 0; }
.ce-legal dd { margin: 0; }
.ce-legal a { color: var(--ce-primary); }

/* Resultado */
.ce-result { text-align: center; animation: ce-in .5s cubic-bezier(.2,1.3,.4,1); }
@keyframes ce-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.ce-result__icon { font-size: 54px; line-height: 1; margin-bottom: 10px; animation: ce-bounce 1.2s ease-in-out infinite; display: inline-block; }
@keyframes ce-bounce { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-6deg); } }
.ce-coupon {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 16px 16px 16px 20px; margin: 4px 0 10px;
	border: 2px dashed var(--ce-primary); border-radius: 18px; background: color-mix(in srgb, var(--ce-primary) 5%, #fff);
}
.ce-coupon__label { width: 100%; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ce-muted); font-weight: 700; }
.ce-coupon__code { font: 800 24px "SFMono-Regular", Consolas, Menlo, monospace; letter-spacing: 2px; color: var(--ce-primary); background: none; padding: 0; }
.ce-modal .ce-coupon__copy {
	border: 0; margin: 0; cursor: pointer; padding: 9px 16px; border-radius: 999px; font: 700 13px var(--ce-font); text-transform: none;
	background: var(--ce-ink); color: #fff; transition: background .2s;
}
.ce-modal .ce-coupon__copy.is-ok { background: #1a9a5b; }
.ce-timer { font-size: 14px; color: var(--ce-muted); margin: 0 0 4px; }
.ce-timer strong { font-variant-numeric: tabular-nums; color: var(--ce-ink); font-size: 16px; }
.ce-note { font-size: 13px; color: var(--ce-muted); margin: 0 0 14px; }
.ce-modal .ce-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ce-modal .ce-link { border: 0; background: none; color: var(--ce-muted); font: 600 14px var(--ce-font); cursor: pointer; text-decoration: underline; padding: 8px; margin: 0; text-transform: none; box-shadow: none; }

.ce-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }

/* ------------------------------------------------------------------ Botón flotante */
.ce-floating {
	position: fixed; left: 18px; bottom: 18px; z-index: 99998; display: inline-flex; align-items: center; gap: 10px;
	padding: 6px 18px 6px 6px; margin: 0; border: 0; border-radius: 999px; cursor: pointer;
	font: 800 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #fff; text-transform: none; letter-spacing: .1px;
	background: linear-gradient(135deg, var(--ce-primary), var(--ce-secondary));
	box-shadow: 0 12px 30px rgba(30, 10, 60, .35); transform: translateY(140%); transition: transform .5s cubic-bezier(.2,1.3,.4,1);
}
.ce-floating.is-in { transform: none; }
.ce-floating.is-hidden { transform: translateY(160%); }
.ce-floating:hover { filter: brightness(1.06); }
.ce-floating::before {
	content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ce-primary) 60%, transparent);
	animation: ce-pulse 2.4s infinite;
}
@keyframes ce-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ce-primary) 55%, transparent); } 70%,100% { box-shadow: 0 0 0 16px transparent; } }
.ce-floating__wheel {
	width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; position: relative;
	box-shadow: inset 0 0 0 3px #ffd86b;
}
.ce-floating__wheel::before {
	content: ""; position: absolute; inset: 3px; border-radius: 50%;
	background: conic-gradient(#E4202E 0 12.5%, #F7931E 0 25%, #F9C80E 0 37.5%, #7DBE3C 0 50%, #17A7A8 0 62.5%, #2E6DB4 0 75%, #6A3FA0 0 87.5%, #E6007E 0);
	animation: ce-logo-spin 6s linear infinite; opacity: .95;
}
.ce-floating__wheel img { position: relative; width: 22px; height: 22px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; box-sizing: content-box; }

.ce-inline-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border: 0; border-radius: 999px; cursor: pointer;
	font-weight: 800; color: #fff; background: linear-gradient(135deg, #E6007E, #7B3FA0); box-shadow: 0 10px 24px rgba(230,0,126,.3);
}

/* ------------------------------------------------------------------ Checkout */
.ce-checkout-consent {
	display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px;
	background: #faf9fd; border: 1px solid var(--ce-line); font-size: 14px; line-height: 1.45; cursor: pointer;
}
.ce-checkout-consent input { margin: 3px 0 0; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--ce-primary); }
.ce-checkout-consent small { display: block; color: #8a85a0; font-size: 12px; margin-top: 2px; }
.ce-checkout-consent small a { color: inherit; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 760px) {
	.ce-modal { padding: 10px; align-items: end; }
	.ce-modal__card { grid-template-columns: 1fr; border-radius: 26px; max-height: calc(100dvh - 20px); }
	.ce-modal__stage { padding: 30px 30px 22px; }
	.ce-wheel-holder { max-width: min(300px, 74vw); }
	.ce-modal__content { padding: 22px 22px 22px; }
	.ce-modal .ce-title { font-size: 23px; }
	.ce-modal .ce-sub { margin-bottom: 16px; font-size: 14px; }
	.ce-modal__close { background: rgba(255,255,255,.15); color: #fff; }
	.ce-floating { left: 12px; bottom: 12px; }
	.ce-modal.is-spinning .ce-modal__content { opacity: .6; }
}
@media (max-width: 380px) {
	.ce-floating__text { display: none; }
	.ce-floating { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.ce-blob, .ce-bulb--a, .ce-bulb--b, .ce-modal .ce-cta::after, .ce-floating::before, .ce-result__icon { animation: none !important; }
}
