/**
 * WhatsApp Flottant — styles du bouton côté visiteur.
 */

.wfb-wrapper {
	position: fixed;
	z-index: 99999;
	bottom: var(--wfb-bottom, 20px);
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.wfb-wrapper *,
.wfb-wrapper *::before,
.wfb-wrapper *::after {
	box-sizing: border-box;
}

/* Réinitialisation défensive : neutralise les styles de liens/boutons hérités du thème. */
.wfb-wrapper a {
	margin: 0;
	border: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none !important;
}

.wfb-wrapper button {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.wfb-pos-right {
	right: var(--wfb-side, 20px);
	align-items: flex-end;
}

.wfb-pos-left {
	left: var(--wfb-side, 20px);
	align-items: flex-start;
}

/* ---------- Bouton principal ---------- */
.wfb-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--wfb-size, 60px);
	height: var(--wfb-size, 60px);
	border-radius: 50%;
	background: var(--wfb-bg, #25D366);
	color: var(--wfb-icon, #ffffff);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.12);
	text-decoration: none;
	cursor: pointer;
	border: 0;
	-webkit-tap-highlight-color: transparent;
	transform: scale(0);
	opacity: 0;
	transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.32s ease, box-shadow 0.2s ease;
}

.wfb-visible .wfb-button {
	transform: scale(1);
	opacity: 1;
}

.wfb-button:hover {
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
	transform: scale(1.06);
	color: var(--wfb-icon, #ffffff);
}

.wfb-button:active {
	transform: scale(0.95);
}

.wfb-button-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 0;
}

.wfb-button .wfb-icon {
	width: 56%;
	height: 56%;
	display: block;
	flex: none;
}

/* ---------- Pulsation ---------- */
.wfb-has-pulse .wfb-button::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--wfb-bg, #25D366);
	z-index: -1;
	opacity: 0.55;
	animation: wfb-pulse 2.2s ease-out infinite;
}

@keyframes wfb-pulse {
	0%   { transform: scale(1);   opacity: 0.55; }
	70%  { transform: scale(1.7); opacity: 0; }
	100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- Bulle d'accueil ---------- */
.wfb-bubble {
	position: relative;
	width: 270px;
	max-width: calc(100vw - var(--wfb-side, 20px) - 24px);
	padding: 14px;
	border-radius: 16px;
	background: #ffffff;
	color: #111111;
	box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translateY(12px) scale(0.96);
	transform-origin: bottom right;
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
	text-align: left;
}

.wfb-pos-left .wfb-bubble {
	transform-origin: bottom left;
}

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

.wfb-bubble-close {
	position: absolute;
	top: 6px;
	right: 8px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 26px !important;
	height: 26px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #9aa0a6 !important;
	line-height: 1 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	cursor: pointer;
}

.wfb-bubble-close:hover {
	background: rgba(0, 0, 0, 0.06) !important;
	color: #5f6368 !important;
}

.wfb-bubble-close .wfb-x {
	width: 15px;
	height: 15px;
	display: block;
}

.wfb-bubble-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-right: 18px;
}

.wfb-avatar {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #25D366;
	color: #ffffff;
}

.wfb-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wfb-avatar--default .wfb-icon {
	width: 22px;
	height: 22px;
}

.wfb-bubble-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wfb-bubble-name {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	color: #111111;
}

.wfb-bubble-status {
	display: flex;
	align-items: center;
	font-size: 12px;
	color: #5f6368;
}

.wfb-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 5px;
	border-radius: 50%;
	background: #2dd36f;
	box-shadow: 0 0 0 0 rgba(45, 211, 111, 0.55);
	animation: wfb-dot 1.8s infinite;
}

@keyframes wfb-dot {
	0%   { box-shadow: 0 0 0 0 rgba(45, 211, 111, 0.55); }
	70%  { box-shadow: 0 0 0 7px rgba(45, 211, 111, 0); }
	100% { box-shadow: 0 0 0 0 rgba(45, 211, 111, 0); }
}

.wfb-bubble-title {
	display: block;
	margin-top: 11px;
	font-weight: 600;
	font-size: 14px;
	color: #111111;
}

.wfb-bubble-text {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.45;
	color: #444444;
}

.wfb-bubble-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 13px;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--wfb-bg, #25D366);
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.wfb-bubble-cta:hover {
	filter: brightness(0.95);
	color: #ffffff;
}

.wfb-bubble-cta .wfb-icon {
	width: 18px;
	height: 18px;
}

/* ---------- Très petits écrans ---------- */
@media (max-width: 360px) {
	.wfb-bubble {
		width: 240px;
	}

	.wfb-bubble-text {
		font-size: 12.5px;
	}
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	.wfb-has-pulse .wfb-button::before,
	.wfb-dot {
		animation: none;
	}

	.wfb-button,
	.wfb-bubble {
		transition: opacity 0.2s ease;
	}
}
