/**
 * Styles frontend de la roue de cadeaux
 *
 * @package Webnation_Gift_Wheel
 */

/* ============================================
   Isolation minimaliste du plugin
   ============================================ */
#wgw-wheel-root,
#wgw-wheel-root *,
#wgw-wheel-root *::before,
#wgw-wheel-root *::after,
#wgw-page-overlay,
#wgw-wheel-container,
#wgw-wheel-container *,
#wgw-wheel-container *::before,
#wgw-wheel-container *::after {
	box-sizing: border-box !important;
}


/* ============================================
   Overlay de fond (arrière-plan blanc semi-transparent)
   ============================================ */
#wgw-page-overlay,
#wgw-wheel-container ~ #wgw-page-overlay {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background: rgba(255, 255, 255, 0.85) !important;
	z-index: 99998 !important;
	opacity: 0 !important;
	visibility: hidden !important;
	transition: opacity 0.4s ease, visibility 0.4s ease !important;
	pointer-events: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	box-sizing: border-box !important;
}

#wgw-page-overlay.wgw-active,
#wgw-wheel-container ~ #wgw-page-overlay.wgw-active {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

/* ============================================
   Container principal
   ============================================ */
#wgw-wheel-container {
	position: fixed !important;
	left: 20px !important;
	bottom: 20px !important;
	z-index: 99999 !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

/* ============================================
   Bouton toggle (ouvrir/fermer)
   ============================================ */
#wgw-wheel-container #wgw-toggle-btn {
	position: relative !important;
	width: 70px !important;
	height: 70px !important;
	min-width: 70px !important;
	min-height: 70px !important;
	max-width: 70px !important;
	max-height: 70px !important;
	border-radius: 50% !important;
	border: 2px dashed #e83b3b !important;
	background: #FFFFFF !important;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
	cursor: pointer !important;
	transition: all 0.3s ease !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	opacity: 1 !important;
	visibility: visible !important;
	box-sizing: border-box !important;
	text-decoration: none !important;
	line-height: 1 !important;
	font-family: inherit !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-toggle-btn.wgw-hidden {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

#wgw-wheel-container #wgw-toggle-btn:hover {
	transform: scale(1.1) !important;
	box-shadow: 0 6px 20px rgba(220, 62, 56, 0.6) !important;
    border-color: #FFFFFF !important;
	background: #DC3E38 !important;
	text-decoration: none !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-toggle-btn:active {
	transform: scale(0.95) !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-toggle-btn:focus {
	outline: none !important;
}

#wgw-wheel-container #wgw-toggle-btn svg {
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
	display: block !important;
	width: 50px !important;
	height: 50px !important;
}


/* ============================================
   Widget de la roue
   ============================================ */
#wgw-wheel-container #wgw-wheel-widget {
	position: fixed !important;
	left: 0 !important;
	top: 50% !important;
	transform: translateY(-50%) translateX(-100%) !important;
	width: 280px !important;
	height: 500px !important;
	overflow: visible !important;
	opacity: 0 !important;
	visibility: hidden !important;
	transition: all 0.4s ease !important;
	z-index: 99998 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	background: transparent !important;
}

#wgw-wheel-container #wgw-wheel-widget.wgw-active {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(-50%) translateX(0) !important;
}

#wgw-wheel-container #wgw-close-btn {
	position: absolute !important;
	top: 15px !important;
	right: 15px !important;
	background: rgba(255, 255, 255, 0.9) !important;
	border: none !important;
	cursor: pointer !important;
	padding: 8px !important;
	color: #DC3E38 !important;
	transition: all 0.2s !important;
	z-index: 30 !important;
	border-radius: 50% !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 36px !important;
	min-height: 36px !important;
	max-width: 36px !important;
	max-height: 36px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	line-height: 1 !important;
	text-decoration: none !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-close-btn:hover {
	background: #fff !important;
	transform: rotate(90deg) !important;
	color: #DC3E38 !important;
	text-decoration: none !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-close-btn:focus {
	outline: none !important;
}

#wgw-wheel-container #wgw-close-btn svg {
	display: block !important;
	width: 20px !important;
	height: 20px !important;
}

