/* Chavexo — chat de busca com IA (Márcio), variação A "chat refinado" (Ronnie, 12/11/2026).
   Marca igual à home nova: preto #1a1a1a, dourado #d4af37 / #b68235, Cormorant Garamond + Montserrat, cantos retos.
   Mobile first: até 480px a janela ocupa a tela; de 481px em diante flutua no canto esquerdo (400px).
   Seletores sempre com o prefixo .chx para vencer o CSS do tema (MyHome) sem !important.
   Prefixo chx- (não chv-) e sem os ids antigos (#chavexo-fab/#chavexo-win) de propósito: o UCSS do
   LiteSpeed guardado das páginas traz as regras da v2.1 por id/classe e elas venceriam estas. */

.chx {
	--chx-ink: #1a1a1a;
	--chx-ink2: #1f1e1c;
	--chx-gold: #d4af37;
	--chx-gold-d: #b68235;
	--chx-gold-t: #8a6a1e;
	--chx-paper: #faf9f7;
	--chx-line: #e4e1dc;
	--chx-line2: #efece8;
	--chx-muted: #6b6660;
	--chx-sans: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--chx-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

/* ===== Botão flutuante: só o ícone (48×48, igual ao "voltar ao topo" da home nova) ===== */
.chx .chx-fab {
	position: fixed;
	left: 16px;
	bottom: 80px;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--chx-gold);
	border-radius: 0;
	background: var(--chx-ink);
	color: var(--chx-gold);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.chx .chx-fab svg {
	display: block;
	width: 22px;
	height: 22px;
}
.chx .chx-fab:focus-visible {
	outline: 2px solid var(--chx-gold);
	outline-offset: 3px;
}
.chx .chx-fab[hidden] {
	display: none;
}

/* ===== Janela ===== */
.chx .chx-win {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background: var(--chx-paper);
	color: var(--chx-ink2);
	font-family: var(--chx-sans);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
	text-align: left;
	animation: chx-entra .28s cubic-bezier(.16, 1, .3, 1);
}
.chx .chx-win[hidden] {
	display: none;
}
.chx .chx-win:focus {
	outline: none;
}
.chx .chx-win *,
.chx .chx-win *::before,
.chx .chx-win *::after {
	box-sizing: border-box;
}
@keyframes chx-entra {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

/* Cabeçalho preto com filete dourado */
.chx .chx-head {
	display: flex;
	flex: none;
	align-items: center;
	gap: 12px;
	padding: 10px 6px 10px 16px;
	padding-top: max(10px, env(safe-area-inset-top));
	background: var(--chx-ink);
	color: #fff;
	border-bottom: 2px solid var(--chx-gold);
}
.chx .chx-ava {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--chx-gold);
	color: var(--chx-gold);
	font-family: var(--chx-serif);
	font-size: 24px;
	font-weight: 500;
	line-height: 1;
}
.chx .chx-name {
	margin: 0;
	padding: 0;
	font-family: var(--chx-serif);
	font-size: 23px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}
.chx .chx-sub {
	margin-top: 4px;
	font-size: 11px;
	line-height: 1.3;
	letter-spacing: .06em;
	color: #c9c3b8;
}
.chx .chx-x {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0 0 0 auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #e8e4dc;
	cursor: pointer;
}
.chx .chx-x svg {
	display: block;
	width: 20px;
	height: 20px;
}
.chx .chx-x:focus-visible {
	outline: 2px solid var(--chx-gold);
	outline-offset: -4px;
}

/* Conversa */
.chx .chx-msgs {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 16px;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 20px 16px 12px;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
.chx .chx-msgs > * {
	flex: none;
}
.chx .chx-ai {
	padding-left: 14px;
	border-left: 2px solid var(--chx-gold);
	font-size: 14.5px;
	line-height: 1.65;
	color: var(--chx-ink2);
	overflow-wrap: anywhere;
}
.chx .chx-ai p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}
.chx .chx-ai p + p {
	margin-top: 8px;
}
.chx .chx-who {
	display: block;
	margin-bottom: 2px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--chx-gold-t);
}
.chx .chx-u {
	align-self: flex-end;
	max-width: 85%;
	padding: 10px 14px;
	background: var(--chx-ink2);
	color: #fff;
	font-size: 14.5px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

/* "Digitando": 3 quadrados dourados */
.chx .chx-typing {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13.5px;
	color: #4a4742;
}
.chx .chx-dots {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}
.chx .chx-dots i {
	display: block;
	width: 6px;
	height: 6px;
	background: var(--chx-gold);
	animation: chx-dots 1.1s ease-in-out infinite;
}
.chx .chx-dots i:nth-child(2) { animation-delay: .15s; }
.chx .chx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chx-dots {
	0%, 100% { opacity: .25; transform: translateY(0); }
	50% { opacity: 1; transform: translateY(-3px); }
}

/* Carrossel de cards */
.chx .chx-car {
	display: flex;
	gap: 12px;
	margin: 0 -16px;
	padding: 2px 16px 6px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-padding: 0 16px;
	scrollbar-width: none;
}
.chx .chx-car::-webkit-scrollbar {
	display: none;
}
.chx .chx-carinfo {
	display: flex;
	justify-content: space-between;
	margin-top: -8px;
	font-size: 11.5px;
	color: var(--chx-muted);
}

/* Card de imóvel — padrão do card da listagem (hc-card da home nova), versão compacta */
.chx .chx-card {
	display: flex;
	flex: none;
	flex-direction: column;
	width: 262px;
	max-width: calc(100% - 32px);
	min-width: 0;
	scroll-snap-align: start;
	background: #fff;
	border: 1px solid var(--chx-line);
	color: var(--chx-ink2);
	text-align: left;
	text-decoration: none;
	transition: border-color .15s, box-shadow .15s;
}
.chx .chx-car--1 .chx-card {
	width: 100%;
	max-width: 100%;
}
.chx .chx-card:focus-visible {
	outline: 2px solid var(--chx-gold-d);
	outline-offset: 2px;
}
.chx .chx-card-media {
	position: relative;
	background: #ddd;
}
.chx .chx-card-media img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	margin: 0;
	border: 0;
}
.chx .chx-card-bairro {
	position: absolute;
	left: 10px;
	bottom: 10px;
	padding: 5px 8px;
	background: rgba(255, 255, 255, .94);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--chx-ink2);
}
.chx .chx-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 14px 14px 16px;
}
.chx .chx-card-sup {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--chx-gold-t);
}
.chx .chx-card-preco {
	font-size: 19px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -.01em;
	color: var(--chx-ink2);
}
.chx .chx-card-tit {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--chx-ink2);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.chx .chx-card-cod,
.chx .chx-card-cond {
	margin-top: -4px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: .02em;
	color: var(--chx-muted);
}
.chx .chx-card-cod b {
	font-weight: 700;
	color: var(--chx-ink2);
}
.chx .chx-card-specs {
	display: grid;
	grid-auto-columns: minmax(0, 1fr);
	grid-auto-flow: column;
	margin: auto 0 0;
	padding: 10px 0;
	list-style: none;
	border-top: 1px solid var(--chx-line2);
	border-bottom: 1px solid var(--chx-line2);
}
.chx .chx-card-specs li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.chx .chx-card-specs li::before {
	content: none;
}
.chx .chx-card-specs li + li {
	border-left: 1px solid var(--chx-line2);
}
.chx .chx-card-specs strong {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}
.chx .chx-card-specs span {
	font-size: 10px;
	line-height: 1.2;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--chx-muted);
}
.chx .chx-card-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	border: 1px solid var(--chx-ink2);
	background: #fff;
	font-size: 14px;
	font-weight: 500;
	color: var(--chx-ink2);
	transition: background-color .15s, color .15s;
}

