/* BLÜ Ruleta de Aniversario — Pop-up */

#blu-wheel-modal,
#blu-wheel-modal *,
#blu-wheel-modal *::before,
#blu-wheel-modal *::after {
	box-sizing: border-box;
}

#blu-wheel-modal [hidden] {
	display: none !important;
}

#blu-wheel-modal[hidden] {
	display: none !important;
}

body.blu-wheel-lock {
	overflow: hidden;
}

.blu-wheel-overlay {
	--blu-bg: #00A89C;
	--blu-text: #FFFFFF;
	--blu-btn: #FCD116;
	--blu-btn-text: #1B3B36;
	--blu-ink: #1B3B36;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: rgba(8, 34, 31, 0.72);
	opacity: 0;
	transition: opacity 0.3s ease;
	-webkit-tap-highlight-color: transparent;
}

.blu-wheel-overlay.is-open {
	opacity: 1;
}

/* ---------- Diálogo: mobile primero (apilado) ---------- */

#blu-wheel-modal .blu-wheel-dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"header"
		"stage"
		"panel";
	gap: 12px;
	align-content: center;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	margin: 0;
	padding: 46px 18px 20px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 22px;
	background: var(--blu-bg);
	color: var(--blu-text);
	font-size: 16px;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
	outline: none;
	transform: translateY(18px) scale(0.97);
	transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

#blu-wheel-modal.is-open .blu-wheel-dialog {
	transform: none;
}

#blu-wheel-modal .blu-wheel-deco {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	pointer-events: none;
	user-select: none;
}

#blu-wheel-modal .blu-wheel-header,
#blu-wheel-modal .blu-wheel-stage,
#blu-wheel-modal .blu-wheel-panel {
	position: relative;
	z-index: 1;
	min-width: 0;
}

#blu-wheel-modal .blu-wheel-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	color: var(--blu-text);
	box-shadow: none;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
}

#blu-wheel-modal .blu-wheel-close:hover,
#blu-wheel-modal .blu-wheel-close:focus-visible {
	background: rgba(255, 255, 255, 0.36);
	transform: rotate(90deg);
}

#blu-wheel-modal .blu-wheel-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	max-width: calc(100% - 70px);
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--blu-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
}

/* ---------- Encabezado ---------- */

#blu-wheel-modal .blu-wheel-header {
	grid-area: header;
}

#blu-wheel-modal .blu-wheel-header-img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 88px;
	margin: 0 auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

#blu-wheel-modal .blu-wheel-title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-transform: none;
}

#blu-wheel-modal .blu-wheel-subtitle {
	margin: 6px 0 0;
	padding: 0;
	color: inherit;
	font-size: 14px;
	line-height: 1.35;
	opacity: 0.95;
}

/* ---------- Ruleta ---------- */

#blu-wheel-modal .blu-wheel-stage {
	grid-area: stage;
	display: flex;
	justify-content: center;
	padding-top: 12px;
}

#blu-wheel-modal .blu-wheel-wheelbox {
	position: relative;
	width: min(74vw, 38vh, 340px);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
	transition: width 0.4s ease;
}

#blu-wheel-modal .blu-wheel-canvas {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border-radius: 50%;
	transform: rotate(0deg);
	will-change: transform;
}

#blu-wheel-modal .blu-wheel-pointer {
	position: absolute;
	top: -5%;
	left: 50%;
	z-index: 2;
	width: 12%;
	height: auto;
	margin: 0;
	overflow: visible;
	transform: translateX(-50%);
	fill: var(--blu-btn);
	filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

#blu-wheel-modal .blu-wheel-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 23%;
	height: 23%;
	border: 4px solid #fff;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transform: translate(-50%, -50%);
	overflow: hidden;
}

#blu-wheel-modal .blu-wheel-hub img {
	display: block;
	width: 74%;
	height: 74%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
}

#blu-wheel-modal .blu-wheel-hub span {
	color: var(--blu-bg);
	font-size: clamp(22px, 7vw, 42px);
	font-weight: 800;
	line-height: 1;
}

/* ---------- Panel: formulario y resultado ---------- */

#blu-wheel-modal .blu-wheel-panel {
	grid-area: panel;
	width: 100%;
	max-width: 380px;
	margin: 0 auto;
}

#blu-wheel-modal .blu-wheel-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

#blu-wheel-modal .blu-wheel-form.is-leaving {
	opacity: 0;
	transform: translateY(8px);
}

#blu-wheel-modal .blu-wheel-field {
	display: block;
	margin: 0;
	padding: 0;
}

#blu-wheel-modal .blu-wheel-sr,
#blu-wheel-modal .blu-wheel-hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

#blu-wheel-modal .blu-wheel-field input {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: 12px;
	background: #fff;
	color: var(--blu-ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-align: left;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	appearance: none;
	-webkit-appearance: none;
}

#blu-wheel-modal .blu-wheel-field input::placeholder {
	color: #7c8f8c;
	opacity: 1;
}

#blu-wheel-modal .blu-wheel-field input:focus {
	border-color: var(--blu-btn);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

#blu-wheel-modal .blu-wheel-field input.is-invalid {
	border-color: #E5484D;
}

#blu-wheel-modal .blu-wheel-field input[readonly] {
	background: rgba(255, 255, 255, 0.85);
	color: #51625f;
}

#blu-wheel-modal .blu-wheel-msg {
	margin: 0;
	padding: 9px 12px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.96);
	color: #B3261E;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

#blu-wheel-modal .blu-wheel-msg.is-info {
	background: var(--blu-ink);
	color: #fff;
	font-size: 16px;
	animation: blu-wheel-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

