/* ==========================================================================
   Bandeau de consentement aux cookies (inc/consent.php)
   Chargé uniquement si un identifiant Google Analytics est configuré.
   « Tout accepter » est le bouton principal (jaune) ; « Tout refuser » est juste à côté,
   même taille, même police, bien visible (CNIL : refuser doit être aussi simple qu'accepter).
   ========================================================================== */

.bm-consent {
	position: fixed;
	inset: 0;
	z-index: 100; /* Au-dessus de l'en-tête fixe et de la barre d'action flottante. */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: var(--wp--preset--color--bleu-nuit, #161C33);
	font-family: var(--wp--preset--font-family--body);
}

/* Fond assombri : un clic dessus ne vaut ni accord ni refus. */
.bm-consent__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(22, 28, 51, .45);
}

/* Page figée tant que le choix n'est pas fait. */
html.bm-consent-visible {
	overflow: hidden;
}

.bm-consent[hidden] {
	display: none;
}

.bm-consent__box {
	position: relative;
	width: min(520px, 100%);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: 32px 32px 28px;
	border-radius: 24px;
	background: var(--wp--preset--color--blanc-casse, #FFFDF9);
	box-shadow: 0 18px 48px rgba(22, 28, 51, .22);
	text-align: center;
	outline: none;
}

.bm-consent__details {
	text-align: left;
}

.bm-consent__title {
	margin: 0 0 10px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--wp--preset--color--bleu-bandol, #1E2B5E);
}

.bm-consent__text {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--wp--preset--color--encre-2, #3A3F55);
}

.bm-consent__text a {
	color: var(--wp--preset--color--bleu-bandol, #1E2B5E);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Détail par finalité */
.bm-consent__details {
	margin-top: 18px;
	border-top: 1px solid var(--wp--custom--color--trait, #E7E0D3);
}

.bm-consent__details[hidden] {
	display: none;
}

.bm-consent__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--wp--custom--color--trait, #E7E0D3);
}

.bm-consent__label {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--wp--preset--color--bleu-bandol, #1E2B5E);
}

.bm-consent__desc {
	margin: 4px 0 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--encre-2, #3A3F55);
}

.bm-consent__always {
	flex: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--encre-2, #3A3F55);
}

/* Interrupteur */
.bm-switch {
	position: relative;
	flex: none;
	display: inline-block;
	width: 48px;
	height: 28px;
	cursor: pointer;
}

.bm-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.bm-switch__track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #B9BED0;
	transition: background .2s ease;
}

.bm-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .2s ease;
}

.bm-switch input:checked + .bm-switch__track {
	background: var(--wp--preset--color--bleu-bandol, #1E2B5E);
}

.bm-switch input:checked + .bm-switch__track::after {
	transform: translateX(20px);
}

.bm-switch input:focus-visible + .bm-switch__track {
	outline: 2px solid var(--wp--preset--color--bleu-bandol, #1E2B5E);
	outline-offset: 3px;
}

/* Boutons */
.bm-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 12px;
	margin-top: 24px;
}

.bm-consent__btn {
	flex: 1 1 0;
	min-width: 160px;
	min-height: 50px;
	padding: 12px 22px;
	border: 1.5px solid var(--wp--preset--color--bleu-bandol, #1E2B5E);
	border-radius: 999px;
	background: transparent;
	color: var(--wp--preset--color--bleu-bandol, #1E2B5E);
	font: 600 16px/1.2 var(--wp--preset--font-family--body);
	cursor: pointer;
	transition: background .2s ease, color .2s ease, filter .2s ease;
}

.bm-consent__btn:hover {
	background: var(--wp--preset--color--bleu-bandol, #1E2B5E);
	color: var(--wp--preset--color--blanc-casse, #FFFDF9);
}

/* Bouton principal du design system : Jaune soleil, texte Bleu nuit. */
.bm-consent__btn--accept,
.bm-consent__btn--save {
	border-color: var(--wp--preset--color--jaune-soleil, #F2C230);
	background: var(--wp--preset--color--jaune-soleil, #F2C230);
	color: var(--wp--preset--color--bleu-nuit, #161C33);
	box-shadow: 0 6px 16px rgba(242, 194, 48, .35);
}

.bm-consent__btn--accept:hover,
.bm-consent__btn--save:hover {
	border-color: var(--wp--preset--color--jaune-soleil, #F2C230);
	background: var(--wp--preset--color--jaune-soleil, #F2C230);
	color: var(--wp--preset--color--bleu-nuit, #161C33);
	filter: brightness(.94);
}

.bm-consent__btn:focus-visible,
.bm-consent__link:focus-visible,
.bm-consent-open:focus-visible {
	outline: 2px solid var(--wp--preset--color--bleu-bandol, #1E2B5E);
	outline-offset: 3px;
}

.bm-consent__btn--save {
	flex-basis: 100%;
}

.bm-consent__btn[hidden],
.bm-consent__link[hidden] {
	display: none;
}

.bm-consent__link {
	flex-basis: 100%;
	padding: 6px 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--bleu-bandol, #1E2B5E);
	font: 600 14px/1.3 var(--wp--preset--font-family--body);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* Lien « Gestion des cookies » du pied de page (rendu comme les autres liens légaux). */
.bm-consent-open-wrap {
	margin: 0;
}

.bm-consent-open {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.bm-consent-open:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Cookie flottant (bas à gauche) : rouvre le choix à tout moment ---------- */
.bm-cookie-fab {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 49; /* Sous la barre « Appeler / Devis » et le bandeau. */
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--blanc-casse, #FFFDF9);
	box-shadow: var(--wp--custom--shadow--floating, 0 8px 24px rgba(22, 28, 51, .18));
	cursor: pointer;
	transition: transform .25s ease;
}

.bm-cookie-fab svg {
	width: 32px;
	height: 32px;
}

.bm-cookie-fab:hover {
	transform: rotate(-14deg) scale(1.06);
}

.bm-cookie-fab:focus-visible {
	outline: 2px solid var(--wp--preset--color--bleu-bandol, #1E2B5E);
	outline-offset: 3px;
}

.bm-consent-visible .bm-cookie-fab {
	display: none;
}

/* Pas d'infobulle native : le nom accessible suffit, on affiche une étiquette au survol. */
.bm-cookie-fab__label {
	position: absolute;
	left: calc(100% + 10px);
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--bleu-nuit, #161C33);
	color: var(--wp--preset--color--blanc-casse, #FFFDF9);
	font: 500 13px/1.2 var(--wp--preset--font-family--body);
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translateX(-4px) rotate(14deg);
	transform-origin: left center;
	transition: opacity .2s ease, transform .2s ease;
}

.bm-cookie-fab:hover .bm-cookie-fab__label,
.bm-cookie-fab:focus-visible .bm-cookie-fab__label {
	opacity: 1;
	transform: translateX(0) rotate(14deg);
}

.bm-cookie-fab:focus-visible {
	transform: none;
}

.bm-cookie-fab:focus-visible .bm-cookie-fab__label {
	transform: none;
}

/* Le bandeau cache la barre « Appeler / Devis » le temps du choix. */
.bm-consent-visible .bm-mobilebar {
	visibility: hidden;
}

@media (max-width: 781px) {
	/* Mobile : panneau collé en bas, pleine largeur. */
	.bm-consent {
		align-items: flex-end;
		padding: 0;
	}

	.bm-consent__box {
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
		border-radius: 24px 24px 0 0;
	}

	.bm-consent__title {
		font-size: 20px;
	}

	.bm-consent__text {
		font-size: 14.5px;
	}

	/* Boutons empilés pleine largeur, « Tout accepter » en premier. */
	.bm-consent__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.bm-consent__btn {
		flex: none;
		width: 100%;
		min-width: 0;
	}

	/* Cookie au-dessus de la barre « Appeler / Devis » pleine largeur. */
	.bm-cookie-fab {
		left: 16px;
		bottom: calc(92px + env(safe-area-inset-bottom));
		width: 44px;
		height: 44px;
	}

	.bm-cookie-fab svg {
		width: 28px;
		height: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bm-cookie-fab,
	.bm-cookie-fab__label,
	.bm-switch__track,
	.bm-switch__track::after {
		transition: none;
	}
}
