/* ══════════════════════════════════════════════════════════════════════
   Way2API — WhatsApp Quick Chat Widget
   ══════════════════════════════════════════════════════════════════════
   Loaded ONLY when the widget is enabled (see include/whatsapp.config.php).
   Every rule is namespaced under .w2a-wa and every token is a custom
   property on that root, so nothing here can leak into the stock green
   theme, the Bootstrap build, or the additive [data-w2a-theme] layer.

   Palette: WhatsApp's public brand colours — brand green #25D366, deep
   teal #075E54 / #128C7E, outgoing bubble #D9FDD3, read ticks #53BDEB,
   and the dark-mode set (#0B141A / #202C33 / #005C4B). Colours only; the
   chat wallpaper below is an original CSS gradient texture, NOT WhatsApp's
   doodle artwork, so nothing copyrighted is reproduced. The WhatsApp glyph
   comes from the locally bundled, Apache-2.0 Unicons font already loaded
   by include/header.php.

   Layering: z-index 1030 sits above the site (navbar 999, back-to-top 99)
   but below Bootstrap's offcanvas (1045) and modal (1055), so the signup
   modal always covers the chat rather than fighting it.
   ────────────────────────────────────────────────────────────────────── */

.w2a-wa {
	/* Brand */
	--wa-green: #25d366;
	--wa-green-dark: #1da851;
	--wa-teal: #075e54;
	--wa-teal-2: #128c7e;
	--wa-tick: #53bdeb;

	/* Surfaces */
	--wa-header-bg: linear-gradient(135deg, #075e54 0%, #128c7e 100%);
	--wa-header-fg: #ffffff;
	--wa-header-sub: rgba(255, 255, 255, 0.78);
	--wa-chat-bg: #ece5dd;
	--wa-chat-ink: rgba(11, 20, 26, 0.055);
	--wa-chat-ink-2: rgba(11, 20, 26, 0.03);
	--wa-in-bg: #ffffff;
	--wa-in-fg: #111b21;
	--wa-out-bg: #d9fdd3;
	--wa-out-fg: #111b21;
	--wa-meta: rgba(17, 27, 33, 0.45);
	--wa-panel-bg: #ffffff;
	--wa-footer-bg: #f0f2f5;
	--wa-chip-bg: #ffffff;
	--wa-chip-fg: #1f2c34;
	--wa-chip-border: rgba(7, 94, 84, 0.16);
	--wa-chip-hover: #f6fbf8;
	--wa-label: rgba(17, 27, 33, 0.5);
	--wa-input-bg: #ffffff;
	--wa-input-fg: #111b21;
	--wa-divider: rgba(11, 20, 26, 0.08);

	/* Geometry & motion */
	--wa-radius: 18px;
	--wa-bubble-radius: 10px;
	--wa-gap: 20px;
	--wa-fab: 60px;
	--wa-shadow: 0 18px 48px rgba(11, 20, 26, 0.22), 0 4px 14px rgba(11, 20, 26, 0.12);
	--wa-ease: cubic-bezier(0.22, 1, 0.36, 1);

	position: fixed;
	bottom: var(--wa-gap);
	z-index: 1030;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	/* The container is only a positioning frame — clicks pass through the
	   gaps between the launcher and the panel to the page underneath. */
	pointer-events: none;
}

.w2a-wa--right { right: var(--wa-gap); }
.w2a-wa--left  { left: var(--wa-gap); align-items: flex-start; }

.w2a-wa > * { pointer-events: auto; }

/* ── Dark mode ──────────────────────────────────────────────────────────
   Follows the OS preference, and is forced under the site's two dark
   themes (Cyber Neon, Matrix Terminal) so the widget never renders as a
   bright white slab on a dark page. */
@media (prefers-color-scheme: dark) {
	.w2a-wa { color-scheme: dark; }
}

@media (prefers-color-scheme: dark) {
	.w2a-wa:not([data-wa-force-light]) {
		--wa-header-bg: linear-gradient(135deg, #1f2c34 0%, #202c33 100%);
		--wa-header-fg: #e9edef;
		--wa-header-sub: rgba(233, 237, 239, 0.6);
		--wa-chat-bg: #0b141a;
		--wa-chat-ink: rgba(233, 237, 239, 0.05);
		--wa-chat-ink-2: rgba(233, 237, 239, 0.028);
		--wa-in-bg: #202c33;
		--wa-in-fg: #e9edef;
		--wa-out-bg: #005c4b;
		--wa-out-fg: #e9edef;
		--wa-meta: rgba(233, 237, 239, 0.5);
		--wa-panel-bg: #111b21;
		--wa-footer-bg: #1f2c34;
		--wa-chip-bg: #202c33;
		--wa-chip-fg: #e9edef;
		--wa-chip-border: rgba(37, 211, 102, 0.24);
		--wa-chip-hover: #26343c;
		--wa-label: rgba(233, 237, 239, 0.5);
		--wa-input-bg: #2a3942;
		--wa-input-fg: #e9edef;
		--wa-divider: rgba(233, 237, 239, 0.08);
		--wa-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
	}
}

[data-w2a-theme="cyber"] .w2a-wa,
[data-w2a-theme="matrix"] .w2a-wa {
	--wa-header-bg: linear-gradient(135deg, #1f2c34 0%, #202c33 100%);
	--wa-header-fg: #e9edef;
	--wa-header-sub: rgba(233, 237, 239, 0.6);
	--wa-chat-bg: #0b141a;
	--wa-chat-ink: rgba(233, 237, 239, 0.05);
	--wa-chat-ink-2: rgba(233, 237, 239, 0.028);
	--wa-in-bg: #202c33;
	--wa-in-fg: #e9edef;
	--wa-out-bg: #005c4b;
	--wa-out-fg: #e9edef;
	--wa-meta: rgba(233, 237, 239, 0.5);
	--wa-panel-bg: #111b21;
	--wa-footer-bg: #1f2c34;
	--wa-chip-bg: #202c33;
	--wa-chip-fg: #e9edef;
	--wa-chip-border: rgba(37, 211, 102, 0.24);
	--wa-chip-hover: #26343c;
	--wa-label: rgba(233, 237, 239, 0.5);
	--wa-input-bg: #2a3942;
	--wa-input-fg: #e9edef;
	--wa-divider: rgba(233, 237, 239, 0.08);
	--wa-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ═══ Launcher (FAB) ═══════════════════════════════════════════════════ */

.w2a-wa__fab {
	position: relative;
	flex: none;
	width: var(--wa-fab);
	height: var(--wa-fab);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(145deg, #2ee06f 0%, var(--wa-green) 45%, var(--wa-green-dark) 100%);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(37, 211, 102, 0.42), 0 2px 8px rgba(11, 20, 26, 0.2);
	transition: transform 0.28s var(--wa-ease), box-shadow 0.28s var(--wa-ease);
	-webkit-tap-highlight-color: transparent;
}

.w2a-wa__fab:hover {
	transform: translateY(-3px) scale(1.04);
	box-shadow: 0 16px 34px rgba(37, 211, 102, 0.5), 0 3px 10px rgba(11, 20, 26, 0.24);
}

.w2a-wa__fab:active { transform: translateY(-1px) scale(0.98); }

.w2a-wa__fab:focus-visible {
	outline: 3px solid var(--wa-teal-2);
	outline-offset: 3px;
}

/* Breathing halo — an outlined ring that expands and fades, so the launcher
   reads as "live" without the jitter of a continuous bounce. Drawn as a
   border (not a fill) so it can never paint over the glyph, whatever
   stacking context the button's hover transform creates. */
.w2a-wa__fab-ring {
	position: absolute;
	inset: -2px;
	border: 2px solid var(--wa-green);
	border-radius: 50%;
	opacity: 0.6;
	pointer-events: none;
	animation: w2aWaPulse 2.6s ease-out infinite;
}

@keyframes w2aWaPulse {
	0%   { transform: scale(1);    opacity: 0.6; }
	70%  { transform: scale(1.7);  opacity: 0; }
	100% { transform: scale(1.7);  opacity: 0; }
}

.w2a-wa__fab-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	font-size: 32px;
	line-height: 1;
	transform: translate(-50%, -50%) rotate(0deg) scale(1);
	opacity: 1;
	transition: transform 0.3s var(--wa-ease), opacity 0.2s ease;
}

/* Open state: the WhatsApp glyph swaps for a chevron-down (WhatsApp's own
   "collapse" affordance) rather than a hard X. */
.w2a-wa__fab-icon--close {
	transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
	opacity: 0;
	font-size: 34px;
}

.w2a-wa.is-open .w2a-wa__fab-icon {
	transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
	opacity: 0;
}

.w2a-wa.is-open .w2a-wa__fab-icon--close {
	transform: translate(-50%, -50%) rotate(0deg) scale(1);
	opacity: 1;
}

.w2a-wa.is-open .w2a-wa__fab-ring,
.w2a-wa.is-open .w2a-wa__badge,
.w2a-wa.is-open .w2a-wa__tip { display: none; }

/* Unread badge — cleared once the panel has been opened. */
.w2a-wa__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 21px;
	height: 21px;
	padding: 0 5px;
	border-radius: 11px;
	border: 2px solid var(--wa-panel-bg);
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 17px;
	box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

.w2a-wa.is-seen .w2a-wa__badge { display: none; }

/* Hover label */
.w2a-wa__tip {
	position: absolute;
	top: 50%;
	right: calc(100% + 12px);
	transform: translateY(-50%) translateX(6px);
	padding: 7px 13px;
	border-radius: 8px;
	background: #1f2c34;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, transform 0.25s var(--wa-ease), visibility 0.2s;
}

.w2a-wa__tip::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 100%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-left-color: #1f2c34;
}

.w2a-wa--left .w2a-wa__tip {
	right: auto;
	left: calc(100% + 12px);
	transform: translateY(-50%) translateX(-6px);
}

.w2a-wa--left .w2a-wa__tip::after {
	left: auto;
	right: 100%;
	border-left-color: transparent;
	border-right-color: #1f2c34;
}

.w2a-wa__fab:hover .w2a-wa__tip,
.w2a-wa__fab:focus-visible .w2a-wa__tip {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
}

/* ═══ Teaser bubble ════════════════════════════════════════════════════ */

.w2a-wa__teaser {
	position: relative;
	max-width: 254px;
	padding: 13px 30px 13px 15px;
	border-radius: 14px 14px 4px 14px;
	background: var(--wa-in-bg);
	color: var(--wa-in-fg);
	box-shadow: var(--wa-shadow);
	animation: w2aWaTeaserIn 0.45s var(--wa-ease) both;
}

.w2a-wa--left .w2a-wa__teaser { border-radius: 14px 14px 14px 4px; }

.w2a-wa__teaser[hidden] { display: none; }

.w2a-wa__teaser-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
}

.w2a-wa__teaser-x {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wa-meta);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.w2a-wa__teaser-x:hover {
	background: var(--wa-divider);
	color: var(--wa-in-fg);
}

@keyframes w2aWaTeaserIn {
	from { opacity: 0; transform: translateY(10px) scale(0.94); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ Chat panel ═══════════════════════════════════════════════════════ */

.w2a-wa__panel {
	display: flex;
	flex-direction: column;
	width: 372px;
	max-width: calc(100vw - 2 * var(--wa-gap));
	max-height: min(596px, calc(100vh - var(--wa-fab) - 4 * var(--wa-gap)));
	border-radius: var(--wa-radius);
	background: var(--wa-panel-bg);
	box-shadow: var(--wa-shadow);
	overflow: hidden;
	transform-origin: bottom right;
	animation: w2aWaPanelIn 0.34s var(--wa-ease) both;
}

.w2a-wa--left .w2a-wa__panel { transform-origin: bottom left; }

.w2a-wa__panel[hidden] { display: none; }

.w2a-wa__panel.is-closing { animation: w2aWaPanelOut 0.2s ease-in both; }

@keyframes w2aWaPanelIn {
	from { opacity: 0; transform: translateY(18px) scale(0.9); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes w2aWaPanelOut {
	from { opacity: 1; transform: translateY(0) scale(1); }
	to   { opacity: 0; transform: translateY(12px) scale(0.94); }
}

/* ── Header ─────────────────────────────────────────────────────────── */

.w2a-wa__header {
	display: flex;
	align-items: center;
	gap: 11px;
	flex: none;
	padding: 14px 14px 14px 16px;
	background: var(--wa-header-bg);
	color: var(--wa-header-fg);
	position: relative;
}

/* Soft sheen across the header — reads as depth, not decoration. */
.w2a-wa__header::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 140% at 88% -20%, rgba(255, 255, 255, 0.18) 0%, transparent 60%);
	pointer-events: none;
}

.w2a-wa__avatar {
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	padding: 3px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.w2a-wa__avatar img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 50%;
}

/* Fallback avatar when no square brand image is configured (or the configured
   one is missing): the WhatsApp glyph on brand green. */
.w2a-wa__avatar--glyph {
	padding: 0;
	background: linear-gradient(145deg, #2ee06f 0%, var(--wa-green) 50%, var(--wa-green-dark) 100%);
	color: #fff;
	font-size: 24px;
	line-height: 1;
}

.w2a-wa__id {
	min-width: 0;
	flex: 1 1 auto;
}

.w2a-wa__name {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--wa-header-fg);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.w2a-wa__status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 0;
	font-size: 12px;
	line-height: 1.3;
	color: var(--wa-header-sub);
}

.w2a-wa__presence {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
	animation: w2aWaPresence 2.2s ease-out infinite;
}

@keyframes w2aWaPresence {
	0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.65); }
	70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
	100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.w2a-wa__x {
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--wa-header-fg);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	position: relative;
	z-index: 1;
	transition: background 0.2s ease, transform 0.2s ease;
}

.w2a-wa__x:hover { background: rgba(255, 255, 255, 0.24); transform: rotate(90deg); }
.w2a-wa__x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Chat body ──────────────────────────────────────────────────────────
   Wallpaper is an original gradient texture (dots + hairline diagonals),
   written from scratch to evoke chat-paper depth. WhatsApp's own doodle
   artwork is copyrighted and is deliberately not used. */

.w2a-wa__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 14px 14px 18px;
	background-color: var(--wa-chat-bg);
	background-image:
		radial-gradient(circle at 14px 16px, var(--wa-chat-ink) 1.6px, transparent 1.7px),
		radial-gradient(circle at 48px 46px, var(--wa-chat-ink) 1.6px, transparent 1.7px),
		repeating-linear-gradient(135deg, transparent 0 26px, var(--wa-chat-ink-2) 26px 27px, transparent 27px 64px);
	background-size: 64px 64px, 64px 64px, 128px 128px;
	scrollbar-width: thin;
	scrollbar-color: rgba(11, 20, 26, 0.22) transparent;
}

.w2a-wa__body::-webkit-scrollbar { width: 6px; }
.w2a-wa__body::-webkit-scrollbar-track { background: transparent; }

.w2a-wa__body::-webkit-scrollbar-thumb {
	background: rgba(11, 20, 26, 0.2);
	border-radius: 3px;
}

.w2a-wa__body::-webkit-scrollbar-thumb:hover { background: rgba(11, 20, 26, 0.34); }

/* Date divider */
.w2a-wa__day {
	margin: 0 0 12px;
	text-align: center;
}

.w2a-wa__day span {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.9);
	color: var(--wa-meta);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}