#wgw-wheel-container .wgw-wheel-wrapper {
	position: relative !important;
	text-align: center !important;
	margin: 0 !important;
	padding: 0 !important;
}

#wgw-wheel-container .wgw-wheel-title {
	display: none !important;
}

/* ============================================
   Canvas de la roue
   ============================================ */
#wgw-wheel-container .wgw-wheel-canvas-wrapper {
	position: relative !important;
	width: 500px !important;
	height: 500px !important;
	margin: 0 !important;
	margin-left: -250px !important;
	overflow: hidden !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

#wgw-wheel-container #wgw-wheel-canvas {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Indicateur/flèche - positionné à droite au milieu de la roue visible */
#wgw-wheel-container .wgw-wheel-pointer {
	position: absolute !important;
	top: 50% !important;
	right: -3px !important;
	transform: translateY(-50%) !important;
	z-index: 15 !important;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
	pointer-events: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

#wgw-wheel-container .wgw-wheel-pointer svg {
	display: block !important;
	width: 40px !important;
	height: 50px !important;
}

/* ============================================
   Bouton de lancement
   ============================================ */
#wgw-wheel-container #wgw-spin-btn {
	position: absolute !important;
	top: 50% !important;
	right: -140px !important;
	transform: translateY(-50%) !important;
	background: linear-gradient(135deg, #DC3E38 0%, #a02d26 100%) !important;
	color: #fff !important;
	border: 4px solid #fff !important;
	border-radius: 50% !important;
	width: 120px !important;
	height: 120px !important;
	min-width: 120px !important;
	min-height: 120px !important;
	max-width: 120px !important;
	max-height: 120px !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	cursor: pointer !important;
	transition: all 0.3s ease !important;
	text-transform: uppercase !important;
	letter-spacing: 2px !important;
	z-index: 20 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	line-height: 1 !important;
	text-decoration: none !important;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-spin-btn:hover:not(:disabled) {
	transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
	background: linear-gradient(135deg, #DC3E38 0%, #a02d26 100%) !important;
	color: #fff !important;
	text-decoration: none !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-spin-btn:active:not(:disabled) {
	transform: translateY(-50%) scale(0.95) !important;
	outline: none !important;
}

#wgw-wheel-container #wgw-spin-btn:focus {
	outline: none !important;
}

#wgw-wheel-container #wgw-spin-btn:disabled {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
}

/* ============================================
   Résultat et messages
   ============================================ */
#wgw-wheel-container #wgw-result {
	position: fixed !important;
	top: 50% !important;
	right: 20px !important;
	transform: translateY(80px) !important;
	width: auto !important;
	min-width: 200px !important;
	max-width: 300px !important;
	margin: 0 !important;
	padding: 12px 18px !important;
	border-radius: 8px !important;
	background: #fff !important;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
	z-index: 25 !important;
	box-sizing: border-box !important;
	text-align: center !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	border: 2px solid #dc3232 !important;
}

#wgw-wheel-container .wgw-error {
	color: #dc3232 !important;
	margin: 0 !important;
	padding: 0 !important;
	font-weight: 600 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	display: block !important;
	word-wrap: break-word !important;
	overflow-wrap: break-word !important;
	white-space: normal !important;
}

/* ============================================
   Modal de résultat
   ============================================ */
#wgw-wheel-container .wgw-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

#wgw-wheel-container .wgw-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
}

#wgw-wheel-container .wgw-modal-content {
	position: relative;
	background: #fff;
	border-radius: 20px;
	max-width: 500px;
	max-height: calc(100vh - 40px);
	margin: 0;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: wgw-modal-appear 0.3s ease;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	width: 100%;
}

@keyframes wgw-modal-appear {
	from {
		opacity: 0;
		transform: translateY(-50px) scale(0.9);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

#wgw-wheel-container .wgw-modal-header {
	padding: 20px 20px 15px;
	border-bottom: 1px solid #eee;
	position: relative;
	flex-shrink: 0;
}

#wgw-wheel-container .wgw-modal-header h3 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #333;
	text-align: center;
}