/* Sugestões (só antes da 1ª pergunta) */
.chx .chx-sug {
	display: flex;
	flex: none;
	gap: 8px;
	padding: 10px 16px;
	overflow-x: auto;
	background: #fff;
	border-top: 1px solid var(--chx-line);
	scrollbar-width: none;
}
.chx .chx-sug::-webkit-scrollbar {
	display: none;
}
.chx .chx-sug[hidden] {
	display: none;
}
.chx .chx-chip {
	display: inline-flex;
	flex: none;
	align-items: center;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #dcd8d2;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	font-family: var(--chx-sans);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--chx-ink2);
	white-space: nowrap;
	cursor: pointer;
}
.chx .chx-chip:focus-visible {
	outline: 2px solid var(--chx-gold-d);
	outline-offset: 2px;
}

/* Campo de digitar — sem a caixa cinza do tema */
.chx .chx-inp {
	flex: none;
	padding: 10px 16px;
	padding-bottom: max(10px, env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid var(--chx-line);
}
.chx .chx-row {
	display: flex;
	border: 1px solid var(--chx-ink2);
	background: #fff;
}
.chx .chx-row:focus-within {
	border-color: var(--chx-gold-d);
	box-shadow: 0 0 0 1px var(--chx-gold-d);
}
.chx .chx-row .chx-in {
	flex: 1;
	width: auto;
	min-width: 0;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-family: var(--chx-sans);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--chx-ink2);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.chx .chx-row .chx-in::placeholder {
	color: var(--chx-muted);
	opacity: 1;
}
.chx .chx-row .chx-snd {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--chx-line);
	box-shadow: none;
	color: var(--chx-muted);
	cursor: default;
}
.chx .chx-row .chx-snd.on {
	background: var(--chx-ink2);
	color: var(--chx-gold);
	cursor: pointer;
}
.chx .chx-row .chx-snd svg {
	display: block;
	width: 20px;
	height: 20px;
}
.chx .chx-row .chx-snd:focus-visible {
	outline: 2px solid var(--chx-gold-d);
	outline-offset: 2px;
}
.chx .chx-foot {
	margin-top: 6px;
	font-size: 10px;
	line-height: 1.4;
	letter-spacing: .14em;
	text-align: center;
	text-transform: uppercase;
	color: var(--chx-muted);
}
.chx .chx-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	white-space: nowrap;
}

