/* Vista WhatsApp Chat — frontend widget */
.vwwa,
.vwwa *,
.vwwa *::before,
.vwwa *::after { box-sizing: border-box; }

.vwwa {
	--vwwa-accent: #25D366;
	--vwwa-head: #075E54;
	--vwwa-size: 60px;
	--vwwa-x: 24px;
	--vwwa-y: 24px;
	--vwwa-bg: #efeae2;
	--vwwa-surface: #ffffff;
	--vwwa-text: #111b21;
	--vwwa-muted: #667781;
	--vwwa-line: rgba(17, 27, 33, .08);
	--vwwa-shadow: 0 24px 60px -12px rgba(11, 20, 26, .35), 0 8px 24px -8px rgba(11, 20, 26, .2);
	--vwwa-ease: cubic-bezier(.2, .9, .3, 1.2);
	position: fixed;
	bottom: calc(var(--vwwa-y) + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000;
	font: 400 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--vwwa-text);
	-webkit-font-smoothing: antialiased;
}
.vwwa[hidden] { display: none !important; }
.vwwa--right { right: var(--vwwa-x); }
.vwwa--left  { left: var(--vwwa-x); }

.vwwa svg { display: block; fill: currentColor; }
.vwwa button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; }
.vwwa a { text-decoration: none; }

/* ---------- Launcher ---------- */
.vwwa-launcher {
	position: relative;
	display: grid !important;
	place-items: center;
	width: var(--vwwa-size);
	height: var(--vwwa-size);
	border-radius: 50%;
	background: var(--vwwa-accent) !important;
	color: #fff !important;
	box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .35), 0 0 0 0 transparent;
	transition: transform .25s var(--vwwa-ease), box-shadow .25s ease;
	-webkit-tap-highlight-color: transparent;
}
.vwwa-launcher:hover { transform: scale(1.07); box-shadow: 0 14px 30px -6px rgba(0, 0, 0, .4); }
.vwwa-launcher:active { transform: scale(.96); }
.vwwa-launcher:focus-visible { outline: 3px solid var(--vwwa-accent); outline-offset: 4px; }

.vwwa-launcher__icon {
	grid-area: 1 / 1;
	display: grid;
	place-items: center;
	transition: transform .35s var(--vwwa-ease), opacity .2s ease;
	position: relative;
	z-index: 1;
}
.vwwa-launcher__icon--wa svg { width: calc(var(--vwwa-size) * .54); height: calc(var(--vwwa-size) * .54); }
.vwwa-launcher__icon--x svg  { width: calc(var(--vwwa-size) * .4);  height: calc(var(--vwwa-size) * .4); }
.vwwa-launcher__icon--x { opacity: 0; transform: rotate(-90deg) scale(.5); }
.vwwa.is-open .vwwa-launcher__icon--wa { opacity: 0; transform: rotate(90deg) scale(.5); }
.vwwa.is-open .vwwa-launcher__icon--x  { opacity: 1; transform: none; }

.vwwa--pulse .vwwa-launcher::before,
.vwwa--pulse .vwwa-launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--vwwa-accent);
	z-index: 0;
	animation: vwwa-ring 2.4s cubic-bezier(.2, .6, .4, 1) infinite;
}
.vwwa--pulse .vwwa-launcher::after { animation-delay: 1.2s; }
.vwwa.is-open .vwwa-launcher::before,
.vwwa.is-open .vwwa-launcher::after,
.vwwa.is-engaged .vwwa-launcher::before,
.vwwa.is-engaged .vwwa-launcher::after { animation: none; opacity: 0; }

@keyframes vwwa-ring {
	0%   { transform: scale(1);   opacity: .45; }
	100% { transform: scale(1.75); opacity: 0; }
}

.vwwa-badge {
	position: absolute;
	top: 0;
	right: 0;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #ff3b30;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
	z-index: 2;
	animation: vwwa-pop .4s var(--vwwa-ease) both;
	animation-delay: 1.5s;
}
.vwwa--left .vwwa-badge { right: auto; left: 0; }
.vwwa.is-engaged .vwwa-badge { display: none; }

@keyframes vwwa-pop {
	from { transform: scale(0); }
	to   { transform: scale(1); }
}