#wgw-wheel-container .wgw-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	transition: color 0.2s;
	padding: 0;
	width: 28px;
	height: 28px;
}

#wgw-wheel-container .wgw-modal-close:hover {
	color: #333;
}

#wgw-wheel-container .wgw-modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

/* ============================================
   Contenu du résultat
   ============================================ */
#wgw-wheel-container .wgw-result-content {
	text-align: center;
}

#wgw-wheel-container .wgw-result-icon {
	font-size: 60px;
	margin-bottom: 15px;
	animation: wgw-bounce 0.6s ease;
}

@keyframes wgw-bounce {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.2); }
}

#wgw-wheel-container .wgw-result-content h4 {
	font-size: 18px;
	color: #666;
	margin: 0 0 8px 0;
	font-weight: 400;
}

#wgw-wheel-container .wgw-result-label {
	font-size: 22px;
	font-weight: 700;
	color: #333;
	margin: 0 0 20px 0;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* ============================================
   Box coupon
   ============================================ */
#wgw-wheel-container .wgw-coupon-box {
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	border-radius: 15px;
	padding: 20px;
	margin: 15px 0;
}

#wgw-wheel-container .wgw-coupon-box p {
	margin: 0 0 12px 0;
	color: #666;
	font-size: 13px;
}

#wgw-wheel-container .wgw-coupon-code {
	background: #fff;
	border: 2px dashed #667eea;
	border-radius: 10px;
	padding: 12px 15px;
	font-size: 20px;
	font-weight: 700;
	color: #667eea;
	letter-spacing: 2px;
	margin-bottom: 15px;
	font-family: 'Courier New', monospace;
}

#wgw-wheel-container .wgw-copy-coupon {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 50px !important;
	padding: 10px 25px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	cursor: pointer;
	transition: all 0.3s ease !important;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

#wgw-wheel-container .wgw-copy-coupon:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6) !important;
}

/* ============================================
   Box produit gratuit
   ============================================ */
#wgw-wheel-container .wgw-product-box {
	background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
	border-radius: 15px;
	padding: 20px;
	margin: 15px 0;
	text-align: center;
}

/* ============================================
   Badge et styles panier
   ============================================ */
.wgw-free-badge {
	display: inline-block;
	background: #4CAF50 !important;
	color: white !important;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: bold;
	margin-left: 10px;
}

.wgw-no-remove {
	color: #999;
	font-size: 18px;
	cursor: not-allowed;
}

/* Forcer l'affichage en texte simple pour la quantité des produits gratuits */
.woocommerce-cart-form__cart-item .quantity.wgw-free-quantity {
	pointer-events: none;
}

.woocommerce-cart-form__cart-item .quantity.wgw-free-quantity input {
	display: none !important;
}

.woocommerce-cart-form__cart-item .quantity.wgw-free-quantity .qty {
	display: none !important;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
	#wgw-wheel-container #wgw-wheel-widget {
		width: 350px !important;
		height: 450px !important;
	}

	#wgw-wheel-container #wgw-wheel-widget.wgw-active {
		transform: translateY(-50%) translateX(0) !important;
	}

	#wgw-wheel-container .wgw-wheel-canvas-wrapper {
		width: 350px !important;
		height: 450px !important;
		margin-left: -175px !important;
		overflow: visible !important;
	}

	#wgw-wheel-container #wgw-wheel-canvas {
		width: 350px !important;
		height: 350px !important;
	}

	#wgw-wheel-container .wgw-modal {
		padding: 10px !important;
	}

	#wgw-wheel-container .wgw-modal-content {
		max-width: 100% !important;
		max-height: calc(100vh - 20px) !important;
	}

	#wgw-wheel-container .wgw-modal-header {
		padding: 15px !important;
	}

	#wgw-wheel-container .wgw-modal-header h3 {
		font-size: 20px !important;
	}

	#wgw-wheel-container .wgw-modal-body {
		padding: 15px !important;
	}

	#wgw-wheel-container .wgw-result-label {
		font-size: 20px !important;
	}

	#wgw-wheel-container .wgw-coupon-code {
		font-size: 18px !important;
		padding: 10px !important;
	}

	#wgw-wheel-container .wgw-result-icon {
		font-size: 50px !important;
		margin-bottom: 10px !important;
	}

	#wgw-wheel-container #wgw-spin-btn {
		width: 90px !important;
		height: 90px !important;
		min-width: 90px !important;
		min-height: 90px !important;
		max-width: 90px !important;
		max-height: 90px !important;
		font-size: 14px !important;
		letter-spacing: 1px !important;
		right: -110px !important;
		left: auto !important;
		transform: translateY(-50%) !important;
	}

	#wgw-wheel-container #wgw-spin-btn:hover:not(:disabled) {
		transform: translateY(-50%) scale(1.1) !important;
	}

	#wgw-wheel-container #wgw-spin-btn:active:not(:disabled) {
		transform: translateY(-50%) scale(0.95) !important;
	}

	#wgw-wheel-container #wgw-result {
		right: 10px !important;
		left: auto !important;
		transform: translateY(60px) !important;
		max-width: 250px !important;
		font-size: 12px !important;
	}

	#wgw-wheel-container #wgw-toggle-btn {
		width: 60px !important;
		height: 60px !important;
		min-width: 60px !important;
		min-height: 60px !important;
		max-width: 60px !important;
		max-height: 60px !important;
	}

	#wgw-wheel-container .wgw-wheel-pointer {
		right: 0 !important;
	}
}

