/* LuckyUp for WooCommerce, frontend */

/* Hidden parts must stay hidden even when a class sets display. */
.lu-card [hidden] { display: none !important; }

.lu-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(30, 20, 25, 0.55);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.lu-overlay.lu-show { opacity: 1; }

.lu-card {
	--lu-primary: #d94f70;
	--lu-accent: #8ba888;
	--lu-bg: #ffffff;
	--lu-text: #2b2124;
	--lu-soft: #6b5a5f;
	--lu-radius: 18px;
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: var(--lu-bg);
	color: var(--lu-text);
	border-radius: var(--lu-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	font-family: inherit;
	text-align: center;
	border: 6px solid var(--lu-border, transparent);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
}
.lu-show .lu-card { transform: none; }
.luckyup-inline .lu-card { margin: 0 auto; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08); transform: none; max-height: none; }

.lu-inner { position: relative; z-index: 1; padding: 30px 26px 26px; }
.lu-logo { max-height: 48px; width: auto; margin: 0 auto 10px; display: block; }
.lu-title { margin: 0 0 6px; font-size: 26px; line-height: 1.2; color: var(--lu-title, var(--lu-text)); }
.lu-sub { margin: 0 0 16px; color: var(--lu-soft); font-size: 15px; line-height: 1.5; }

.lu-close {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 3;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--lu-text);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.lu-close:focus-visible, .lu-btn:focus-visible, .lu-floating:focus-visible {
	outline: 3px solid var(--lu-primary);
	outline-offset: 2px;
}

/* Form */
.lu-form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.lu-input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid #ddd0d3;
	border-radius: 10px;
	font-size: 16px;
	background: #fff;
	color: #2b2124;
}
.lu-input:focus { border-color: var(--lu-primary); outline: none; box-shadow: 0 0 0 3px rgba(217, 79, 112, 0.15); }
.lu-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.lu-consent { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.45; color: var(--lu-soft); cursor: pointer; }
.lu-consent input { margin-top: 2px; flex: 0 0 auto; accent-color: var(--lu-primary); }
.lu-btn {
	display: inline-block;
	padding: 13px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--lu-btn-bg, var(--lu-primary));
	color: var(--lu-btn-text, #fff);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.lu-btn:hover { transform: translateY(-1px); color: var(--lu-btn-text, #fff); }
.lu-btn[disabled] { opacity: 0.6; cursor: default; transform: none; }
.lu-btn.lu-loading { opacity: 0.7; }
.lu-btn-ghost { background: transparent; color: var(--lu-btn-bg, var(--lu-primary)); border: 2px solid var(--lu-btn-bg, var(--lu-primary)); margin-top: 6px; }
.lu-btn-ghost:hover { color: var(--lu-btn-bg, var(--lu-primary)); }
.lu-error { min-height: 1em; margin: 0; color: #b42318; font-size: 14px; }
.lu-hint { margin: 10px 0 0; font-weight: 600; color: var(--lu-primary); }
.lu-link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }

/* Result */
.lu-result { margin-top: 14px; }
.lu-win-title { margin: 0 0 4px; font-size: 24px; color: var(--lu-primary); }
.lu-win-text { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.lu-gift-text, .lu-small { margin: 6px 0; font-size: 14px; color: var(--lu-soft); }
.lu-code {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 12px;
	margin: 12px 0;
	padding: 14px;
	border: 2px dashed var(--lu-primary);
	border-radius: 12px;
}
.lu-code-label { width: 100%; font-size: 13px; color: var(--lu-soft); }
.lu-code-value { font-size: 24px; letter-spacing: 2px; }
.lu-copy { padding: 9px 16px; font-size: 14px; }
.lu-stage-done { display: none; }

/* Wheel */
.lu-wheel-wrap { position: relative; width: 100%; max-width: 320px; margin: 18px auto 0; }
.lu-wheel-wrap { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18)); }
.lu-wheel-rotor { position: relative; border-radius: 50%; overflow: hidden; line-height: 0; }
.lu-wheel { display: block; width: 100%; height: auto; transform-origin: 50% 50%; will-change: transform; }
.lu-wheel text { font-family: inherit; pointer-events: none; }
.lu-wheel-pin { position: absolute; top: -22px; left: 50%; z-index: 2; width: 40px; height: auto; margin-left: -20px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); }

/* Scratch card */
.lu-scratch { position: relative; width: 100%; max-width: 320px; height: 150px; margin: 0 auto; border-radius: 14px; overflow: hidden; }
.lu-scratch-under {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	background: var(--lu-scratch-bg, #fff8f3);
	border: 3px solid var(--lu-scratch-frame, var(--lu-primary));
	border-radius: 14px;
	font-size: 26px;
	font-weight: 800;
	color: var(--lu-scratch-text, var(--lu-primary));
}
.lu-scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: not-allowed; transition: opacity 0.5s ease; }
.lu-scratch-canvas.lu-active { cursor: grab; }
.lu-scratch-canvas.lu-gone { opacity: 0; pointer-events: none; }

