/* ==========================================================
   Caixa de chat interativa — Artibot
   Arquivo separado para não mexer no estilo.css principal
   ========================================================== */

/* A caixa decorativa vira clicável */
.chat-box.clicavel {
	cursor: pointer;
	transition: box-shadow .18s ease, transform .18s ease;
	border: 0;
	padding: 0;
	text-align: left;
	font: inherit;
	color: inherit;
	background: var(--white, #fff);
	display: block;
	width: 100%;
}
.chat-box.clicavel:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 38px rgba(0, 0, 0, .16);
}
.chat-box.clicavel:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}

/* Dica "clique para conversar" */
.chat-dica {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	margin-left: auto;
	white-space: nowrap;
}
.chat-dica .ponto {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #16a34a;
	animation: pulsa 1.8s ease-in-out infinite;
}
@keyframes pulsa {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: .45; transform: scale(.8); }
}

/* Área onde o chat real aparece.
   IMPORTANTE: nunca use display:none aqui. O Artibot precisa medir o
   espaço para se montar. Por isso a área nasce com largura e altura
   reais, apenas fora da vista (classe .fora). */
.chat-embed {
	max-width: 680px;
	margin: 0 auto 24px;
	border-radius: 20px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
	border: 1px solid rgba(0, 0, 0, .07);
	height: 520px;
	position: relative;
}

/* Estado inicial: montado, com tamanho real, mas invisível e sem ocupar lugar */
.chat-embed.fora {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	opacity: 0;
	pointer-events: none;
	z-index: -1;
	margin: 0 auto;
}

/* Força o conteúdo injetado a ocupar todo o espaço */
.chat-embed > div[id^="artibot-"],
.chat-embed iframe {
	position: relative;
	z-index: 1;
}
.chat-embed > div[id^="artibot-"],
.chat-embed iframe {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	border: 0 !important;
	display: block !important;
}

/* Aviso de carregando */
.chat-carregando {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #6b7280;
	font-size: 14px;
	font-weight: 600;
	background: #fff;
	z-index: 0;
}
.chat-carregando .roda {
	width: 30px;
	height: 30px;
	border: 3px solid #e5e7eb;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: gira .8s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }

/* Botão para fechar e voltar */
.chat-fechar {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	border: 0;
	border-radius: 999px;
	width: 30px;
	height: 30px;
	font-size: 17px;
	line-height: 1;
	font-weight: 700;
	color: #fff;
	background: rgba(17, 24, 39, .55);
	cursor: pointer;
}
.chat-fechar:hover { background: rgba(17, 24, 39, .82); }

/* ---- Celular ---- */
@media (max-width: 767px) {
	.chat-embed { height: 460px; border-radius: 16px; }
	.chat-dica  { font-size: 11px; }
	.chat-dica .rotulo { display: none; }
}

/* ---- Telas baixas deitadas ---- */
@media (max-height: 560px) and (orientation: landscape) {
	.chat-embed { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
	.chat-box.clicavel, .chat-dica .ponto, .chat-carregando .roda { animation: none; transition: none; }
}