@media (max-width: 480px) {
	#wgw-wheel-container #wgw-wheel-widget {
		width: 400px !important;  /* Augmenté de 280px à 400px */
		height: 500px !important;  /* Ajusté en proportion */
	}

	#wgw-wheel-container #wgw-wheel-widget.wgw-active {
		transform: translateY(-50%) translateX(0) !important;
	}

	#wgw-wheel-container .wgw-wheel-canvas-wrapper {
		width: 400px !important;  /* = diamètre de la roue */
		height: 400px !important;
		margin-left: -200px !important;  /* = -rayon (cache moitié gauche) */
		overflow: hidden !important;
	}

	#wgw-wheel-container #wgw-wheel-canvas {
		width: 400px !important;
		height: 400px !important;
	}

	/* Bouton LANCER - Positionné en bas au centre de la page */
	#wgw-wheel-container #wgw-spin-btn {
		width: 90px !important;
		height: 90px !important;
		min-width: 90px !important;
		min-height: 90px !important;
		max-width: 90px !important;
		max-height: 90px !important;
		font-size: 14px !important;
		letter-spacing: 1px !important;
		/* Positionnement fixe en bas au centre */
		position: fixed !important;
		bottom: 20px !important;
		left: 50% !important;
		right: auto !important;
		top: auto !important;
		transform: translateX(-50%) !important;  /* Centre horizontalement */
	}

	#wgw-wheel-container #wgw-spin-btn:hover:not(:disabled) {
		transform: translateX(-50%) scale(1.1) !important;
	}

	#wgw-wheel-container #wgw-spin-btn:active:not(:disabled) {
		transform: translateX(-50%) scale(0.95) !important;
	}

	/* Bouton FERMER - Positionné en haut à droite de la page */
	#wgw-wheel-container #wgw-close-btn {
		position: fixed !important;
		top: 20px !important;
		right: 40px !important;
		left: auto !important;
		width: 44px !important;  /* Plus grand pour faciliter le clic */
		height: 44px !important;
		min-width: 44px !important;
		min-height: 44px !important;
		max-width: 44px !important;
		max-height: 44px !important;
		z-index: 100000 !important;  /* Au-dessus de tout */
	}

	#wgw-wheel-container #wgw-result {
		right: 5px !important;
		left: auto !important;
		transform: translateY(50px) !important;
		max-width: 250px !important;  /* Augmenté pour plus d'espace */
		font-size: 12px !important;
		padding: 12px 16px !important;
	}

	#wgw-wheel-container #wgw-toggle-btn {
		width: 60px !important;
		height: 60px !important;
		min-width: 60px !important;
		min-height: 60px !important;
		max-width: 60px !important;
		max-height: 60px !important;
	}

	#wgw-wheel-container {
		bottom: 15px !important;
		left: 15px !important;
	}
}