/* Floating button */
.lu-floating {
	--lu-primary: #d94f70;
	position: fixed;
	bottom: 18px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px 10px 10px;
	border: 0;
	border-radius: 999px;
	background: var(--lu-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}
.lu-floating-left { left: 18px; }
.lu-floating-right { right: 18px; }
.lu-floating-icon { position: relative; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.lu-floating-icon::before { content: ''; position: absolute; left: 7px; right: 7px; top: 11px; bottom: 6px; background: #fff; border-radius: 2px; }
.lu-floating-icon::after { content: ''; position: absolute; left: 5px; right: 5px; top: 8px; height: 4px; background: #fff; border-radius: 2px; }
@media (max-width: 480px) {
	.lu-floating-text { display: none; }
	.lu-floating { padding: 10px; }
}

/* Right panel (desktop). On mobile it always opens in the center. */
@media (min-width: 768px) {
	.lu-overlay.lu-pos-right { justify-content: flex-end; align-items: stretch; padding: 0; }
	.lu-pos-right .lu-card {
		max-width: 460px;
		height: 100vh;
		max-height: 100vh;
		border-radius: var(--lu-radius) 0 0 var(--lu-radius);
		border-right: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		transform: translateX(100%);
		transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
	}
	.lu-pos-right.lu-show .lu-card { transform: none; }
	.lu-pos-right .lu-inner { padding: 40px 34px; }

	.lu-overlay.lu-pos-left { justify-content: flex-start; align-items: stretch; padding: 0; }
	.lu-pos-left .lu-card {
		max-width: 460px;
		height: 100vh;
		max-height: 100vh;
		border-radius: 0 var(--lu-radius) var(--lu-radius) 0;
		border-left: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		transform: translateX(-100%);
		transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
	}
	.lu-pos-left.lu-show .lu-card { transform: none; }
	.lu-pos-left .lu-inner { padding: 40px 34px; }
}

/* ---------- Flower shop theme ---------- */
.lu-theme-flowershop.lu-card {
	--lu-primary: #d94f70;
	--lu-accent: #8ba888;
	--lu-bg: #fff8f3;
	--lu-text: #3a2a2e;
	--lu-soft: #7a6267;
	--lu-radius: 26px;
	--lu-border: #f9dde2;
	--lu-box: #f2b5c0;
	--lu-ribbon: #8ba888;
	--lu-bow: #8ba888;
	--lu-reveal: #f2b5c0;
	--lu-reveal-ribbon: #8ba888;
}
.lu-theme-flowershop .lu-title { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; letter-spacing: 0.2px; }
.lu-theme-flowershop .lu-input { border-color: #f2c9d1; }
.lu-theme-flowershop .lu-code { border-color: #f2b5c0; }
.lu-floating.lu-theme-flowershop { background: #d94f70; }

.lu-deco { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.lu-flower { position: absolute; opacity: 0.9; }
.lu-f1 { top: -18px; left: -18px; }
.lu-f2 { top: 26px; right: 14px; opacity: 0.55; }
.lu-f3 { bottom: -16px; right: -14px; }
.lu-f4 { bottom: 70px; left: 10px; opacity: 0.5; }
.lu-petal {
	position: absolute;
	top: -20px;
	width: 10px;
	height: 14px;
	border-radius: 80% 0 80% 0;
	background: #f2b5c0;
	opacity: 0.7;
	animation-name: lu-fall;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}
.lu-petal:nth-child(3n) { background: #c9ddc4; }
@keyframes lu-fall {
	0% { transform: translate(0, 0) rotate(0); }
	100% { transform: translate(40px, 640px) rotate(320deg); }
}

/* Mobile */
@media (max-width: 767px) {
	.lu-overlay { padding: 10px; align-items: center; }
	.lu-card { max-width: 100%; max-height: calc(100vh - 20px); }
	.lu-inner { padding: 24px 16px 18px; }
	.lu-title { font-size: 22px; }
	.lu-sub { font-size: 14px; margin-bottom: 8px; }
	.lu-wheel-wrap { max-width: min(280px, 72vw); }
}
@media (max-width: 767px) and (max-height: 700px) {
	.lu-wheel-wrap { max-width: min(220px, 60vw); }
}

@media (prefers-reduced-motion: reduce) {
	.lu-overlay, .lu-card { transition: none !important; }
	.lu-petal { animation: none !important; }
}