@media (prefers-color-scheme: dark) {
	.w2a-wa:not([data-wa-force-light]) .w2a-wa__day span { background: rgba(32, 44, 51, 0.92); }
	.w2a-wa:not([data-wa-force-light]) .w2a-wa__body { scrollbar-color: rgba(233, 237, 239, 0.22) transparent; }
	.w2a-wa:not([data-wa-force-light]) .w2a-wa__body::-webkit-scrollbar-thumb { background: rgba(233, 237, 239, 0.2); }
}

[data-w2a-theme="cyber"] .w2a-wa__day span,
[data-w2a-theme="matrix"] .w2a-wa__day span { background: rgba(32, 44, 51, 0.92); }

/* ── Message bubbles ───────────────────────────────────────────────── */

.w2a-wa__msg {
	position: relative;
	max-width: 86%;
	margin-bottom: 10px;
	padding: 8px 11px 6px;
	border-radius: var(--wa-bubble-radius);
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
	animation: w2aWaMsgIn 0.32s var(--wa-ease) both;
}

.w2a-wa__msg[hidden] { display: none; }

.w2a-wa__msg--in {
	background: var(--wa-in-bg);
	color: var(--wa-in-fg);
	border-top-left-radius: 0;
	margin-right: auto;
}

.w2a-wa__msg--out {
	background: var(--wa-out-bg);
	color: var(--wa-out-fg);
	border-top-right-radius: 0;
	margin-left: auto;
}

