/* =========================================================================
   FIZZE — bandeau de consentement (ANALYTICS-001).

   Habille le bandeau natif de Complianz (mode « Accepter - Refuser -
   Personnaliser ») : carte blanche compacte fixee en bas a droite, qui
   grandit vers le haut quand le visiteur ouvre ses preferences. Aucun
   moteur parallele : seul l'aspect change. Le prefixe `body` fait gagner
   ces regles sur la feuille generee par Complianz, quel que soit l'ordre
   de chargement.
   ========================================================================= */

body .cmplz-cookiebanner {
	--fz-cb-ink: var(--wp--preset--color--ink, #111827);
	--fz-cb-muted: #4B5563;
	--fz-cb-line: #E5E7EB;
	--fz-cb-blue: var(--wp--preset--color--blue, #2563EB);
	--fz-cb-blue-hover: #1D4ED8;

	box-sizing: border-box;
	position: fixed;
	top: auto;
	left: auto;
	right: 1.25rem;
	bottom: 1.25rem;
	transform: none;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	width: min(26rem, calc(100vw - 2.5rem));
	min-width: 0;
	max-width: calc(100vw - 2.5rem);
	max-height: calc(100dvh - 2.5rem);
	padding: 1.25rem;
	overflow: hidden;
	border: 1px solid var(--fz-cb-line);
	border-radius: 1rem;
	background: #FFFFFF;
	color: var(--fz-cb-ink);
	box-shadow: 0 16px 44px -14px rgba(17, 24, 39, 0.28), 0 2px 6px rgba(17, 24, 39, 0.06);
	font-family: var(--wp--preset--font-family--body, "DM Sans", sans-serif);
}

body .cmplz-cookiebanner *,
body .cmplz-cookiebanner *::before,
body .cmplz-cookiebanner *::after {
	box-sizing: border-box;
	font-family: inherit;
}

/* En-tete : pictogramme cookie + titre sur une ligne. Pas de croix : le choix passe par les boutons. */
body .cmplz-cookiebanner .cmplz-header {
	display: flex;
	flex: none;
	align-items: center;
	margin: 0;
	padding: 0;
}

body .cmplz-cookiebanner .cmplz-logo,
body .cmplz-cookiebanner .cmplz-divider,
body .cmplz-cookiebanner .cmplz-close {
	display: none;
}

body .cmplz-cookiebanner .cmplz-header .cmplz-title {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--fz-cb-ink);
}

body .cmplz-cookiebanner .cmplz-header .cmplz-title::before {
	content: "";
	flex: none;
	width: 1.375rem;
	height: 1.375rem;
	background-color: currentColor;
	-webkit-mask: var(--fz-cookie-icon) center / contain no-repeat;
	mask: var(--fz-cookie-icon) center / contain no-repeat;
	--fz-cookie-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5'/%3E%3Cpath d='M8.5 8.5v.01M16 15.5v.01M12 12v.01M11 17v.01M7 14v.01'/%3E%3C/svg%3E");
}

/* Corps : texte, puis categories (seulement apres « Personnaliser »). Il defile si la hauteur manque. */
body .cmplz-cookiebanner .cmplz-body {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	overflow-y: auto;
}

body .cmplz-cookiebanner .cmplz-message,
body .cmplz-cookiebanner .cmplz-categories {
	width: auto;
}

body .cmplz-cookiebanner .cmplz-message {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--fz-cb-muted);
	text-align: left;
}

body .cmplz-cookiebanner .cmplz-message a {
	color: var(--fz-cb-ink);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	white-space: nowrap;
}

body .cmplz-cookiebanner .cmplz-message a:hover {
	color: var(--fz-cb-blue-hover);
}