/* ---------- Callout ---------- */
.vwwa-callout {
	position: absolute;
	bottom: calc(var(--vwwa-size) / 2 - 20px);
	display: flex;
	align-items: center;
	gap: 2px;
	max-width: min(260px, calc(100vw - var(--vwwa-size) - var(--vwwa-x) - 32px));
	padding: 4px 4px 4px 0;
	background: var(--vwwa-surface);
	border-radius: 14px;
	box-shadow: 0 8px 28px -6px rgba(11, 20, 26, .28);
	opacity: 0;
	transform: translateX(10px) scale(.95);
	transition: opacity .3s ease, transform .35s var(--vwwa-ease);
	pointer-events: none;
}
.vwwa--right .vwwa-callout { right: calc(var(--vwwa-size) + 14px); transform-origin: right center; }
.vwwa--left  .vwwa-callout { left:  calc(var(--vwwa-size) + 14px); transform-origin: left center; transform: translateX(-10px) scale(.95); }
.vwwa-callout.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.vwwa-callout[hidden] { display: none; }
.vwwa-callout__text {
	padding: 8px 4px 8px 14px !important;
	font-weight: 500;
	font-size: 14px;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.vwwa-callout__x {
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 18px !important;
	line-height: 1;
	color: var(--vwwa-muted) !important;
}
.vwwa-callout__x:hover { background: var(--vwwa-line) !important; }

/* ---------- Panel ---------- */
.vwwa-panel {
	position: absolute;
	bottom: calc(var(--vwwa-size) + 16px);
	width: 370px;
	max-width: calc(100vw - var(--vwwa-x) * 2);
	max-height: min(600px, calc(100vh - var(--vwwa-size) - var(--vwwa-y) - 40px));
	display: flex;
	flex-direction: column;
	background: var(--vwwa-bg);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--vwwa-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(.92);
	transition: opacity .25s ease, transform .35s var(--vwwa-ease), visibility 0s linear .35s;
}
.vwwa--right .vwwa-panel { right: 0; transform-origin: bottom right; }
.vwwa--left  .vwwa-panel { left: 0;  transform-origin: bottom left; }
.vwwa.is-open .vwwa-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .25s ease, transform .35s var(--vwwa-ease), visibility 0s;
}

/* Header */
.vwwa-panel__head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 16px 18px 18px;
	background: var(--vwwa-head);
	background-image: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 60%);
	color: #fff;
}
.vwwa-panel__avatars { position: relative; display: flex; flex: none; }
.vwwa-av {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid var(--vwwa-head);
	background: rgba(255, 255, 255, .2);
	overflow: hidden;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 15px;
	color: #fff;
}
.vwwa-av + .vwwa-av { margin-left: -14px; }
.vwwa-av img, .vwwa-msg__av img, .vwwa-agent__av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vwwa-panel__dot {
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #4ade80;
	border: 2px solid var(--vwwa-head);
}
.vwwa.is-offline .vwwa-panel__dot { background: #a3a3a3; }

.vwwa-panel__titles { min-width: 0; flex: 1; }
.vwwa-panel__titles strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.vwwa-sep { margin: 0 4px; }
.vwwa-panel__sub {
	display: block;
	margin-top: 2px;
	line-height: 1.35;
	font-size: 12.5px;
	opacity: .85;
}
.vwwa-status { font-weight: 600; }
.vwwa-panel__close {
	flex: none;
	align-self: flex-start;
	width: 32px;
	height: 32px;
	display: grid !important;
	place-items: center;
	border-radius: 50%;
	color: #fff !important;
	opacity: .85;
	transition: background .2s, opacity .2s;
}
.vwwa-panel__close:hover { background: rgba(255, 255, 255, .15) !important; opacity: 1; }
.vwwa-panel__close svg { width: 20px; height: 20px; }

/* Body */
.vwwa-panel__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 16px 20px;
	background-color: var(--vwwa-bg);
	background-image:
		radial-gradient(rgba(0, 0, 0, .045) 1px, transparent 1.5px),
		radial-gradient(rgba(0, 0, 0, .03) 1px, transparent 1.5px);
	background-size: 22px 22px, 22px 22px;
	background-position: 0 0, 11px 11px;
}
.vwwa-day {
	width: max-content;
	margin: 0 auto 14px;
	padding: 4px 10px;
	border-radius: 8px;
	background: var(--vwwa-surface);
	color: var(--vwwa-muted);
	font-size: 11.5px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .04em;
	box-shadow: 0 1px 1px rgba(11, 20, 26, .08);
}

.vwwa-msg { display: flex; align-items: flex-end; gap: 8px; }
.vwwa-msg__av {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--vwwa-head);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}
.vwwa-bubble {
	position: relative;
	max-width: 85%;
	padding: 8px 12px 6px;
	background: var(--vwwa-surface);
	border-radius: 4px 14px 14px 14px;
	box-shadow: 0 1px 1.5px rgba(11, 20, 26, .13);
	animation: vwwa-in .35s var(--vwwa-ease) both;
}
.vwwa-bubble::before {
	content: "";
	position: absolute;
	top: 0;
	left: -7px;
	border: 7px solid transparent;
	border-top-color: var(--vwwa-surface);
	border-right-color: var(--vwwa-surface);
	border-width: 0 7px 9px 0;
}
.vwwa-bubble__name { display: block; color: var(--vwwa-accent); filter: brightness(.8); font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.vwwa-bubble__text { font-size: 14.5px; line-height: 1.45; color: var(--vwwa-text); word-wrap: break-word; }
.vwwa-bubble__time { display: block; text-align: right; margin-top: 2px; font-size: 11px; color: var(--vwwa-muted); }

.vwwa-typing { display: none; gap: 4px; padding: 8px 2px 6px; }
.vwwa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5ab; animation: vwwa-dot 1.2s infinite ease-in-out; }
.vwwa-typing i:nth-child(2) { animation-delay: .15s; }
.vwwa-typing i:nth-child(3) { animation-delay: .3s; }
.vwwa-msg.is-typing .vwwa-typing { display: flex; }
.vwwa-msg.is-typing .vwwa-bubble__text,
.vwwa-msg.is-typing .vwwa-bubble__time { display: none; }