/* Bubble tails, drawn as pure CSS triangles — no image asset, no clip-path.
   The outgoing tail is the same triangle mirrored, so both stay in sync. */
.w2a-wa__msg--in::before,
.w2a-wa__msg--out::before {
	content: "";
	position: absolute;
	top: 0;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 9px 9px 0;
	border-color: transparent;
}

.w2a-wa__msg--in::before {
	left: -8px;
	border-right-color: var(--wa-in-bg);
}

.w2a-wa__msg--out::before {
	right: -8px;
	border-right-color: var(--wa-out-bg);
	transform: scaleX(-1);
}

.w2a-wa__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.48;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.w2a-wa__meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 3px;
	margin-top: 2px;
	font-size: 11px;
	color: var(--wa-meta);
}

.w2a-wa__meta .uil,
.w2a-wa__meta .mdi { font-size: 15px; line-height: 1; }

/* Delivered → read: the double tick turns WhatsApp blue. */
.w2a-wa__ticks { color: var(--wa-meta); transition: color 0.3s ease; }
.w2a-wa__ticks.is-read { color: var(--wa-tick); }

@keyframes w2aWaMsgIn {
	from { opacity: 0; transform: translateY(8px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Typing indicator ──────────────────────────────────────────────── */

.w2a-wa__typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 10px;
	padding: 12px 14px;
	border-radius: var(--wa-bubble-radius);
	border-top-left-radius: 0;
	background: var(--wa-in-bg);
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
}

.w2a-wa__typing[hidden] { display: none; }

.w2a-wa__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wa-meta);
	animation: w2aWaTyping 1.3s ease-in-out infinite;
}