#blu-wheel-modal .blu-wheel-btn {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 2px 0 0;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--blu-btn);
	color: var(--blu-btn-text);
	font-family: inherit;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), 0 10px 22px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

#blu-wheel-modal .blu-wheel-btn:hover,
#blu-wheel-modal .blu-wheel-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 7px 0 rgba(0, 0, 0, 0.18), 0 14px 26px rgba(0, 0, 0, 0.2);
}

#blu-wheel-modal .blu-wheel-btn:focus-visible,
#blu-wheel-modal .blu-wheel-close:focus-visible,
#blu-wheel-modal .blu-wheel-finish:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

#blu-wheel-modal .blu-wheel-btn:active {
	transform: translateY(3px);
	box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

#blu-wheel-modal .blu-wheel-btn:disabled {
	opacity: 0.7;
	cursor: wait;
	transform: none;
}

#blu-wheel-modal .blu-wheel-result {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	animation: blu-wheel-in 0.5s ease both;
}

#blu-wheel-modal .blu-wheel-result-title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.01em;
}

#blu-wheel-modal .blu-wheel-result-prize {
	margin: 0;
	padding: 5px 14px;
	border-radius: 999px;
	background: var(--blu-ink);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
}

#blu-wheel-modal .blu-wheel-result-sub {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 15px;
	line-height: 1.4;
	white-space: pre-line;
}

#blu-wheel-modal .blu-wheel-coupon {
	width: 100%;
	margin: 4px 0 2px;
	padding: 14px 12px;
	border: 2px dashed var(--blu-bg);
	border-radius: 14px;
	background: #fff;
	color: var(--blu-ink);
	box-shadow: 0 0 0 5px #fff, 0 8px 20px rgba(0, 0, 0, 0.2);
}

#blu-wheel-modal .blu-wheel-coupon-code {
	display: block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
	font-size: clamp(18px, 5.4vw, 26px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.08em;
	overflow-wrap: anywhere;
	user-select: all;
}

#blu-wheel-modal .blu-wheel-finish {
	margin: 4px 0 0;
	padding: 6px 10px;
	border: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	opacity: 0.9;
}

/* En mobile, al mostrar el resultado la ruleta se achica para dejar lugar al cupón. */
#blu-wheel-modal .blu-wheel-dialog.is-result .blu-wheel-header {
	display: none;
}

#blu-wheel-modal .blu-wheel-dialog.is-result .blu-wheel-wheelbox {
	width: min(52vw, 26vh, 240px);
}

@keyframes blu-wheel-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes blu-wheel-pop {
	from {
		opacity: 0;
		transform: scale(0.9);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Desktop: 2 columnas ---------- */

@media (min-width: 768px) {
	.blu-wheel-overlay {
		padding: 24px;
	}

	#blu-wheel-modal .blu-wheel-dialog {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-areas:
			"stage header"
			"stage panel";
		gap: 22px 44px;
		max-width: 940px;
		max-height: calc(100vh - 48px);
		max-height: calc(100dvh - 48px);
		padding: 48px 48px 48px 44px;
		border-radius: 28px;
	}

	#blu-wheel-modal .blu-wheel-stage {
		align-self: center;
		padding-top: 18px;
	}

	#blu-wheel-modal .blu-wheel-wheelbox,
	#blu-wheel-modal .blu-wheel-dialog.is-result .blu-wheel-wheelbox {
		width: min(100%, 400px, 70vh);
	}

	#blu-wheel-modal .blu-wheel-header {
		align-self: end;
	}

	#blu-wheel-modal .blu-wheel-panel {
		align-self: start;
	}

	#blu-wheel-modal .blu-wheel-dialog.is-result .blu-wheel-panel {
		grid-row: 1 / -1;
		align-self: center;
	}

	#blu-wheel-modal .blu-wheel-header-img {
		max-height: 190px;
	}

	#blu-wheel-modal .blu-wheel-title {
		font-size: 42px;
	}

	#blu-wheel-modal .blu-wheel-subtitle {
		margin-top: 10px;
		font-size: 17px;
	}

	#blu-wheel-modal .blu-wheel-form {
		gap: 10px;
	}

	#blu-wheel-modal .blu-wheel-field input {
		height: 52px;
	}

	#blu-wheel-modal .blu-wheel-btn {
		min-height: 56px;
		font-size: 18px;
	}

	#blu-wheel-modal .blu-wheel-result {
		gap: 12px;
	}

	#blu-wheel-modal .blu-wheel-result-title {
		font-size: 44px;
	}

	#blu-wheel-modal .blu-wheel-result-sub {
		font-size: 17px;
	}

	#blu-wheel-modal .blu-wheel-coupon {
		padding: 18px 14px;
	}

	#blu-wheel-modal .blu-wheel-coupon-code {
		font-size: 26px;
	}

	#blu-wheel-modal .blu-wheel-hub span {
		font-size: 44px;
	}
}

/* Pantallas muy bajas (celular apaisado). */
@media (max-width: 767px) and (max-height: 560px) {
	#blu-wheel-modal .blu-wheel-header-img {
		max-height: 56px;
	}

	#blu-wheel-modal .blu-wheel-wheelbox {
		width: min(60vw, 46vh, 300px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.blu-wheel-overlay,
	#blu-wheel-modal .blu-wheel-dialog,
	#blu-wheel-modal .blu-wheel-wheelbox,
	#blu-wheel-modal .blu-wheel-result,
	#blu-wheel-modal .blu-wheel-msg.is-info {
		transition: none;
		animation: none;
	}
}