/* Categories : visibles seulement quand Complianz ajoute .cmplz-fade-in. */
body .cmplz-cookiebanner .cmplz-categories {
	margin-top: 0.875rem;
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category {
	border: 1px solid var(--fz-cb-line);
	border-radius: 0.75rem;
	background: #FFFFFF;
	overflow: hidden;
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category:not(:last-child) {
	margin-bottom: 0.5rem;
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header {
	grid-template-columns: 1fr auto 2rem;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-title {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--fz-cb-ink);
}

/* « Toujours actifs » : pastille bleue discrete. */
body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-always-active {
	padding: 0.1875rem 0.5rem;
	border-radius: 999px;
	background: rgba(37, 99, 235, 0.1);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--fz-cb-blue-hover);
	white-space: nowrap;
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-toggle {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	color: var(--fz-cb-ink);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-toggle:hover {
	background: rgba(17, 24, 39, 0.06);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-description {
	padding: 0 0.75rem 0.75rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--fz-cb-muted);
}

/* Liens secondaires et pages de politique : le lien legal est dans le texte. */
body .cmplz-cookiebanner .cmplz-links {
	display: none;
}

/* Boutons : Accepter et Refuser identiques a gauche, l'action de preferences a droite. */
body .cmplz-cookiebanner .cmplz-buttons {
	display: flex;
	flex: none;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	min-height: 2.5rem;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept,
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny {
	border: 1px solid var(--fz-cb-blue);
	background: var(--fz-cb-blue);
	color: #FFFFFF;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:hover,
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny:hover {
	border-color: var(--fz-cb-blue-hover);
	background: var(--fz-cb-blue-hover);
}

/* Personnaliser : lien-bouton discret a droite. Enregistrer : contour, meme place. */
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences,
body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences {
	margin-left: auto;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences {
	border: 1px solid transparent;
	background: transparent;
	color: var(--fz-cb-ink);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences:hover {
	background: rgba(17, 24, 39, 0.06);
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences {
	border: 1px solid var(--fz-cb-ink);
	background: transparent;
	color: var(--fz-cb-ink);
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences:hover {
	background: var(--fz-cb-ink);
	color: #FFFFFF;
}

/* Clavier : anneau net sur chaque controle. */
body .cmplz-cookiebanner .cmplz-category-toggle:focus-visible,
body .cmplz-cookiebanner .cmplz-btn:focus-visible,
body .cmplz-cookiebanner .cmplz-message a:focus-visible,
body .cmplz-cookiebanner .cmplz-consent-checkbox:focus-visible + .cmplz-label {
	outline: 3px solid var(--fz-cb-ink);
	outline-offset: 2px;
}

/* Telephone : marges laterales gardees, Accepter / Refuser cote a cote, preferences dessous, cibles de 2,75 rem. */
@media (max-width: 30rem) {
	body .cmplz-cookiebanner {
		right: 0.75rem;
		bottom: 0.75rem;
		left: 0.75rem;
		width: auto;
		max-width: none;
		max-height: calc(100dvh - 1.5rem);
		padding: 1rem;
	}

	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
		min-height: 2.75rem;
	}

	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept,
	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny {
		flex: 1 1 calc(50% - 0.25rem);
	}

	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-view-preferences,
	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-save-preferences {
		flex: 1 1 100%;
		margin-left: 0;
	}
}

/*
 * Ecran bas (telephone en paysage) : Complianz applique sous 400 px de haut un
 * zoom de 0,6 et des boutons de 15 vh. On annule ces regles : boutons lisibles,
 * cibles d'au moins 2,5 rem, corps defilant.
 */
@media (max-height: 400px) {
	body .cmplz-cookiebanner {
		zoom: 1 !important;
		height: auto !important;
		gap: 0.5rem !important;
		padding: 0.75rem 1rem !important;
		max-height: calc(100dvh - 1rem);
		bottom: 0.5rem;
	}

	body .cmplz-cookiebanner .cmplz-header {
		max-height: none !important;
		margin: 0 !important;
	}

	body .cmplz-cookiebanner .cmplz-body {
		margin-top: 0 !important;
	}

	body .cmplz-cookiebanner .cmplz-buttons {
		gap: 0.5rem !important;
	}

	body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
		zoom: 1 !important;
		height: auto !important;
		min-height: 2.5rem !important;
		padding: 0.5rem 0.875rem !important;
		font-size: 0.875rem !important;
		line-height: 1.2 !important;
	}
}

/*
 * Lien « Gestion des cookies » du pied de page : bouton presente comme les
 * autres liens de la colonne « Infos legales » (meme graisse, meme trait qui
 * se trace au survol et au focus).
 */
.fizze-cookie-settings {
	align-self: flex-start;
	padding: 0;
	border: 0;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	color: var(--fz-on-anth, currentColor);
	font: inherit;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-size 0.5s var(--fz-out, ease), color 0.25s var(--fz-ease, ease);
}

.fizze-cookie-settings:hover,
.fizze-cookie-settings:focus-visible {
	background-size: 100% 1px;
}

.fizze-cookie-settings:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

/* L'onglet flottant de Complianz reste masque : la reouverture passe par le pied de page. */
body #cmplz-manage-consent .cmplz-manage-consent {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	body .cmplz-cookiebanner,
	body .cmplz-cookiebanner * {
		animation: none !important;
		transition: none !important;
	}
}