.w2a-wa__typing span:nth-child(2) { animation-delay: 0.18s; }
.w2a-wa__typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes w2aWaTyping {
	0%, 60%, 100% { transform: translateY(0);    opacity: 0.45; }
	30%           { transform: translateY(-4px); opacity: 1; }
}

/* ── Quick queries ─────────────────────────────────────────────────── */

.w2a-wa__queries {
	animation: w2aWaMsgIn 0.36s var(--wa-ease) both;
	animation-delay: 0.06s;
}

.w2a-wa__queries[hidden] { display: none; }

.w2a-wa__group + .w2a-wa__group { margin-top: 14px; }

.w2a-wa__group-label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--wa-label);
}

.w2a-wa__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.w2a-wa__chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	max-width: 100%;
	padding: 8px 13px;
	border: 1px solid var(--wa-chip-border);
	border-radius: 999px;
	background: var(--wa-chip-bg);
	color: var(--wa-chip-fg);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(11, 20, 26, 0.07);
	transition: transform 0.2s var(--wa-ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.w2a-wa__chip .uil {
	flex: none;
	font-size: 16px;
	line-height: 1;
	color: var(--wa-teal-2);
	transition: color 0.2s ease;
}

.w2a-wa__chip span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.w2a-wa__chip:hover {
	transform: translateY(-2px);
	background: var(--wa-chip-hover);
	border-color: var(--wa-green);
	box-shadow: 0 6px 16px rgba(37, 211, 102, 0.22);
}

.w2a-wa__chip:hover .uil { color: var(--wa-green-dark); }

.w2a-wa__chip:active { transform: translateY(0); }

.w2a-wa__chip:focus-visible {
	outline: 2px solid var(--wa-green);
	outline-offset: 2px;
}

/* A chip that has just been used, while WhatsApp is opening. */
.w2a-wa__chip.is-sent {
	background: var(--wa-green);
	border-color: var(--wa-green);
	color: #fff;
	pointer-events: none;
}

.w2a-wa__chip.is-sent .uil { color: #fff; }

.w2a-wa__hours {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 16px 0 0;
	font-size: 11.5px;
	color: var(--wa-label);
}

.w2a-wa__hours .uil { font-size: 14px; line-height: 1; }

/* ── Footer / composer ─────────────────────────────────────────────── */

.w2a-wa__footer {
	flex: none;
	padding: 10px 12px 9px;
	background: var(--wa-footer-bg);
	border-top: 1px solid var(--wa-divider);
}

.w2a-wa__composer {
	display: flex;
	align-items: center;
	gap: 8px;
}

.w2a-wa__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 21px;
	background: var(--wa-input-bg);
	color: var(--wa-input-fg);
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.w2a-wa__input::placeholder { color: var(--wa-meta); }

.w2a-wa__input:focus {
	outline: none;
	border-color: var(--wa-green);
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}

.w2a-wa__send {
	flex: none;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(145deg, #2ee06f 0%, var(--wa-green) 50%, var(--wa-green-dark) 100%);
	color: #fff;
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(37, 211, 102, 0.36);
	transition: transform 0.2s var(--wa-ease), box-shadow 0.2s ease, opacity 0.2s ease;
}

.w2a-wa__send:hover { transform: scale(1.07); box-shadow: 0 5px 16px rgba(37, 211, 102, 0.46); }
.w2a-wa__send:active { transform: scale(0.96); }
.w2a-wa__send:focus-visible { outline: 2px solid var(--wa-teal-2); outline-offset: 2px; }
.w2a-wa__send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.w2a-wa__legal {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin: 8px 0 0;
	font-size: 10.5px;
	color: var(--wa-meta);
}

.w2a-wa__legal .uil { font-size: 12px; line-height: 1; }

/* ═══ Mobile — full-height sheet ═══════════════════════════════════════ */

@media (max-width: 575.98px) {
	.w2a-wa {
		--wa-gap: 14px;
		--wa-fab: 56px;
		bottom: calc(var(--wa-gap) + env(safe-area-inset-bottom, 0px));
	}

	.w2a-wa--right { right: var(--wa-gap); }
	.w2a-wa--left  { left: var(--wa-gap); }

	.w2a-wa__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: 100%;
		max-height: 100%;
		border-radius: 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		animation-name: w2aWaSheetIn;
	}

	.w2a-wa__header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }

	.w2a-wa__teaser { max-width: min(254px, calc(100vw - 2 * var(--wa-gap))); }

	/* The launcher stays reachable behind the sheet but must not overlay it. */
	.w2a-wa.is-open .w2a-wa__fab { display: none; }

	.w2a-wa__msg { max-width: 92%; }
}

@keyframes w2aWaSheetIn {
	from { opacity: 0; transform: translateY(26px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Short viewports (landscape phones): keep the panel inside the screen. */
@media (max-height: 560px) and (min-width: 576px) {
	.w2a-wa__panel { max-height: calc(100vh - 2 * var(--wa-gap)); }
}

/* ═══ Accessibility ════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	.w2a-wa *,
	.w2a-wa *::before,
	.w2a-wa *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.w2a-wa__fab-ring { display: none; }
	.w2a-wa__fab:hover { transform: none; }
	.w2a-wa__chip:hover { transform: none; }
}

@media (prefers-contrast: more) {
	.w2a-wa__chip { border-width: 2px; border-color: var(--wa-teal); }
	.w2a-wa__msg  { box-shadow: 0 0 0 1px var(--wa-divider); }
}

/* ═══ Collision avoidance ══════════════════════════════════════════════
   The only rule in this file that reaches outside the .w2a-wa namespace.
   page/error.php's floating "back to home" button is pinned to the same
   bottom-right corner (bottom:10px in style-green.css) and would sit under
   the launcher, so lift it clear. This stylesheet loads only when the
   widget is enabled, so the offset can never outlive the thing it dodges.
   The button is .d-none below the sm breakpoint, so no mobile case here. */
.back-to-home {
	bottom: calc(var(--wa-fab, 60px) + 34px);
}

/* Never print the floating chat. */
@media print {
	.w2a-wa { display: none !important; }
}
