/* Botão do WhatsApp - Widget Flutuante
   CSS mobile-first: as regras "base" abaixo já são pensadas para telas
   pequenas (a maioria do tráfego). Os ajustes para telas maiores entram
   depois, dentro de @media (min-width: 782px). */

:root {
	--wpwb-color: #25D366;
	--wpwb-color-dark: #1ebe5b;
}

.wpwb-widget {
	position: fixed;
	z-index: 999999;
	bottom: 16px;
	display: flex;
	/* O balão fica AO LADO do botão (na mesma linha), não acima dele: assim
	   ele nunca invade o espaço do botão do Assistente IA, que é empilhado
	   logo acima. */
	align-items: center;
	flex-direction: row;
	gap: 10px;
	/* respeita áreas seguras em iPhones com barra inferior/notch */
	padding-bottom: env(safe-area-inset-bottom, 0);
	/* o container é só um posicionador: ele mesmo nunca captura clique
	   (senão a caixa dele — que pode ficar alta por causa do balão de
	   boas-vindas — engoliria toques destinados a outros botões
	   flutuantes ao lado, como o do Assistente IA) */
	pointer-events: none;
}

/* os elementos internos voltam a receber clique normalmente */
.wpwb-button,
.wpwb-greeting.wpwb-greeting-show {
	pointer-events: auto;
}

/* No canto direito o balão entra à esquerda do botão (ordem natural do
   HTML); no canto esquerdo a ordem se inverte, para o balão ficar à
   direita do botão e continuar dentro da tela. */
.wpwb-widget.wpwb-pos-right {
	right: 16px;
	flex-direction: row;
}

.wpwb-widget.wpwb-pos-left {
	left: 16px;
	flex-direction: row-reverse;
}

.wpwb-widget.wpwb-inline {
	position: static;
	display: inline-flex;
	padding-bottom: 0;
}

/* Botão principal ------------------------------------------------------ */

.wpwb-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background-color: var(--wpwb-color, #25D366);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

.wpwb-button:hover,
.wpwb-button:focus-visible {
	background-color: var(--wpwb-color-dark, #1ebe5b);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
	color: #fff;
	transform: translateY(-2px);
}

.wpwb-button .wpwb-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.wpwb-button .wpwb-icon svg {
	width: 26px;
	height: 26px;
	display: block;
}

.wpwb-label {
	display: none;
}

/* Estilo "ícone + texto" */
.wpwb-style-label .wpwb-button {
	width: auto;
	height: 48px;
	padding: 0 18px 0 14px;
	border-radius: 999px;
}

.wpwb-style-label .wpwb-label {
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	max-width: 45vw;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* leve pulsação para chamar atenção sem ser exagerado */
@keyframes wpwb-pulse {
	0% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.55); }
	70% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 14px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0); }
}

.wpwb-widget:not(.wpwb-inline) .wpwb-button {
	animation: wpwb-pulse 2.6s ease-out infinite;
}

/* Balão de boas-vindas --------------------------------------------------- */

/* Estilo alinhado ao padrão visual do site (tema escuro):
   fundo #111827 (card), texto #f0f4ff, borda rgba(255,255,255,.07),
   raio de 16px e tipografia Inter — os mesmos tokens usados no site. */

.wpwb-greeting {
	display: flex;
	align-items: baseline;
	gap: 6px;
	/* deixa espaço para o botão (52px) + gap (10px) + margens laterais */
	max-width: calc(100vw - 100px);
	background: #111827;
	color: #f0f4ff;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	padding: 12px 14px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 13.5px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	opacity: 0;
	transform: translateY(8px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.wpwb-greeting.wpwb-greeting-show {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.wpwb-greeting-text {
	flex: 1 1 auto;
	color: inherit;
	text-decoration: none;
}

/* Apenas o caractere "×": sem caixa, sem fundo, sem borda.
   Tudo com !important porque temas/page-builders aplicam estilos genéricos
   (borda, fundo, raio) em elementos clicáveis — era daí que vinha a
   moldura colorida em volta do X. */
.wpwb-greeting-close {
	flex: 0 0 auto;
	display: inline-block !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	background: none !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-width: 0 !important;
	border-style: none !important;
	border-color: transparent !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	text-decoration: none !important;
	margin: 0 !important;
	/* padding invisível só para aumentar a área de toque no celular */
	padding: 4px 2px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	font: inherit !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: #8492a6 !important; /* --muted do site */
	cursor: pointer !important;
	transition: color 0.15s ease !important;
	user-select: none;
}

.wpwb-greeting-close:hover,
.wpwb-greeting-close:focus-visible {
	color: #f0f4ff !important; /* --text do site */
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* Visibilidade por dispositivo ------------------------------------------- */

.wpwb-hide-mobile {
	display: none;
}

.wpwb-hide-desktop {
	display: flex;
}

/* Telas médias/grandes (desktop) ---------------------------------------- */
@media (min-width: 782px) {
	.wpwb-widget {
		bottom: 24px;
	}

	.wpwb-widget.wpwb-pos-right {
		right: 24px;
	}

	.wpwb-widget.wpwb-pos-left {
		left: 24px;
	}

	.wpwb-button {
		width: 60px;
		height: 60px;
	}

	.wpwb-button .wpwb-icon svg {
		width: 30px;
		height: 30px;
	}

	.wpwb-style-label .wpwb-button {
		height: 54px;
	}

	.wpwb-label {
		max-width: 320px;
	}

	.wpwb-greeting {
		max-width: 260px;
		font-size: 14px;
	}

	.wpwb-hide-mobile {
		display: flex;
	}

	.wpwb-hide-desktop {
		display: none;
	}
}

/* Telas muito pequenas (celulares estreitos) ---------------------------- */
@media (max-width: 360px) {
	.wpwb-button {
		width: 48px;
		height: 48px;
	}

	.wpwb-button .wpwb-icon svg {
		width: 24px;
		height: 24px;
	}

	.wpwb-widget {
		bottom: 12px;
	}

	.wpwb-widget.wpwb-pos-right {
		right: 12px;
	}

	.wpwb-widget.wpwb-pos-left {
		left: 12px;
	}
}

/* Reduz movimento para quem prefere (acessibilidade) --------------------- */
@media (prefers-reduced-motion: reduce) {
	.wpwb-widget:not(.wpwb-inline) .wpwb-button {
		animation: none;
	}

	.wpwb-button,
	.wpwb-greeting {
		transition: none;
	}
}
