/**
 * Biotifull WhatsApp — styles du widget frontend.
 * Préfixe unique .bfw- pour éviter tout conflit avec Elementor / Blocksy.
 * Toutes les animations utilisent exclusivement transform/opacity (60fps).
 */

.bfw-root {
	--bfw-offset-x: 20px;
	--bfw-offset-y: 20px;
	--bfw-btn-size: 60px;
	--bfw-grad-start: #25D366;
	--bfw-grad-end: #128C7E;
	--bfw-icon-color: #FFFFFF;
	--bfw-badge-color: #FF3B30;
	--bfw-panel-bg: #E5DDD5;
	--bfw-header-bg: #075E54;
	--bfw-header-text: #FFFFFF;
	--bfw-panel-w: 360px;
	--bfw-panel-h: 520px;
	--bfw-teaser-width: 220px;
	--bfw-z: 2147483000; /* Au-dessus du header sticky Blocksy et des modales Elementor. */

	position: fixed;
	bottom: var(--bfw-offset-y);
	z-index: var(--bfw-z);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
	box-sizing: border-box;
}

.bfw-root * ,
.bfw-root *::before,
.bfw-root *::after {
	box-sizing: border-box;
}

.bfw-root.bfw-pos-right {
	right: var(--bfw-offset-x);
}

.bfw-root.bfw-pos-left {
	left: var(--bfw-offset-x);
}

.bfw-root[data-loading="1"] {
	opacity: 0;
	pointer-events: none;
}

/* ---------------------------------------------------------------------- */
/* Bouton flottant                                                        */
/* ---------------------------------------------------------------------- */

.bfw-button {
	position: relative;
	width: var(--bfw-btn-size);
	height: var(--bfw-btn-size);
	border-radius: 50%;
	border: 0;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--bfw-grad-start) 0%, var(--bfw-grad-end) 100%);
	color: var(--bfw-icon-color);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .18);
	min-width: 56px;
	min-height: 56px;
	-webkit-tap-highlight-color: transparent;
	transform: translateZ(0) scale(1);
	transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
	will-change: transform;
}

.bfw-button svg {
	width: 55%;
	height: 55%;
	transition: transform .25s ease;
	pointer-events: none;
}

.bfw-root.bfw-hover-fx .bfw-button:hover,
.bfw-root.bfw-hover-fx .bfw-button:focus-visible {
	transform: scale(1.08);
	box-shadow: 0 10px 26px rgba(0, 0, 0, .32), 0 4px 10px rgba(0, 0, 0, .2);
}

.bfw-root.bfw-hover-fx .bfw-button:hover svg,
.bfw-root.bfw-hover-fx .bfw-button:focus-visible svg {
	transform: rotate(8deg);
}

.bfw-button:active {
	transform: scale(.94);
}

.bfw-button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* Ripple au clic */
.bfw-ripple {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	overflow: hidden;
	pointer-events: none;
}

.bfw-ripple span {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	transform: scale(0);
	opacity: 1;
	width: 20px;
	height: 20px;
	margin-left: -10px;
	margin-top: -10px;
	animation: bfw-ripple-anim .6s ease-out forwards;
}

@keyframes bfw-ripple-anim {
	to {
		transform: scale(12);
		opacity: 0;
	}
}

/* Halo / anneau pulsant continu */
.bfw-pulse-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	pointer-events: none;
}

.bfw-pulse-ring::before,
.bfw-pulse-ring::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--bfw-grad-start);
	opacity: .55;
	transform: scale(1);
	animation: bfw-pulse-ring-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-out infinite;
}

.bfw-pulse-ring::after {
	animation-delay: calc(var(--bfw-attn-interval, 8) * 1s / 2);
}

@keyframes bfw-pulse-ring-anim {
	0% { transform: scale(1); opacity: .55; }
	30% { transform: scale(1.6); opacity: 0; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* Badge de notification */
.bfw-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--bfw-badge-color);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 2px #fff;
	transform: scale(1);
}

.bfw-root.bfw-attn-heartbeat .bfw-badge {
	animation: bfw-heartbeat-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-in-out infinite;
}

/* ---------------------------------------------------------------------- */
/* Boucles d'attention appliquées au bouton                               */
/* ---------------------------------------------------------------------- */

.bfw-root.bfw-attn-heartbeat .bfw-button {
	animation: bfw-heartbeat-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-in-out infinite;
}

@keyframes bfw-heartbeat-anim {
	0%, 100% { transform: scale(1); }
	4% { transform: scale(1.15); }
	8% { transform: scale(1); }
	12% { transform: scale(1.12); }
	16% { transform: scale(1); }
}

