/* LSP AI — Widget. Paleta: naranja #FA4516, teal #036382, azul #0A3947. */
:root {
	--lsp-orange: #FA4516;
	--lsp-teal: #036382;
	--lsp-navy: #0A3947;
	--lsp-bg: #F7F9FA;
	--lsp-line: #E3E9ED;
}

#lsp-ai-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 58px;
	height: 58px;
	border: 0;
	border-radius: 50%;
	background: var(--lsp-teal);
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(10, 57, 71, 0.28);
	z-index: 999999;
	transition: transform 0.15s ease, background 0.15s ease;
}
#lsp-ai-launcher:hover { background: var(--lsp-navy); transform: translateY(-2px); }
#lsp-ai-launcher:focus-visible { outline: 3px solid var(--lsp-orange); outline-offset: 2px; }
#lsp-ai-launcher.lsp-ai-hidden { display: none; }

#lsp-ai-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 14px 44px rgba(10, 57, 71, 0.32);
	z-index: 1000000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#lsp-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	background: var(--lsp-teal);
	color: #fff;
}
#lsp-ai-header .lsp-ai-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
#lsp-ai-header .lsp-ai-actions { display: flex; align-items: center; gap: 6px; }
#lsp-ai-wa {
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	background: var(--lsp-orange);
	padding: 5px 10px;
	border-radius: 999px;
}
#lsp-ai-wa:hover { filter: brightness(0.95); }
.lsp-ai-wa-pulse { animation: lsp-ai-pulse 1.2s ease-in-out 3; }
@keyframes lsp-ai-pulse { 50% { transform: scale(1.08); } }
#lsp-ai-close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
#lsp-ai-close:focus-visible { outline: 2px solid #fff; }

#lsp-ai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: var(--lsp-bg);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lsp-ai-bubble {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.lsp-ai-assistant {
	align-self: flex-start;
	background: #fff;
	color: var(--lsp-navy);
	border: 1px solid var(--lsp-line);
	border-bottom-left-radius: 4px;
}
.lsp-ai-user {
	align-self: flex-end;
	background: var(--lsp-orange);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.lsp-ai-typing { display: flex; gap: 4px; align-items: center; }
.lsp-ai-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--lsp-teal); opacity: 0.4;
	animation: lsp-ai-blink 1.2s infinite;
}
.lsp-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.lsp-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lsp-ai-blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

#lsp-ai-form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid var(--lsp-line);
	background: #fff;
}
#lsp-ai-input {
	flex: 1;
	border: 1px solid var(--lsp-line);
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--lsp-navy);
}
#lsp-ai-input:focus-visible { outline: 2px solid var(--lsp-teal); border-color: var(--lsp-teal); }
#lsp-ai-send {
	border: 0;
	border-radius: 50%;
	width: 40px; height: 40px;
	background: var(--lsp-teal);
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	flex-shrink: 0;
}
#lsp-ai-send:hover { background: var(--lsp-navy); }
#lsp-ai-send:focus-visible { outline: 2px solid var(--lsp-orange); outline-offset: 2px; }

.lsp-ai-visually-hidden {
	position: absolute; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 480px) {
	#lsp-ai-panel {
		right: 0; bottom: 0;
		width: 100vw; height: 100dvh;
		max-width: 100vw; max-height: 100dvh;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	#lsp-ai-launcher, .lsp-ai-wa-pulse, .lsp-ai-typing span { transition: none; animation: none; }
}

/* Modo incrustado (shortcode [lsp_ai_chat]) */
#lsp-ai-inline { width: 100%; }
#lsp-ai-panel.lsp-ai-inline-mode {
	position: static;
	width: 100%;
	max-width: 100%;
	height: 560px;
	max-height: 80vh;
	right: auto;
	bottom: auto;
	box-shadow: 0 4px 20px rgba(10, 57, 71, 0.12);
	border: 1px solid var(--lsp-line);
}
