/* ==========================================================================
   Atendimento WhatsApp — botão flutuante + card de atendentes
   Prefixo: pdm-whatsapp-*
   ========================================================================== */

.pdm-whatsapp-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
}

.pdm-whatsapp-widget > * {
	pointer-events: auto;
}

/* Botão flutuante ------------------------------------------------------- */

.pdm-whatsapp-trigger {
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	font-size: 30px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.pdm-whatsapp-widget.is-open .pdm-whatsapp-trigger {
	background: #1eb857;
}

.pdm-whatsapp-trigger:hover {
	transform: scale(1.08);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.pdm-whatsapp-trigger:focus-visible {
	outline: 3px solid var(--pdm-primary-dark, #0b4f6c);
	outline-offset: 2px;
}

/* Balão de chamada ------------------------------------------------------ */

.pdm-whatsapp-callout {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	box-sizing: border-box;
	max-width: 260px;
	background: #fff;
	color: #334155;
	border: 1px solid #e4e9f0;
	border-radius: 12px;
	padding: 10px 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
	font-size: 0.85rem;
	line-height: 1.35;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.pdm-whatsapp-callout.is-hidden {
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
}

.pdm-whatsapp-callout__dot {
	flex: 0 0 10px;
	width: 10px;
	height: 10px;
	margin-top: 4px;
	border-radius: 50%;
	background: #25d366;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	animation: pdm-whatsapp-pulse 2s infinite;
}

@keyframes pdm-whatsapp-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
	70%  { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.pdm-whatsapp-callout__text {
	display: flex;
	flex-direction: column;
}

.pdm-whatsapp-callout__text strong {
	color: #0f172a;
}

/* Painel/card ----------------------------------------------------------- */

.pdm-whatsapp-panel {
	display: flex;
	flex-direction: column;
	width: min(400px, calc(100vw - 30px));
	max-width: 100%;
	max-height: min(560px, calc(100vh - 150px));
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	transform: translateY(18px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.26s ease, transform 0.26s ease, visibility 0.26s;
}

.pdm-whatsapp-widget.is-open .pdm-whatsapp-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.pdm-whatsapp-panel__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 16px 14px;
	background: #075e54;
	color: #fff;
}

.pdm-whatsapp-panel__icon {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	font-size: 20px;
}

.pdm-whatsapp-panel__title {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pdm-whatsapp-panel__title strong {
	font-size: 1rem;
	line-height: 1.2;
}

.pdm-whatsapp-panel__title span {
	font-size: 0.82rem;
	line-height: 1.3;
	opacity: 0.85;
}

.pdm-whatsapp-close {
	margin-left: auto;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}

.pdm-whatsapp-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.pdm-whatsapp-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pdm-whatsapp-panel__body {
	overflow-y: auto;
	padding: 14px 16px 16px;
	overscroll-behavior: contain;
}

.pdm-whatsapp-section + .pdm-whatsapp-section {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #edf1f6;
}

.pdm-whatsapp-section__title {
	margin: 0 0 10px;
	font-size: 0.76rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748b;
}

/* Cartão de atendente --------------------------------------------------- */

.pdm-whatsapp-agent {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #eef2f7;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pdm-whatsapp-agent:hover {
	background: #f1f5f9;
	border-color: #dbe4ee;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.pdm-whatsapp-agent + .pdm-whatsapp-agent {
	margin-top: 8px;
}

.pdm-whatsapp-avatar {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #e2e8f0;
	color: #64748b;
}

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

.pdm-whatsapp-avatar--empty {
	font-size: 20px;
}

.pdm-whatsapp-agent__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
	gap: 2px;
}

.pdm-whatsapp-agent__info strong {
	font-size: 0.92rem;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pdm-whatsapp-agent__info span {
	font-size: 0.8rem;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pdm-whatsapp-agent__call {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 7px 14px;
	border-radius: 999px;
	background: #dcfce7;
	color: #15803d;
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.pdm-whatsapp-agent:hover .pdm-whatsapp-agent__call {
	background: #4ade80;
	color: #14532d;
}

/* Responsivo ------------------------------------------------------------ */

@media (max-width: 640px) {
	.pdm-whatsapp-widget {
		right: 15px;
		bottom: 15px;
		gap: 10px;
	}
	.pdm-whatsapp-panel {
		width: calc(100vw - 30px);
	}
	.pdm-whatsapp-trigger {
		width: 56px;
		height: 56px;
		font-size: 28px;
	}
	.pdm-whatsapp-callout {
		max-width: calc(100vw - 150px);
		font-size: 0.8rem;
	}
}

/* Redução de movimento -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.pdm-whatsapp-callout,
	.pdm-whatsapp-panel,
	.pdm-whatsapp-trigger {
		transition: none;
	}
	.pdm-whatsapp-callout__dot {
		animation: none;
	}
}