/* Celular: com o chat aberto a página de trás não rola */
@media (max-width: 480px) {
	html.chx-aberto,
	html.chx-aberto body {
		overflow: hidden;
	}
}

/* Tablet e acima: janela flutuante no canto esquerdo (o direito é do WhatsApp) */
@media (min-width: 481px) {
	.chx .chx-fab {
		left: 24px;
		bottom: 24px;
	}
	.chx .chx-win {
		top: auto;
		right: auto;
		left: 24px;
		bottom: 24px;
		width: 400px;
		height: calc(100vh - 48px);
		height: calc(100dvh - 48px);
		max-height: 720px;
		border: 1px solid var(--chx-line);
		box-shadow: 0 24px 60px rgba(31, 30, 28, .24);
	}
}

/* Computador: botão escondido (opção "Botão no computador" no admin / CHAVEXO_FAB_DESKTOP) */
@media (min-width: 1024px) {
	.chx.chx--sem-pc .chx-fab {
		display: none;
	}
}

@media (hover: hover) {
	.chx .chx-fab:hover {
		background: var(--chx-gold);
		color: var(--chx-ink);
	}
	.chx .chx-x:hover {
		color: var(--chx-gold);
	}
	.chx .chx-card:hover {
		border-color: var(--chx-gold-d);
		box-shadow: 0 8px 24px rgba(31, 30, 28, .08);
	}
	.chx .chx-card:hover .chx-card-btn {
		background: var(--chx-ink2);
		color: #fff;
	}
	.chx .chx-chip:hover {
		border-color: var(--chx-ink2);
	}
}

@media (prefers-reduced-motion: reduce) {
	.chx .chx-win,
	.chx .chx-dots i {
		animation: none;
	}
}
