/* Website Chat Assistant 2.0.3 - theme: primary #BC0202, secondary #FB1E18, white background. */

#wca-chat-root {
	--wca-primary: #BC0202;
	--wca-secondary: #FB1E18;
	--wca-text: #1d1d1d;
	--wca-line: #f1dede;
	--wca-soft: #fbf6f6;
	--wca-bot: #f5f5f5;

	position: fixed;
	right: 24px;
	bottom: 104px;
	z-index: 999998;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--wca-text);
	line-height: 1.4;
}

#wca-chat-root,
#wca-chat-root * {
	box-sizing: border-box;
}

#wca-chat-root button,
#wca-chat-root input {
	font-family: inherit;
}

#wca-chat-root button:focus-visible,
#wca-chat-root input:focus-visible,
#wca-chat-root [role="button"]:focus-visible {
	outline: 3px solid rgba(251, 30, 24, 0.45);
	outline-offset: 2px;
}

/* ---------- Launcher ---------- */

.wca-bubble {
	position: relative;
	width: 60px;
	height: 60px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--wca-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(188, 2, 2, 0.35);
	transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.wca-bubble:hover {
	transform: scale(1.05);
	background: var(--wca-secondary);
}

/* ---------- Greeting beside the launcher ---------- */

.wca-greeting {
	position: absolute;
	right: 74px;
	bottom: 16px;
	padding: 9px 14px;
	background: #fff;
	color: var(--wca-text);
	border: 1px solid var(--wca-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	opacity: 1;
	transform: translateX(0);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.wca-greeting::after {
	content: "";
	position: absolute;
	right: -6px;
	top: 50%;
	width: 10px;
	height: 10px;
	margin-top: -5px;
	background: #fff;
	border-top: 1px solid var(--wca-line);
	border-right: 1px solid var(--wca-line);
	transform: rotate(45deg);
}

.wca-is-open .wca-greeting {
	opacity: 0;
	transform: translateX(8px);
	pointer-events: none;
}

/* ---------- Chat window ---------- */

.wca-window {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	background: #fff;
	border: 1px solid var(--wca-line);
	border-radius: 18px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.wca-window.wca-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	pointer-events: auto;
}

/* ---------- Header ---------- */

.wca-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--wca-primary);
	color: #fff;
}

.wca-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.wca-avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wca-titles {
	min-width: 0;
}

.wca-header-title {
	font-size: 16px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wca-header-sub {
	margin-top: 2px;
	font-size: 12px;
	opacity: 0.85;
}

.wca-close {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.wca-close:hover {
	background: rgba(255, 255, 255, 0.16);
}

/* ---------- Messages ---------- */

.wca-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fff;
}

.wca-msg {
	max-width: 86%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

.wca-msg-text {
	margin: 0;
}

.wca-msg-bot {
	align-self: flex-start;
	background: var(--wca-bot);
	border: 1px solid #ececec;
	color: var(--wca-text);
	border-bottom-left-radius: 4px;
}

.wca-msg-user {
	align-self: flex-end;
	background: var(--wca-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.wca-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 10px;
}

.wca-link {
	display: block;
	color: var(--wca-primary);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.wca-link:hover {
	color: var(--wca-secondary);
}

.wca-typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--wca-bot);
	border: 1px solid #ececec;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.wca-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wca-secondary);
	animation: wca-blink 1.2s infinite ease-in-out;
}

.wca-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.wca-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes wca-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* ---------- Service quick buttons (above the input) ---------- */

.wca-quick {
	flex-shrink: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 10px 12px 12px;
	background: var(--wca-soft);
	border-top: 1px solid var(--wca-line);
}

.wca-quick-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	margin: 0;
	padding: 5px 8px;
	background: #fff;
	border: 1px solid var(--wca-line);
	border-radius: 8px;
	color: var(--wca-text);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wca-quick-btn:hover {
	border-color: var(--wca-secondary);
	box-shadow: 0 3px 10px rgba(188, 2, 2, 0.12);
	transform: translateY(-1px);
}

.wca-quick-icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: rgba(188, 2, 2, 0.08);
	color: var(--wca-primary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wca-quick-label {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Input ---------- */

.wca-input-row {
	flex-shrink: 0;
	margin: 0;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border-top: 1px solid var(--wca-line);
}

.wca-input {
	flex: 1;
	min-width: 0;
	height: 42px;
	padding: 0 16px;
	border: 1px solid #dcdcdc;
	border-radius: 999px;
	background: #fff;
	color: var(--wca-text);
	font-size: 16px; /* 16px prevents iOS zoom on focus */
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wca-input:focus {
	border-color: var(--wca-primary);
	box-shadow: 0 0 0 3px rgba(188, 2, 2, 0.12);
}

.wca-send {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--wca-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.wca-send:hover {
	background: var(--wca-secondary);
}

.wca-send:disabled {
	opacity: 0.55;
	cursor: default;
}

/* ---------- Host theme overrides ----------
   Many WordPress themes restyle buttons, links and inputs (pink fills,
   pink text, outlines). These rules keep the widget in its own neutral
   and brand colours regardless of the theme. */

#wca-chat-root .wca-quick-btn,
#wca-chat-root .wca-quick-btn:focus {
	background-color: #fff !important;
	color: #1d1d1d !important;
	border: 1px solid #f1dede !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

#wca-chat-root .wca-quick-btn:hover {
	background-color: #fffafa !important;
	color: #1d1d1d !important;
	border: 1px solid #FB1E18 !important;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
	text-shadow: none !important;
}

#wca-chat-root .wca-quick-label {
	color: #1d1d1d !important;
	background: transparent !important;
}

#wca-chat-root .wca-quick-icon {
	background: #fbeaea !important;
	color: #BC0202 !important;
}

#wca-chat-root .wca-close,
#wca-chat-root .wca-close:focus {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: #fff !important;
}

#wca-chat-root .wca-close:hover {
	background: rgba(255, 255, 255, 0.16) !important;
	border: none !important;
	color: #fff !important;
}

#wca-chat-root .wca-send,
#wca-chat-root .wca-send:focus {
	background: #BC0202 !important;
	border: none !important;
	box-shadow: none !important;
	color: #fff !important;
}

#wca-chat-root .wca-send:hover {
	background: #FB1E18 !important;
	color: #fff !important;
}