.bfw-root.bfw-attn-shake .bfw-button {
	animation: bfw-shake-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-in-out infinite;
}

@keyframes bfw-shake-anim {
	0%, 92%, 100% { transform: translateX(0) rotate(0); }
	93% { transform: translateX(-3px) rotate(-6deg); }
	94% { transform: translateX(3px) rotate(6deg); }
	95% { transform: translateX(-3px) rotate(-4deg); }
	96% { transform: translateX(3px) rotate(4deg); }
	97% { transform: translateX(-2px) rotate(-2deg); }
	98% { transform: translateX(0) rotate(0); }
}

.bfw-root.bfw-attn-glow .bfw-button {
	animation: bfw-glow-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-in-out infinite;
}

@keyframes bfw-glow-anim {
	0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, .28), 0 0 0 0 rgba(37, 211, 102, .6); }
	50% { box-shadow: 0 6px 18px rgba(0, 0, 0, .28), 0 0 0 14px rgba(37, 211, 102, 0); }
}

.bfw-root.bfw-attn-tada .bfw-button {
	animation: bfw-tada-anim calc(var(--bfw-attn-interval, 8) * 1s) ease-in-out infinite;
}

@keyframes bfw-tada-anim {
	0%, 90%, 100% { transform: scale(1) rotate(0); }
	91% { transform: scale(.95) rotate(-3deg); }
	92% { transform: scale(1.05) rotate(3deg); }
	93% { transform: scale(1.05) rotate(-3deg); }
	94%, 95%, 96%, 97% { transform: scale(1.08) rotate(3deg); }
	94.5%, 95.5%, 96.5% { transform: scale(1.08) rotate(-3deg); }
	98% { transform: scale(1) rotate(0); }
}

/* ---------------------------------------------------------------------- */
/* Animations d'entrée du bouton                                          */
/* ---------------------------------------------------------------------- */

.bfw-button-wrap {
	position: relative;
	opacity: 0;
	transform: scale(.6);
}

