/* AR — widget de contato WhatsApp (portado da Essence/NR). */
.arsv-wa {
	--wa-fab: var(--wp--preset--color--ar-secondary);
	--wa-fab-icone: #fff;
	--wa-cabecalho: var(--wp--preset--color--ar-primary);
	--wa-cabecalho-texto: #fff;
	--wa-destaque: var(--wp--preset--color--ar-secondary);
	--wa-fundo-chat: var(--wp--preset--color--ar-bg);
	--wa-balao-fundo: var(--wp--preset--color--ar-bg-soft);
	--wa-raio: 18px;
	--wa-offset-x: 20px;
	--wa-bottom: 20px;
	position: fixed;
	right: var(--wa-offset-x);
	bottom: var(--wa-bottom);
	bottom: max(var(--wa-bottom), env(safe-area-inset-bottom));
	z-index: 90;
	font-family: var(--wp--preset--font-family--ar-body);
	transition: bottom 0.2s ease;
}
.arsv-wa [hidden] { display: none !important; }
.arsv-wa button { font-family: inherit; }

/* ---------- FAB circular ---------- */
.arsv-wa__fab {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--wa-fab);
	color: var(--wa-fab-icone);
	text-decoration: none;
	box-shadow: 0 10px 28px rgba(23, 59, 80, 0.3);
	transition: transform 0.15s ease, opacity 0.15s ease;
	cursor: pointer;
}
.arsv-wa__fab:hover { transform: scale(1.07); }
.arsv-wa__fab:focus-visible { outline: 3px solid var(--wp--preset--color--ar-secondary); outline-offset: 3px; }
.arsv-wa__fab svg { width: 30px; height: 30px; }
/* anel de pulso: 3 ciclos a partir de 2s (parado enquanto o chat está aberto) */
.arsv-wa__fab::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(41, 154, 189, 0.5);
	animation: arsv-wa-pulso 2.4s ease-out 2s 3;
}
.arsv-wa.is-open .arsv-wa__fab::after { animation: none; }
@keyframes arsv-wa-pulso {
	to { box-shadow: 0 0 0 18px rgba(41, 154, 189, 0); }
}
/* selo de notificação — some depois da 1ª abertura da sessão */
.arsv-wa__selo {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 20px;
	height: 20px;
	border-radius: 999px;
	background: var(--wp--preset--color--ar-accent);
	color: var(--wp--preset--color--ar-primary);
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 20px;
	text-align: center;
	padding: 0 4px;
	border: 2px solid #fff;
}
.arsv-wa__selo::before { content: "1"; }
.arsv-wa.is-visto .arsv-wa__selo { display: none; }

/* ---------- balão-convite (teaser) ---------- */
.arsv-wa__balao {
	position: absolute;
	right: calc(100% + 12px);
	bottom: 8px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: max-content;
	max-width: 260px;
	padding: 0.7rem 0.9rem;
	border-radius: 14px 14px 4px 14px;
	background: var(--wa-balao-fundo);
	color: var(--wp--preset--color--ar-text);
	font-size: 0.85rem;
	line-height: 1.35;
	box-shadow: 0 8px 28px rgba(23, 59, 80, 0.18);
	animation: arsv-wa-balao-in 0.35s ease-out;
}
.arsv-wa__balao-abrir {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}
.arsv-wa__balao-fechar {
	flex: none;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--ar-muted);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}
.arsv-wa__balao-fechar:hover { color: var(--wp--preset--color--ar-text); }
@keyframes arsv-wa-balao-in {
	from { opacity: 0; transform: translateY(8px) scale(0.94); }
}

/* ---------- card do chat ---------- */
.arsv-wa__card {
	position: absolute;
	right: 0;
	bottom: calc(58px + 14px);
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 2 * var(--wa-offset-x));
	max-height: calc(100vh - var(--wa-bottom) - 58px - 26px);
	max-height: calc(100dvh - var(--wa-bottom) - 58px - 26px);
	border-radius: var(--wa-raio);
	background: var(--wa-fundo-chat);
	box-shadow: 0 24px 64px rgba(23, 59, 80, 0.35);
	overflow: hidden;
	visibility: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.22s ease-out, transform 0.22s ease-out, visibility 0s 0.22s;
}
/* ponte de hover: cobre o vão de 14px entre card e FAB */
.arsv-wa.is-open::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	width: 360px;
	max-width: calc(100vw - 2 * var(--wa-offset-x));
	height: 14px;
}
.arsv-wa.is-open .arsv-wa__card {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition-delay: 0s;
}