@keyframes vwwa-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes vwwa-in {
	from { opacity: 0; transform: translateY(8px) scale(.96); }
	to   { opacity: 1; transform: none; }
}

.vwwa-offline {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: 12px;
	background: #fff7e6;
	color: #7a4b00;
	font-size: 13px;
	line-height: 1.4;
	animation: vwwa-in .35s var(--vwwa-ease) both;
}
.vwwa-offline[hidden] { display: none; }
.vwwa-offline svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* Agent list */
.vwwa-agents { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.vwwa-agents li { margin: 0; padding: 0; animation: vwwa-in .35s var(--vwwa-ease) both; }
.vwwa-agents li:nth-child(2) { animation-delay: .05s; }
.vwwa-agents li:nth-child(3) { animation-delay: .1s; }
.vwwa-agents li:nth-child(4) { animation-delay: .15s; }
.vwwa-agent {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	background: var(--vwwa-surface);
	color: var(--vwwa-text) !important;
	box-shadow: 0 1px 2px rgba(11, 20, 26, .08);
	border-left: 3px solid var(--vwwa-accent);
	transition: transform .2s ease, box-shadow .2s ease;
}
.vwwa-agent:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(11, 20, 26, .25); }
.vwwa-agent:focus-visible { outline: 2px solid var(--vwwa-accent); outline-offset: 2px; }
.vwwa-agent__av {
	position: relative;
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--vwwa-head);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
}
.vwwa-agent__info { flex: 1; min-width: 0; }
.vwwa-agent__info strong { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vwwa-agent__info small { display: block; font-size: 12.5px; color: var(--vwwa-muted); }
.vwwa-agent__go {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--vwwa-accent);
	color: #fff;
}
.vwwa-agent__go svg { width: 18px; height: 18px; }

/* Footer */
.vwwa-panel__foot { padding: 12px 16px 16px; background: var(--vwwa-surface); border-top: 1px solid var(--vwwa-line); }
.vwwa-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 13px 18px;
	border-radius: 999px;
	background: var(--vwwa-accent);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	box-shadow: 0 6px 16px -6px var(--vwwa-accent);
	transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.vwwa-cta:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px -8px var(--vwwa-accent); }
.vwwa-cta:active { transform: translateY(0); }
.vwwa-cta:focus-visible { outline: 3px solid var(--vwwa-accent); outline-offset: 3px; }
.vwwa-cta svg { width: 20px; height: 20px; }

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
	.vwwa {
		--vwwa-bg: #0b141a;
		--vwwa-surface: #1f2c34;
		--vwwa-text: #e9edef;
		--vwwa-muted: #8696a0;
		--vwwa-line: rgba(255, 255, 255, .08);
	}
	.vwwa-panel__body {
		background-image:
			radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1.5px),
			radial-gradient(rgba(255, 255, 255, .025) 1px, transparent 1.5px);
	}
	.vwwa-bubble__name { filter: none; }
	.vwwa-offline { background: #3a2e14; color: #fbd38d; }
	.vwwa-badge { box-shadow: 0 0 0 2px #0b141a; }
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.vwwa-panel {
		position: fixed;
		left: 12px !important;
		right: 12px !important;
		bottom: calc(var(--vwwa-y) + var(--vwwa-size) + 14px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		max-height: calc(100vh - var(--vwwa-y) - var(--vwwa-size) - 40px);
		max-height: calc(100dvh - var(--vwwa-y) - var(--vwwa-size) - 40px);
	}
}
@media (max-width: 767px) { .vwwa--no-mobile { display: none !important; } }
@media (min-width: 768px) { .vwwa--no-desktop { display: none !important; } }

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

/* ==========================================================================
   Theme-proofing
   Themes and page builders often style every <button>, <a> and <svg>
   (padding, min-height, square corners, hover colours, svg sizing).
   These ID-scoped rules lock the widget's geometry so it renders the same
   on any theme.
   ========================================================================== */
#vwwa button,
#vwwa a {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	margin: 0 !important;
	border: 0 !important;
	float: none !important;
	text-decoration: none !important;
	text-transform: none !important;
	text-shadow: none !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
	cursor: pointer;
}
#vwwa a:hover,
#vwwa a:focus { text-decoration: none !important; }
#vwwa svg {
	max-width: none !important;
	min-width: 0 !important;
	flex: none;
	vertical-align: middle;
}
#vwwa img { max-width: 100% !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }

/* Launcher */
#vwwa .vwwa-launcher {
	position: relative !important;
	display: grid !important;
	place-items: center !important;
	width: var(--vwwa-size) !important;
	height: var(--vwwa-size) !important;
	max-height: none !important;
	padding: 0 !important;
	border-radius: 50% !important;
	line-height: 1 !important;
	font-size: 14px !important;
	background: var(--vwwa-accent) !important;
	color: #fff !important;
	overflow: visible !important;
	top: auto !important;
	left: auto !important;
}
#vwwa .vwwa-launcher:hover,
#vwwa .vwwa-launcher:focus,
#vwwa .vwwa-launcher:active { background: var(--vwwa-accent) !important; color: #fff !important; }
#vwwa .vwwa-launcher__icon--wa svg { width: calc(var(--vwwa-size) * .54) !important; height: calc(var(--vwwa-size) * .54) !important; }
#vwwa .vwwa-launcher__icon--x svg  { width: calc(var(--vwwa-size) * .4) !important;  height: calc(var(--vwwa-size) * .4) !important; }
#vwwa .vwwa-badge { font-size: 11px !important; line-height: 20px !important; padding: 0 5px !important; }

/* Panel close */
#vwwa .vwwa-panel__close {
	display: grid !important;
	place-items: center !important;
	width: 32px !important;
	height: 32px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: #fff !important;
	box-shadow: none !important;
	line-height: 1 !important;
}
#vwwa .vwwa-panel__close:hover { background: rgba(255, 255, 255, .15) !important; }
#vwwa .vwwa-panel__close svg { width: 20px !important; height: 20px !important; }

/* Callout */
#vwwa .vwwa-callout__text {
	width: auto !important;
	height: auto !important;
	padding: 8px 4px 8px 14px !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--vwwa-text) !important;
	box-shadow: none !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
}
#vwwa .vwwa-callout__x {
	display: grid !important;
	place-items: center !important;
	width: 26px !important;
	height: 26px !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: var(--vwwa-muted) !important;
	box-shadow: none !important;
	font-size: 18px !important;
	line-height: 1 !important;
}
#vwwa .vwwa-callout__x:hover { background: var(--vwwa-line) !important; }

/* CTA + agent links */
#vwwa .vwwa-cta {
	display: flex !important;
	width: 100% !important;
	height: auto !important;
	padding: 13px 18px !important;
	border-radius: 999px !important;
	background: var(--vwwa-accent) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
}
#vwwa .vwwa-cta svg { width: 20px !important; height: 20px !important; }
#vwwa .vwwa-agent {
	display: flex !important;
	padding: 10px 12px !important;
	border-radius: 14px !important;
	border-left: 3px solid var(--vwwa-accent) !important;
	background: var(--vwwa-surface) !important;
	color: var(--vwwa-text) !important;
	line-height: 1.35 !important;
}
#vwwa .vwwa-agent__go svg { width: 18px !important; height: 18px !important; }
#vwwa .vwwa-offline svg { width: 18px !important; height: 18px !important; }
#vwwa ul, #vwwa li { list-style: none !important; margin-left: 0 !important; padding-left: 0 !important; }
#vwwa li::before, #vwwa li::marker { content: none !important; }

/* Developer credit */
#vwwa .vwwa-credit {
	padding: 7px 12px 9px;
	background: var(--vwwa-surface);
	border-top: 1px solid var(--vwwa-line);
	color: var(--vwwa-muted);
	font-size: 11px;
	line-height: 1.3;
	text-align: center;
	letter-spacing: .01em;
}
#vwwa .vwwa-panel__foot + .vwwa-credit { border-top: 0; padding-top: 0; }
#vwwa .vwwa-credit a {
	display: inline !important;
	padding: 0 !important;
	background: none !important;
	color: var(--vwwa-muted) !important;
	font-weight: 600 !important;
	font-size: 11px !important;
}
#vwwa .vwwa-credit a:hover { color: var(--vwwa-text) !important; }

/* Themes add a (often dotted) outline on mouse focus; keep it for keyboard users only. */
#vwwa button:focus:not(:focus-visible),
#vwwa a:focus:not(:focus-visible) { outline: none !important; box-shadow: none; }
#vwwa .vwwa-launcher:focus:not(:focus-visible) { box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .35) !important; }
#vwwa .vwwa-launcher:focus-visible { outline: 3px solid var(--vwwa-accent) !important; outline-offset: 4px !important; }