.bfw-button-wrap.bfw-visible.bfw-enter-fade-scale {
	animation: bfw-enter-fade-scale .5s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes bfw-enter-fade-scale {
	from { opacity: 0; transform: scale(.5); }
	to { opacity: 1; transform: scale(1); }
}

.bfw-button-wrap.bfw-visible.bfw-enter-slide-up {
	animation: bfw-enter-slide-up .5s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes bfw-enter-slide-up {
	from { opacity: 0; transform: translateY(60px); }
	to { opacity: 1; transform: translateY(0); }
}

.bfw-button-wrap.bfw-visible.bfw-enter-bounce {
	animation: bfw-enter-bounce .7s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes bfw-enter-bounce {
	0% { opacity: 0; transform: scale(.3) translateY(40px); }
	50% { opacity: 1; transform: scale(1.08) translateY(-8px); }
	70% { transform: scale(.96) translateY(2px); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}

.bfw-button-wrap.bfw-visible.bfw-enter-rotate-in {
	animation: bfw-enter-rotate-in .55s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes bfw-enter-rotate-in {
	from { opacity: 0; transform: rotate(-160deg) scale(.4); }
	to { opacity: 1; transform: rotate(0) scale(1); }
}

.bfw-button-wrap.bfw-visible.bfw-enter-none {
	opacity: 1;
	transform: scale(1);
}

/* ---------------------------------------------------------------------- */
/* Bulle d'accroche (teaser)                                              */
/* ---------------------------------------------------------------------- */

.bfw-teaser {
	position: absolute;
	max-width: var(--bfw-teaser-width, 220px);
	background: #fff;
	color: #111b21;
	font-size: 14px;
	padding: 12px 34px 12px 14px;
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
	opacity: 0;
	transform: translateY(10px) scale(.92);
	pointer-events: none;
	transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

/* Position "au-dessus" / "en-dessous" : alignée sur le même bord (gauche ou
   droite) que le bouton, selon la position générale du widget. */
.bfw-teaser.bfw-teaser-pos-top,
.bfw-teaser.bfw-teaser-pos-bottom {
	transform: translateY(10px) scale(.92);
}

.bfw-root.bfw-pos-right .bfw-teaser.bfw-teaser-pos-top,
.bfw-root.bfw-pos-right .bfw-teaser.bfw-teaser-pos-bottom {
	right: 0;
}

.bfw-root.bfw-pos-left .bfw-teaser.bfw-teaser-pos-top,
.bfw-root.bfw-pos-left .bfw-teaser.bfw-teaser-pos-bottom {
	left: 0;
}

.bfw-teaser.bfw-teaser-pos-top {
	bottom: calc(var(--bfw-btn-size) + 14px);
}

.bfw-teaser.bfw-teaser-pos-bottom {
	top: calc(var(--bfw-btn-size) + 14px);
}

/* Position "à gauche" / "à droite" : à côté du bouton, indépendamment du
   coin de l'écran occupé par le widget. */
.bfw-teaser.bfw-teaser-pos-left {
	right: calc(var(--bfw-btn-size) + 14px);
	bottom: 4px;
	transform: translateX(10px) scale(.92);
}

.bfw-teaser.bfw-teaser-pos-right {
	left: calc(var(--bfw-btn-size) + 14px);
	bottom: 4px;
	transform: translateX(-10px) scale(.92);
}

.bfw-teaser.bfw-teaser-pos-left.bfw-teaser-visible,
.bfw-teaser.bfw-teaser-pos-right.bfw-teaser-visible {
	transform: translateX(0) scale(1);
}

.bfw-teaser.bfw-teaser-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.bfw-teaser-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 22px;
	height: 22px;
	min-width: 22px;
	min-height: 22px;
	border: 0;
	background: transparent;
	color: #8696a0;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
}

.bfw-teaser-close:hover {
	background: rgba(0, 0, 0, .06);
}

/* ---------------------------------------------------------------------- */
/* Panneau de chat                                                        */
/* ---------------------------------------------------------------------- */

.bfw-panel {
	position: absolute;
	bottom: calc(var(--bfw-btn-size) + 16px);
	width: var(--bfw-panel-w);
	max-width: calc(100vw - 24px);
	height: var(--bfw-panel-h);
	max-height: min(640px, calc(100vh - 120px));
	background: var(--bfw-panel-bg);
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: scale(.4) translateY(20px);
	transform-origin: bottom right;
	pointer-events: none;
	visibility: hidden;
}

.bfw-root.bfw-pos-right .bfw-panel {
	right: 0;
	transform-origin: bottom right;
}

.bfw-root.bfw-pos-left .bfw-panel {
	left: 0;
	transform-origin: bottom left;
}

.bfw-panel.bfw-panel-open {
	opacity: 1;
	transform: scale(1) translateY(0);
	pointer-events: auto;
	visibility: visible;
}

.bfw-panel.bfw-transition-morph {
	transition: opacity .35s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1), visibility 0s;
}

.bfw-panel.bfw-transition-slide-up {
	transform: translateY(40px);
	transform-origin: center;
}

.bfw-panel.bfw-transition-slide-up.bfw-panel-open {
	transform: translateY(0);
}

.bfw-panel.bfw-transition-slide-up {
	transition: opacity .3s ease, transform .5s cubic-bezier(.16, 1.36, .38, 1), visibility 0s;
}

.bfw-panel.bfw-transition-fade-scale {
	transform: scale(.9);
	transform-origin: center;
}

.bfw-panel.bfw-transition-fade-scale.bfw-panel-open {
	transform: scale(1);
}

.bfw-panel.bfw-transition-fade-scale {
	transition: opacity .28s ease, transform .28s ease, visibility 0s;
}

/* Header */
.bfw-panel-header {
	background: var(--bfw-header-bg);
	color: var(--bfw-header-text);
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.bfw-panel-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .25);
	background-size: cover;
	background-position: center;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	overflow: hidden;
}

.bfw-panel-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bfw-panel-identity {
	flex: 1 1 auto;
	min-width: 0;
}

.bfw-panel-name {
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bfw-panel-status {
	font-size: 12px;
	opacity: .85;
	display: flex;
	align-items: center;
	gap: 5px;
}

.bfw-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #8de3a3;
	flex: 0 0 auto;
}

.bfw-status-dot.bfw-status-offline {
	background: #c9c9c9;
}

.bfw-panel-close {
	width: 32px;
	height: 32px;
	min-width: 32px;
	min-height: 32px;
	border: 0;
	background: rgba(255, 255, 255, .15);
	color: var(--bfw-header-text);
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	transition: background .2s ease, transform .2s ease;
}

.bfw-panel-close:hover {
	background: rgba(255, 255, 255, .28);
	transform: rotate(90deg);
}

/* Corps */
.bfw-panel-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px 12px;
	background-image:
		radial-gradient(rgba(0, 0, 0, .035) 1px, transparent 1px);
	background-size: 16px 16px;
	-webkit-overflow-scrolling: touch;
}

.bfw-bubble {
	max-width: 82%;
	background: #fff;
	color: #111b21;
	padding: 9px 12px;
	border-radius: 10px 10px 10px 2px;
	font-size: 14px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
	margin-bottom: 10px;
	opacity: 0;
	transform: translateY(10px);
}

.bfw-bubble.bfw-bubble-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
}

.bfw-root.bfw-stagger .bfw-bubble.bfw-bubble-visible:nth-of-type(1) { transition-delay: 0s; }
.bfw-root.bfw-stagger .bfw-bubble.bfw-bubble-visible:nth-of-type(2) { transition-delay: .12s; }
.bfw-root.bfw-stagger .bfw-bubble.bfw-bubble-visible:nth-of-type(3) { transition-delay: .24s; }
.bfw-root.bfw-stagger .bfw-bubble.bfw-bubble-visible:nth-of-type(4) { transition-delay: .36s; }

.bfw-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fff;
	padding: 10px 14px;
	border-radius: 10px 10px 10px 2px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
	margin-bottom: 10px;
}

