/**
 * NIYAPRESS: Cookies Bar Fix
 * Corrige le z-index et le positionnement de la barre de cookies
 * La barre doit être AU-DESSUS de tout sauf l'admin bar
 * Version: 1.0.0
 */

/* ═══════════════════════════════════════════════════════════
   COOKIES BAR - Z-INDEX CORRECT
   ═══════════════════════════════════════════════════════════ */

.cookie-consent {
	position: fixed !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 99998 !important; /* Juste sous admin bar (99999) */
	background: rgba(26, 26, 26, 0.98) !important;
	backdrop-filter: blur(10px) !important;
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15) !important;
}

.cookie-consent.is-visible {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	transform: translateY(0) !important;
}

/* Bouton réglages cookies */
.cookie-consent-settings {
	z-index: 99997 !important; /* Juste sous la barre */
	position: fixed !important;
	bottom: 16px !important;
	left: 16px !important;
}

.cookie-consent-settings.is-visible {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   COOKIES BAR - DESIGN CLEAN
   ═══════════════════════════════════════════════════════════ */

.cookie-consent__inner {
	max-width: 1280px !important;
	margin: 0 auto !important;
	padding: 16px 20px !important;
}

.cookie-consent__title {
	color: #fff !important;
	font-weight: 700 !important;
	margin-bottom: 8px !important;
}

.cookie-consent__text {
	color: rgba(255, 255, 255, 0.9) !important;
	line-height: 1.5 !important;
}

.cookie-consent__link {
	color: #FAA31B !important;
	text-decoration: underline !important;
}

.cookie-consent__link:hover {
	color: #fff !important;
}

/* Boutons */
.cookie-consent__btn--accept {
	background: #FAA31B !important;
	color: #001D83 !important;
	font-weight: 700 !important;
	border: none !important;
}

.cookie-consent__btn--accept:hover {
	background: #E60000 !important;
	color: #fff !important;
}

.cookie-consent__btn--reject {
	background: transparent !important;
	color: #fff !important;
	border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.cookie-consent__btn--reject:hover {
	border-color: rgba(255, 255, 255, 0.6) !important;
	background: rgba(255, 255, 255, 0.1) !important;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE - RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {
	.cookie-consent {
		z-index: 99998 !important; /* Toujours au-dessus */
	}
	
	.cookie-consent__inner {
		padding: 16px !important;
		flex-direction: column !important;
	}
	
	.cookie-consent__actions {
		flex-direction: column !important;
		gap: 10px !important;
		width: 100% !important;
	}
	
	.cookie-consent__btn {
		width: 100% !important;
		justify-content: center !important;
		min-height: 44px !important;
	}
	
	.cookie-consent-settings {
		bottom: 12px !important;
		left: 12px !important;
		z-index: 99997 !important;
	}
}

/* Admin bar offset */
body.admin-bar .cookie-consent-settings {
	bottom: calc(16px + 32px) !important;
}

@media screen and (max-width: 782px) {
	body.admin-bar .cookie-consent-settings {
		bottom: calc(12px + 46px) !important;
	}
}

/* ═══════════════════════════════════════════════════════════
   QUAND LA BARRE EST OUVERTE
   ═══════════════════════════════════════════════════════════ */

body.has-cookie-consent-open {
	/* Le body garde son comportement normal */
}

body.has-cookie-consent-open .cookie-consent {
	display: block !important;
}

body.has-cookie-consent-open .cookie-consent-settings {
	display: none !important; /* Cacher le bouton quand la barre est ouverte */
}