/* topo */
.arsv-wa__topo {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.85rem 0.95rem;
	background: var(--wa-cabecalho);
	color: var(--wa-cabecalho-texto);
	flex: none;
}
.arsv-wa__avatar {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	color: var(--wp--preset--color--ar-primary);
}
.arsv-wa__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arsv-wa__avatar svg { width: 22px; height: 22px; }
.arsv-wa__id { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.arsv-wa__nome {
	font-family: var(--wp--preset--font-family--ar-heading);
	font-size: 1.05rem;
	font-weight: 700;
}
.arsv-wa__status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.74rem;
	opacity: 0.85;
}
.arsv-wa__ponto {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #25d366;
	flex: none;
}
.arsv-wa__fechar {
	flex: none;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wa-cabecalho-texto);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
}
.arsv-wa__fechar:hover { opacity: 1; }
.arsv-wa__fechar:focus-visible { outline: 2px solid var(--wp--preset--color--ar-accent); outline-offset: 2px; }

/* corpo */
.arsv-wa__corpo {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.95rem 0.95rem 0.7rem;
}
.arsv-wa__intro p {
	margin: 0 0 0.5rem;
	color: var(--wp--preset--color--ar-muted);
	font-size: 0.87rem;
	line-height: 1.5;
}
.arsv-wa__intro p:first-child {
	color: var(--wp--preset--color--ar-text);
	font-weight: 600;
}

/* chips de destino — um por linha */
.arsv-wa__opcoes {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0.55rem 0 0;
	padding: 0;
	list-style: none;
}
.arsv-wa__chip {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	width: 100%;
	padding: 0.72rem 0.95rem;
	border-radius: 12px;
	border: 1.5px solid var(--wp--preset--color--ar-border);
	background: var(--wa-balao-fundo);
	color: var(--wp--preset--color--ar-text);
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease,
		transform 0.15s ease, box-shadow 0.15s ease;
}
.arsv-wa__chip::after {
	content: "›";
	flex: none;
	color: var(--wa-destaque);
	font-size: 1.15rem;
	font-weight: 700;
	transition: transform 0.15s ease;
}
.arsv-wa__chip:hover {
	border-color: var(--wa-destaque);
	background: rgba(41, 154, 189, 0.08);
	color: var(--wp--preset--color--ar-text);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(23, 59, 80, 0.09);
}
.arsv-wa__chip:hover::after { transform: translateX(3px); }
.arsv-wa__chip:focus-visible { outline: 3px solid var(--wp--preset--color--ar-secondary); outline-offset: 2px; }

.arsv-wa__nota {
	margin: 0;
	padding: 0 0.95rem 0.7rem;
	font-size: 0.68rem;
	color: var(--wp--preset--color--ar-muted);
	text-align: center;
	flex: none;
}

/* ---------- mobile: bottom-sheet ---------- */
@media (max-width: 640px) {
	.arsv-wa.is-open { z-index: 100002; }
	.arsv-wa__fab { width: 56px; height: 56px; }
	.arsv-wa.is-open .arsv-wa__fab { opacity: 0; pointer-events: none; }
	.arsv-wa__card {
		position: fixed;
		left: 10px;
		right: 10px;
		bottom: 10px;
		bottom: max(10px, env(safe-area-inset-bottom));
		width: auto;
		max-width: none;
		max-height: calc(100vh - 20px);
		max-height: calc(100dvh - 20px);
		transform: translateY(24px);
	}
	.arsv-wa__balao { display: none; }
	.arsv-wa.is-open::before { display: none; } /* bottom-sheet: sem ponte de hover */
}

@media (prefers-reduced-motion: reduce) {
	.arsv-wa, .arsv-wa *, .arsv-wa *::before, .arsv-wa *::after {
		transition: none !important;
		animation: none !important;
	}
}
@media print {
	.arsv-wa { display: none; }
}