#wca-chat-root .wca-send:disabled {
	opacity: 0.55 !important;
}

#wca-chat-root .wca-input,
#wca-chat-root .wca-input:focus {
	color: #1d1d1d !important;
	background: #fff !important;
	box-shadow: none !important;
	border: 1px solid #cfcfcf !important;
}

#wca-chat-root .wca-input:focus {
	border-color: #6b6b6b !important;
}

#wca-chat-root .wca-msg-user {
	background: #BC0202 !important;
	color: #fff !important;
}

#wca-chat-root .wca-link,
#wca-chat-root .wca-link:visited {
	color: #BC0202 !important;
	text-shadow: none !important;
}

#wca-chat-root .wca-link:hover {
	color: #FB1E18 !important;
}

#wca-chat-root .wca-bubble,
#wca-chat-root .wca-bubble:focus,
#wca-chat-root .wca-bubble:hover {
	border: none !important;
	background: #BC0202 !important;
	background-image: none !important;
	border-radius: 50% !important;
	width: 60px !important;
	height: 60px !important;
	opacity: 1 !important;
	filter: none !important;
	box-shadow: 0 8px 22px rgba(188, 2, 2, 0.35) !important;
	color: #fff !important;
}

#wca-chat-root .wca-bubble:hover {
	background: #FB1E18 !important;
}

/* ---------- Greeting with robot avatar ---------- */

#wca-chat-root .wca-greeting {
	display: flex !important;
	align-items: center;
	gap: 9px;
	padding: 5px 16px 5px 5px !important;
	background: #fff !important;
	color: #1d1d1d !important;
	border: 1px solid #f1dede !important;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12) !important;
}

#wca-chat-root .wca-greeting-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(135deg, #BC0202 0%, #FB1E18 100%) !important;
	color: #fff !important;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 8px rgba(188, 2, 2, 0.3);
}

#wca-chat-root .wca-greeting-text {
	color: #1d1d1d !important;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

#wca-chat-root .wca-greeting::after {
	background: #fff !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	#wca-chat-root {
		right: 14px;
		bottom: 96px;
	}

	.wca-window {
		width: calc(100vw - 28px);
		bottom: 74px;
	}

	.wca-greeting {
		right: 70px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#wca-chat-root *,
	#wca-chat-root *::before,
	#wca-chat-root *::after {
		transition: none !important;
		animation: none !important;
	}
}