.bfw-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9fb0b8;
	display: inline-block;
	animation: bfw-typing-anim 1.1s ease-in-out infinite;
}

.bfw-typing span:nth-child(2) { animation-delay: .15s; }
.bfw-typing span:nth-child(3) { animation-delay: .3s; }

@keyframes bfw-typing-anim {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Réponses rapides */
.bfw-quick-replies {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.bfw-quick-reply-btn {
	background: #fff;
	border: 1px solid rgba(7, 94, 84, .25);
	color: #075E54;
	border-radius: 18px;
	padding: 10px 14px;
	font-size: 13.5px;
	text-align: left;
	cursor: pointer;
	min-height: 44px;
	transition: transform .15s ease, background .15s ease;
}

.bfw-quick-reply-btn:hover,
.bfw-quick-reply-btn:focus-visible {
	background: #f0faf6;
	transform: translateX(2px);
}

/* Formulaire pré-chat */
.bfw-prechat {
	background: #fff;
	border-radius: 10px;
	padding: 14px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bfw-prechat input {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #d5dade;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: #111b21;
}

.bfw-prechat input:focus {
	outline: none;
	border-color: #25D366;
	box-shadow: 0 0 0 2px rgba(37, 211, 102, .25);
}

.bfw-prechat-error {
	color: #d32f2f;
	font-size: 12.5px;
	display: none;
}

.bfw-prechat-error.bfw-visible {
	display: block;
}

/* Footer / CTA */
.bfw-panel-footer {
	flex: 0 0 auto;
	padding: 10px 14px;
	background: #f0f2f5;
}

.bfw-cta-btn {
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--bfw-grad-start) 0%, var(--bfw-grad-end) 100%);
	color: #fff;
	font-weight: 600;
	font-size: 14.5px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: transform .15s ease, filter .15s ease;
}

.bfw-cta-btn:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

.bfw-cta-btn:active {
	transform: translateY(0);
}

.bfw-powered {
	text-align: center;
	font-size: 10.5px;
	color: #8696a0;
	margin-top: 6px;
}

/* Lien de secours (noscript) */
.bfw-noscript-link {
	position: fixed;
	right: 20px;
	bottom: 20px;
	background: #25D366;
	color: #fff;
	padding: 12px 18px;
	border-radius: 999px;
	text-decoration: none;
	font-size: 14px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
	z-index: 2147483000;
}

/* ---------------------------------------------------------------------- */
/* Mobile-first : panneau plein écran sous 480px                          */
/* ---------------------------------------------------------------------- */

@media (max-width: 480px) {
	.bfw-root {
		--bfw-offset-x: 14px;
		--bfw-offset-y: 14px;
	}

	.bfw-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		max-width: 100%;
		max-height: 100%;
		border-radius: 0;
		transform-origin: center !important;
	}

	.bfw-teaser {
		max-width: calc(100vw - 90px);
	}

	.bfw-panel-header {
		padding-top: max(14px, env(safe-area-inset-top));
	}

	.bfw-panel-footer {
		padding-bottom: max(10px, env(safe-area-inset-bottom));
	}
}

/* ---------------------------------------------------------------------- */
/* Accessibilité : prefers-reduced-motion                                 */
/* Toutes les animations sont désactivées ; le widget reste fonctionnel.  */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.bfw-root,
	.bfw-root * {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	.bfw-button-wrap {
		opacity: 1 !important;
		transform: none !important;
	}

	.bfw-panel {
		transform: none !important;
	}

	.bfw-panel.bfw-panel-open {
		opacity: 1 !important;
	}

	.bfw-bubble {
		opacity: 1 !important;
		transform: none !important;
	}

	.bfw-pulse-ring::before,
	.bfw-pulse-ring::after {
		display: none;
	}
}
