/* Chat Suite for WhatsApp — frontend styles */
.wacs-widget {
	--wacs-color: #25d366;
	--wacs-text: #ffffff;
	--wacs-offset-bottom: 20px;
	--wacs-offset-side: 20px;
	position: fixed;
	bottom: var(--wacs-offset-bottom);
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
.wacs-widget--right { right: var(--wacs-offset-side); }
.wacs-widget--left { left: var(--wacs-offset-side); }
.wacs-widget *,
.wacs-widget *::before,
.wacs-widget *::after { box-sizing: border-box; }

.wacs-icon { display: block; width: 24px; height: 24px; }
.wacs-icon--close { width: 20px; height: 20px; }

/* Floating launcher */
.wacs-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 60px;
	min-width: 60px;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--wacs-color);
	color: var(--wacs-text);
	cursor: pointer;
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font: inherit;
	font-weight: 600;
}
.wacs-toggle:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(15, 23, 42, 0.32); }
.wacs-toggle:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.45); outline-offset: 3px; }
.wacs-toggle__glyph,
.wacs-toggle__close-glyph { display: inline-flex; flex: 0 0 auto; }
.wacs-toggle__close-glyph { display: none; }
.wacs-widget.is-active .wacs-toggle__glyph { display: none; }
.wacs-widget.is-active .wacs-toggle__close-glyph { display: inline-flex; }
.wacs-toggle__label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Greeting bubble */
.wacs-greeting {
	position: absolute;
	bottom: calc(100% + 12px);
	width: 260px;
	max-width: calc(100vw - 40px);
	padding: 14px 34px 14px 16px;
	background: #ffffff;
	color: #1f2937;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
	font-size: 14px;
}
.wacs-widget--right .wacs-greeting { right: 0; }
.wacs-widget--left .wacs-greeting { left: 0; }
.wacs-greeting::after {
	content: "";
	position: absolute;
	bottom: -6px;
	width: 12px;
	height: 12px;
	background: inherit;
	transform: rotate(45deg);
}
.wacs-widget--right .wacs-greeting::after { right: 26px; }
.wacs-widget--left .wacs-greeting::after { left: 26px; }
.wacs-greeting[hidden] { display: none; }
.wacs-widget.is-active .wacs-greeting { display: none; }
.wacs-greeting p { margin: 0; }
.wacs-greeting__text {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.45;
	text-align: left;
	cursor: pointer;
}
.wacs-greeting__text:hover { text-decoration: underline; }
.wacs-greeting__text:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.wacs-greeting__close {
	position: absolute;
	top: 6px;
	right: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
}
.wacs-greeting__close:hover { background: rgba(15, 23, 42, 0.08); color: #111827; }

/* Chat panel */
.wacs-panel {
	position: absolute;
	bottom: calc(100% + 14px);
	display: flex;
	flex-direction: column;
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: min(720px, calc(100vh - 80px));
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.wacs-widget--left .wacs-panel { transform-origin: bottom left; }
.wacs-widget--right .wacs-panel { right: 0; }
.wacs-widget--left .wacs-panel { left: 0; }
.wacs-widget.is-active .wacs-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}
.wacs-panel__header {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px 12px;
	background: var(--wacs-color);
	color: var(--wacs-text);
}
.wacs-panel__header::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.22), transparent 60%);
	pointer-events: none;
}
.wacs-panel__intro { position: relative; display: flex; flex-direction: column; gap: 3px; z-index: 1; }
.wacs-panel__title { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.wacs-panel__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.92; }
.wacs-panel__status .wacs-dot {
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.wacs-widget.is-closed .wacs-panel__status .wacs-dot { background: #fde68a; box-shadow: 0 0 0 3px rgba(253, 230, 138, 0.28); }
.wacs-close {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: var(--wacs-text);
	cursor: pointer;
}
.wacs-close:hover { background: rgba(255, 255, 255, 0.3); }
.wacs-panel__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* Agent list */
.wacs-agents { list-style: none; margin: 0; padding: 8px; }
.wacs-agents__item { margin: 0; padding: 0; }
.wacs-agent {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.wacs-agent:hover,
.wacs-agent:focus-visible { background: rgba(37, 211, 102, 0.12); }
.wacs-agent:focus-visible { outline: 2px solid var(--wacs-color); outline-offset: -2px; }
.wacs-agent__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wacs-color);
	color: var(--wacs-text);
	font-weight: 700;
	font-size: 16px;
}
.wacs-agent__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wacs-agent__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wacs-agent__name {
	color: #111827;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wacs-agent__title {
	color: #6b7280;
	font-size: 12.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wacs-agent__go { display: inline-flex; flex: 0 0 auto; color: var(--wacs-color); opacity: 0.85; }
.wacs-agent--away { opacity: 0.72; }

/* Offline block */
.wacs-offline { padding: 16px 18px 20px; border-top: 1px solid #f1f5f9; }
.wacs-offline__message { color: #374151; font-size: 14px; }
.wacs-offline__message p { margin: 0 0 10px; }
.wacs-offline__message p:last-child { margin-bottom: 0; }
.wacs-offline__next { margin: 10px 0 0; font-size: 13px; color: #6b7280; }
.wacs-offline .wacs-button { margin-top: 14px; }
.wacs-panel__footer {
	padding: 7px 16px;
	background: #f8fafc;
	border-top: 1px solid #eef2f7;
	color: #94a3b8;
	font-size: 11px;
	text-align: center;
}

/* Standalone / shortcode buttons */
.wacs-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: #25d366;
	color: #ffffff;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.wacs-button:hover { transform: translateY(-1px); color: #ffffff; box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2); }
.wacs-button:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.4); outline-offset: 3px; }
.wacs-button .wacs-icon { width: 20px; height: 20px; }
.wacs-button--link { background: transparent; color: #128c7e; box-shadow: none; padding: 4px 2px; }
.wacs-button--link:hover { color: #0b6b60; box-shadow: none; text-decoration: underline; }
.wacs-button--outline { background: transparent; color: #128c7e; border: 2px solid currentColor; box-shadow: none; }
.wacs-button--outline:hover { background: rgba(37, 211, 102, 0.08); color: #0b6b60; }
.wacs-button--float {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	border-radius: 999px;
	padding: 16px;
	box-shadow: 0 14px 34px rgba(15, 23, 42, 0.3);
}
.wacs-button--float .wacs-button__text { display: none; }

/* Embedded agent lists */
.wacs-embed { margin: 1.25em 0; }
.wacs-embed__title { margin: 0 0 12px; font-weight: 700; }
.wacs-embed .wacs-agents { padding: 0; }
.wacs-agents--cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}
.wacs-agents--cards .wacs-agent {
	border: 1px solid #e5e7eb;
	background: #ffffff;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.wacs-agents--list { display: flex; flex-direction: column; gap: 6px; }
.wacs-agents--list .wacs-agent { border-bottom: 1px solid #f1f5f9; border-radius: 0; }
.wacs-agents--list .wacs-agents__item:last-child .wacs-agent { border-bottom: 0; }
.wacs-agents--inline { display: flex; flex-wrap: wrap; gap: 8px; }
.wacs-agents--inline .wacs-agent {
	padding: 6px 14px 6px 6px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #ffffff;
}
.wacs-agents--inline .wacs-agent__avatar { flex-basis: 30px; width: 30px; height: 30px; font-size: 12px; }
.wacs-agents--inline .wacs-agent__title,
.wacs-agents--inline .wacs-agent__go { display: none; }
.wacs-agents--inline .wacs-agent__name { font-size: 14px; }

/* Status line */
.wacs-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #047857;
}
.wacs-status--closed { color: #b45309; }
.wacs-dot {
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.wacs-status--closed .wacs-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }

/* WooCommerce */
.wacs-woo { margin: 14px 0; }
.wacs-woo--product { clear: both; }
.wacs-woo .wacs-button { text-transform: none; }

@media (max-width: 480px) {
	.wacs-toggle { height: 56px; min-width: 56px; padding: 0 16px; }
	.wacs-panel { position: fixed; left: 8px; right: 8px; bottom: 84px; width: auto; max-width: none; max-height: calc(100vh - 100px); border-radius: 16px 16px 12px 12px; }
	.wacs-widget--left .wacs-panel { left: 8px; right: 8px; }
	.wacs-widget--right .wacs-panel { left: 8px; right: 8px; }
	.wacs-toggle__label { max-width: 120px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.wacs-toggle,
	.wacs-panel,
	.wacs-button { transition: none; }
}

@media (prefers-color-scheme: dark) {
	.wacs-panel { background: #111827; color: #e5e7eb; }
	.wacs-panel__footer { background: #0b1220; border-top-color: #1f2937; color: #94a3b8; }
	.wacs-agent__name { color: #f9fafb; }
	.wacs-agent__title { color: #9ca3af; }
	.wacs-agent:hover,
	.wacs-agent:focus-visible { background: rgba(255, 255, 255, 0.07); }
	.wacs-offline { border-top-color: #1f2937; }
	.wacs-offline__message { color: #d1d5db; }
	.wacs-offline__next { color: #9ca3af; }
	.wacs-greeting { background: #111827; color: #e5e7eb; }
	.wacs-greeting__close { color: #9ca3af; }
	.wacs-greeting__close:hover { background: rgba(255, 255, 255, 0.1); color: #f9fafb; }
	.wacs-agents--cards .wacs-agent,
	.wacs-agents--inline .wacs-agent { background: #111827; border-color: #1f2937; }
	.wacs-agents--list .wacs-agent { border-bottom-color: #1f2937; }
	.wacs-prechat__intro { color: #9ca3af; }
	.wacs-prechat__label { color: #e5e7eb; }
	.wacs-prechat__field input,
	.wacs-prechat__field select,
	.wacs-prechat__field textarea { background: #0b1220; border-color: #374151; color: #f9fafb; }
	.wacs-prechat__consent { color: #9ca3af; }
	.wacs-prechat__agent { background: rgba(37, 211, 102, 0.14); }
	.wacs-prechat__agent-name { color: #f9fafb; }
}

/* Pre-chat form */
.wacs-prechat-wrap { padding: 12px 16px; }
.wacs-prechat__intro { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: #4b5563; }
.wacs-prechat__field { display: flex; flex-direction: column; gap: 3px; margin: 0 0 7px; }
.wacs-prechat__label { font-size: 12px; font-weight: 600; color: #374151; }
.wacs-prechat__field input,
.wacs-prechat__field select,
.wacs-prechat__field textarea {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #ffffff;
	color: #111827;
	font: inherit;
	font-size: 14px;
	line-height: 1.35;
	box-shadow: none;
}
.wacs-prechat__field textarea { min-height: 50px; resize: vertical; }
.wacs-prechat__field input:focus,
.wacs-prechat__field select:focus,
.wacs-prechat__field textarea:focus { outline: 2px solid var(--wacs-color); outline-offset: 1px; border-color: var(--wacs-color); }
.wacs-prechat__field input[aria-invalid="true"],
.wacs-prechat__field select[aria-invalid="true"],
.wacs-prechat__field textarea[aria-invalid="true"],
.wacs-prechat__consent input[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15); }
.wacs-required { color: #dc2626; margin-left: 2px; }
.wacs-prechat__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 2px 0 7px;
	font-size: 12px;
	line-height: 1.4;
	color: #4b5563;
}
.wacs-prechat__consent input { margin: 2px 0 0; flex: 0 0 auto; }
.wacs-prechat__consent a { color: #0f766e; text-decoration: underline; }
.wacs-prechat__error {
	margin: 0 0 8px;
	padding: 7px 9px;
	border: 1px solid #fecaca;
	border-radius: 8px;
	background: #fef2f2;
	color: #991b1b;
	font-size: 12px;
	line-height: 1.4;
}
.wacs-prechat__error[hidden] { display: none; }
.wacs-prechat__submit { width: 100%; padding: 9px 14px; font-size: 14px; }
.wacs-prechat__agent {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	margin: 0 0 8px;
	border-radius: 9px;
	background: rgba(37, 211, 102, 0.1);
}
.wacs-prechat__agent .wacs-agent__avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 12px; }
.wacs-prechat__agent-name { font-size: 13.5px; font-weight: 600; color: #111827; overflow-wrap: anywhere; }
.wacs-prechat__hint { margin: -2px 0 7px; font-size: 11px; line-height: 1.4; color: #6b7280; }
.wacs-prechat__optional { margin: 0 0 8px; padding: 0 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
.wacs-prechat__optional summary { padding: 7px 0; cursor: pointer; font-size: 12px; font-weight: 600; color: #374151; }
.wacs-prechat__optional[open] summary { padding-bottom: 6px; }
.wacs-prechat__optional .wacs-prechat__field:last-child { margin-bottom: 8px; }
.wacs-prechat__agent-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wacs-prechat__agent-meta { font-size: 11px; line-height: 1.35; color: #6b7280; overflow-wrap: anywhere; }
.wacs-prechat__agent-meta[hidden] { display: none; }
.wacs-prechat__agent-state { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; white-space: nowrap; font-size: 11px; font-weight: 600; color: #0f766e; }
.wacs-prechat__agent-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; flex: 0 0 6px; }
.wacs-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

@media (prefers-color-scheme: dark) {
	.wacs-prechat__intro { color: #9ca3af; }
	.wacs-prechat__label { color: #e5e7eb; }
	.wacs-prechat__field input,
	.wacs-prechat__field select,
	.wacs-prechat__field textarea { background: #0b1220; border-color: #374151; color: #f9fafb; }
	.wacs-prechat__consent { color: #9ca3af; }
	.wacs-prechat__agent { background: rgba(37, 211, 102, 0.14); }
	.wacs-prechat__agent-name { color: #f9fafb; }
	.wacs-prechat__hint { color: #9ca3af; }
	.wacs-prechat__agent-meta { color: #9ca3af; }
	.wacs-prechat__agent-state { color: #6ee7b7; }
	.wacs-prechat__optional { border-color: #374151; }
	.wacs-prechat__optional summary { color: #e5e7eb; }
	.wacs-prechat__error { background: #3f1d1d; border-color: #7f1d1d; color: #fecaca; }
}



