/* Clinolhos WhatsApp - bubble + chat de captura de leads */

:root {
	--clinolhos-wa-color: #25d366;
}

/* ---------- Bubble ---------- */

.clinolhos-wa-bubble {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--clinolhos-wa-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .2s ease, box-shadow .2s ease;
}

.clinolhos-wa-bubble:hover {
	transform: translateY(-2px) scale(1.05);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
	color: #fff;
	background: var(--clinolhos-wa-color);
}

.clinolhos-wa-bubble:focus-visible {
	outline: 3px solid #123c68;
	outline-offset: 3px;
}

.clinolhos-wa-bubble svg {
	width: 32px;
	height: 32px;
	display: block;
}

/* ---------- Janela do chat ---------- */

.clinolhos-wa-chat {
	position: fixed;
	right: 24px;
	bottom: 96px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 48px);
	max-height: min(560px, calc(100vh - 130px));
	overflow: hidden;
	border-radius: 16px;
	background: #efeae2;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

.clinolhos-wa-chat[hidden] {
	display: none;
}

/* Header */

.clinolhos-wa-chat__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--clinolhos-wa-color);
	color: #fff;
}

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

.clinolhos-wa-chat__avatar svg {
	width: 24px;
	height: 24px;
}

.clinolhos-wa-chat__titles {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.clinolhos-wa-chat__name {
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.clinolhos-wa-chat__subtitle {
	font-size: 12px;
	opacity: .85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.clinolhos-wa-chat__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
}

.clinolhos-wa-chat__close:hover {
	background: rgba(255, 255, 255, .15);
}

.clinolhos-wa-chat__close svg {
	width: 18px;
	height: 18px;
}

/* Mensagens */

.clinolhos-wa-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 220px;
}

.clinolhos-wa-msg {
	max-width: 82%;
	padding: 8px 12px;
	border-radius: 10px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
	word-wrap: break-word;
	overflow-wrap: break-word;
	white-space: pre-line;
	margin: 0;
}

.clinolhos-wa-msg--bot {
	align-self: flex-start;
	background: #fff;
	color: #111;
	border-top-left-radius: 2px;
}

.clinolhos-wa-msg--user {
	align-self: flex-end;
	background: #d9fdd3;
	color: #111;
	border-top-right-radius: 2px;
}

.clinolhos-wa-msg--error {
	background: #fff2f0;
	color: #8a1f11;
}

/* Indicador de digitacao */

.clinolhos-wa-typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	border-radius: 10px;
	border-top-left-radius: 2px;
	background: #fff;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}

.clinolhos-wa-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa0a6;
	animation: clinolhos-wa-blink 1.2s infinite ease-in-out;
}

.clinolhos-wa-typing span:nth-child(2) { animation-delay: .2s; }
.clinolhos-wa-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes clinolhos-wa-blink {
	0%, 80%, 100% { opacity: .3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* Botoes de motivo (quick replies) */

.clinolhos-wa-reasons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-self: flex-start;
	max-width: 95%;
}

.clinolhos-wa-reasons button {
	padding: 8px 14px;
	border: 1px solid var(--clinolhos-wa-color);
	border-radius: 999px;
	background: #fff;
	color: #075e54;
	font-size: 14px;
	font-family: inherit;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.clinolhos-wa-reasons button:hover,
.clinolhos-wa-reasons button:focus-visible {
	background: var(--clinolhos-wa-color);
	color: #fff;
}

.clinolhos-wa-reasons button:disabled {
	opacity: .5;
	cursor: default;
}

/* Formulario de entrada */

.clinolhos-wa-chat__form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #f0f2f5;
	margin: 0;
}

.clinolhos-wa-chat__input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid #d1d7db;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-size: 15px;
	font-family: inherit;
	line-height: 1.3;
}

.clinolhos-wa-chat__input:focus {
	outline: 2px solid var(--clinolhos-wa-color);
	outline-offset: -1px;
	border-color: var(--clinolhos-wa-color);
}

.clinolhos-wa-chat__input:disabled {
	background: #f0f2f5;
	cursor: not-allowed;
}

.clinolhos-wa-chat__send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--clinolhos-wa-color);
	color: #fff;
	cursor: pointer;
	flex-shrink: 0;
}

.clinolhos-wa-chat__send:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.clinolhos-wa-chat__send svg {
	width: 20px;
	height: 20px;
}

/* Rodape */

.clinolhos-wa-chat__footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 7px 12px;
	background: #f0f2f5;
	border-top: 1px solid #e4e6e9;
	color: #667781;
	font-size: 12px;
}

.clinolhos-wa-chat__footer svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

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

@media (max-width: 600px) {
	.clinolhos-wa-bubble {
		right: 16px;
		bottom: 16px;
	}

	.clinolhos-wa-chat {
		right: 12px;
		left: 12px;
		bottom: 88px;
		width: auto;
		max-width: none;
		max-height: calc(100vh - 110px);
		max-height: calc(100dvh - 110px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.clinolhos-wa-bubble,
	.clinolhos-wa-reasons button {
		transition: none;
	}

	.clinolhos-wa-typing span {
		animation: none;
	}
}
