/* xCookieBar — barre de consentement, flat design */

.xcoo-bar {
	--xcb-accent: #4f6df5;
	--xcb-accent-hover: #3f5ae0;
	--xcb-radius: 10px;

	position: fixed;
	left: 0;
	right: 0;
	z-index: 2147483000;
	box-sizing: border-box;
	padding: 14px 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;

	/* État de départ : masqué, prêt pour l'animation d'entrée. */
	opacity: 0;
	pointer-events: none; /* ne bloque pas les clics tant que la barre est masquée */
	transition: opacity .35s ease, transform .35s ease;
	will-change: transform, opacity;
}

.xcoo-bar *,
.xcoo-bar *::before,
.xcoo-bar *::after {
	box-sizing: border-box;
}

/* Positions */
.xcoo-bar--bottom {
	bottom: 0;
	transform: translateY(16px);
}
.xcoo-bar--top {
	top: 0;
	transform: translateY(-16px);
}

/* État visible (classe ajoutée par le JS après le chargement). */
.xcoo-bar.xcoo-is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* Conteneur interne centré */
.xcoo-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	max-width: 1140px;
	margin: 0 auto;
}

.xcoo-text {
	margin: 0;
	flex: 1 1 auto;
}
.xcoo-text p {
	margin: 0;
}

.xcoo-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
	font-weight: 600;
}
.xcoo-link:hover {
	text-decoration: none;
}

.xcoo-actions {
	flex: 0 0 auto;
}

/* Bouton flat, sans dégradé ni ombre marquée */
.xcoo-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	display: inline-block;
	padding: 11px 22px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	background: var(--xcb-accent);
	border-radius: var(--xcb-radius);
	transition: background-color .15s ease, transform .05s ease;
	white-space: nowrap;
}
.xcoo-btn:hover {
	background: var(--xcb-accent-hover);
}
.xcoo-btn:active {
	transform: translateY(1px);
}
.xcoo-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Thème sombre */
.xcoo-bar--dark {
	background: #17181c;
	color: #e9eaee;
}
.xcoo-bar--dark.xcoo-bar--bottom {
	box-shadow: 0 -6px 24px rgba(0, 0, 0, .28);
}
.xcoo-bar--dark.xcoo-bar--top {
	box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
}

/* Thème clair */
.xcoo-bar--light {
	background: #ffffff;
	color: #1d1f24;
}
.xcoo-bar--light.xcoo-bar--bottom {
	border-top: 1px solid #e6e8ec;
	box-shadow: 0 -6px 24px rgba(20, 23, 33, .08);
}
.xcoo-bar--light.xcoo-bar--top {
	border-bottom: 1px solid #e6e8ec;
	box-shadow: 0 6px 24px rgba(20, 23, 33, .08);
}

/* Responsive : passage en colonne sur mobile */
@media (max-width: 640px) {
	.xcoo-bar {
		padding: 16px;
	}
	.xcoo-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}
	.xcoo-actions {
		display: flex;
	}
	.xcoo-btn {
		width: 100%;
		text-align: center;
	}
}

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
	.xcoo-bar {
		transition: opacity .2s ease;
		transform: none !important;
	}
}

/* ============================================================
   Contrôle de réouverture (revenir sur son choix) — discret
   ============================================================ */

.xcoo-reopen {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 2147482000; /* sous la barre principale */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	border: 0;
	cursor: pointer;
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #fff;
	background: #17181c;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .22);

	/* Caché tant que le consentement n'a pas été donné. */
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity .3s ease, transform .3s ease, background-color .15s ease;
}
.xcoo-reopen .xcoo-ico { display: block; }
.xcoo-reopen:focus-visible { outline: 2px solid #4f6df5; outline-offset: 2px; }

/* Visible après consentement (classe ajoutée par le JS). */
.xcoo-reopen--show {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* ---- Mode 1 : icône flottante ronde, discrète (bas gauche) ---- */
.xcoo-reopen--icon {
	width: 46px;
	height: 46px;
	padding: 0;
	border-radius: 50%;
	justify-content: center;
}
/* Libellé masqué visuellement (conservé pour les lecteurs d'écran). */
.xcoo-reopen--icon .xcoo-reopen__label {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
/* Discret au repos, plein au survol / focus. */
.xcoo-reopen--icon.xcoo-reopen--show { opacity: .5; }
.xcoo-reopen--icon.xcoo-reopen--show:hover,
.xcoo-reopen--icon.xcoo-reopen--show:focus-visible {
	opacity: 1;
	transform: translateY(-2px);
}

/* ---- Mode 2 : onglet presque masqué qui se relève au survol ---- */
.xcoo-reopen--tab {
	left: 18px;
	bottom: 0;
	padding: 10px 16px;
	border-radius: 10px 10px 0 0;
}
/* Au repos : seul un fin liseré dépasse du bas de l'écran. */
.xcoo-reopen--tab.xcoo-reopen--show {
	opacity: 1;
	transform: translateY(calc(100% - 7px));
}
/* Au survol / focus : l'onglet se relève entièrement. */
.xcoo-reopen--tab.xcoo-reopen--show:hover,
.xcoo-reopen--tab.xcoo-reopen--show:focus-visible {
	transform: translateY(0);
}

@media (max-width: 640px) {
	.xcoo-reopen { left: 12px; }
	.xcoo-reopen--tab { left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	.xcoo-reopen { transition: opacity .2s ease; }
	.xcoo-reopen--tab.xcoo-reopen--show { transform: translateY(0); }
}
