/* JLROCA Contacto: ventana del chat con el asistente. Todo va dentro de .jlcc para no tocar el resto de la web. */
.jlcc {
	--jlcc-acento: #ff8c00;
	--jlcc-tinta: #17150f;
	--jlcc-suave: #6b665c;
	--jlcc-fondo: #f6f3ee;
	--jlcc-linea: #e7e1d6;
	--jlcc-blanco: #fff;
	--jlcc-sombra: 0 30px 70px -24px rgba(40, 26, 6, .42), 0 10px 24px -12px rgba(40, 26, 6, .22);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--jlcc-tinta);
	-webkit-font-smoothing: antialiased;
}
.jlcc *, .jlcc *::before, .jlcc *::after { box-sizing: border-box; }
/* Los temas (Astra, Elementor…) pintan botones y campos a su manera: aquí se deja todo a cero */
.jlcc button, .jlcc textarea {
	font: inherit; color: inherit; margin: 0; border: 0; background: none; box-shadow: none; text-transform: none;
	letter-spacing: normal; min-height: 0; width: auto; height: auto; line-height: inherit; border-radius: 0;
}
.jlcc button { cursor: pointer; padding: 0; }
.jlcc svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.jlcc [hidden] { display: none !important; }

/* ---------------------------------------------------------------- botón para volver al chat */
.jlcc .jlcc-lanzador {
	position: fixed; right: 20px; bottom: 20px; z-index: 99998;
	display: inline-flex; align-items: center; gap: 10px;
	padding: 13px 20px 13px 16px; border-radius: 999px;
	background: var(--jlcc-tinta); color: #fff; font-weight: 650; font-size: 15px;
	box-shadow: var(--jlcc-sombra);
	transition: transform .18s ease;
}
.jlcc .jlcc-lanzador:hover { transform: translateY(-2px); }
.jlcc .jlcc-lanzador svg { fill: var(--jlcc-acento); stroke: none; }
.jlcc .jlcc-lanzador:focus-visible { outline: 3px solid var(--jlcc-acento); outline-offset: 3px; }
.jlcc .jlcc-punto {
	position: absolute; top: 4px; right: 6px; width: 12px; height: 12px; border-radius: 50%;
	background: var(--jlcc-acento); border: 2px solid var(--jlcc-tinta);
}

/* ---------------------------------------------------------------- ventana */
.jlcc .jlcc-panel {
	position: fixed; right: 20px; bottom: 20px; z-index: 99999;
	width: 392px; height: min(640px, calc(100vh - 40px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--jlcc-fondo); border-radius: 24px; box-shadow: var(--jlcc-sombra);
	opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right;
	transition: opacity .2s ease, transform .2s ease;
}
.jlcc .jlcc-panel.jlcc-visible { opacity: 1; transform: none; }

.jlcc .jlcc-cabecera {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 14px 16px 18px; background: var(--jlcc-tinta); color: #fff;
}
.jlcc .jlcc-avatar {
	width: 42px; height: 42px; border-radius: 14px; flex: none;
	display: grid; place-items: center;
	background: var(--jlcc-acento); color: var(--jlcc-tinta); font-weight: 800; font-size: 15px; letter-spacing: -.02em;
}
.jlcc .jlcc-titulos { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.jlcc .jlcc-titulos strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.jlcc .jlcc-estado { font-size: 13px; color: rgba(255, 255, 255, .72); display: flex; align-items: center; gap: 6px; }
.jlcc .jlcc-verde { width: 8px; height: 8px; border-radius: 50%; background: #3ccf6e; box-shadow: 0 0 0 3px rgba(60, 207, 110, .2); display: inline-block; }
.jlcc .jlcc-cerrar {
	width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
	background: rgba(255, 255, 255, .08); transition: background .15s;
}
.jlcc .jlcc-cerrar:hover { background: rgba(255, 255, 255, .16); }
.jlcc .jlcc-cerrar:focus-visible { outline: 2px solid var(--jlcc-acento); outline-offset: 2px; }

.jlcc .jlcc-aviso {
	margin: 0; padding: 9px 18px; font-size: 12.5px; line-height: 1.45; color: var(--jlcc-suave);
	background: var(--jlcc-blanco); border-bottom: 1px solid var(--jlcc-linea);
}
.jlcc .jlcc-aviso a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.jlcc .jlcc-recordatorio {
	margin: 0; padding: 10px 18px; font-size: 13px; line-height: 1.45; font-weight: 600;
	background: #fff4e5; color: #7a3d00; border-bottom: 1px solid #ffe0b8; display: flex; gap: 8px;
}

/* ---------------------------------------------------------------- mensajes */
.jlcc .jlcc-mensajes {
	flex: 1; overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 14px 10px; display: flex; flex-direction: column; gap: 8px;
	scroll-behavior: smooth;
}
.jlcc .jlcc-m {
	max-width: 86%; padding: 10px 14px; border-radius: 18px; word-wrap: break-word; overflow-wrap: anywhere;
	animation: jlcc-entra .22s ease both;
}
.jlcc .jlcc-m a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.jlcc .jlcc-asistente, .jlcc .jlcc-joaquin {
	align-self: flex-start; background: var(--jlcc-blanco); border-bottom-left-radius: 6px;
	box-shadow: 0 1px 2px rgba(40, 26, 6, .08);
}
.jlcc .jlcc-joaquin { box-shadow: inset 3px 0 0 var(--jlcc-acento), 0 1px 2px rgba(40, 26, 6, .08); }
.jlcc .jlcc-cliente {
	align-self: flex-end; background: var(--jlcc-acento); color: var(--jlcc-tinta); border-bottom-right-radius: 6px;
}
.jlcc .jlcc-etiqueta {
	display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .65; margin-bottom: 3px;
}
.jlcc .jlcc-consulta { background: var(--jlcc-blanco); border: 1px solid var(--jlcc-linea); box-shadow: none; max-height: 220px; overflow-y: auto; }
.jlcc .jlcc-presupuesto { border: 1px solid var(--jlcc-linea); box-shadow: 0 8px 20px -14px rgba(40, 26, 6, .35); max-width: 92%; }
.jlcc .jlcc-presupuesto .jlcc-texto > strong:first-child { font-size: 15.5px; }
.jlcc .jlcc-enviando { opacity: .6; }
.jlcc .jlcc-fallido { background: #fdecea; color: #7f1d1d; }

.jlcc .jlcc-nota {
	align-self: center; margin: 4px 8px; padding: 6px 12px; max-width: 92%; text-align: center;
	font-size: 12.5px; line-height: 1.45; color: var(--jlcc-suave); background: rgba(23, 21, 15, .05); border-radius: 12px;
}
.jlcc .jlcc-nota-ok { background: #e7f6ec; color: #14532d; font-weight: 600; }
.jlcc .jlcc-nota-error { background: #fdecea; color: #7f1d1d; }

.jlcc .jlcc-escribiendo { display: inline-flex; gap: 5px; padding: 14px 16px; }
.jlcc .jlcc-escribiendo span {
	width: 7px; height: 7px; border-radius: 50%; background: #b5ada0; animation: jlcc-salta 1.2s infinite ease-in-out;
}
.jlcc .jlcc-escribiendo span:nth-child(2) { animation-delay: .15s; }
.jlcc .jlcc-escribiendo span:nth-child(3) { animation-delay: .3s; }

/* ---------------------------------------------------------------- respuestas rápidas y caja de texto */
.jlcc .jlcc-rapidas { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 14px 10px; }
.jlcc .jlcc-rapida {
	padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
	background: var(--jlcc-blanco); border: 1px solid var(--jlcc-linea); color: var(--jlcc-tinta);
	transition: border-color .15s, background .15s;
}
.jlcc .jlcc-rapida:hover { border-color: var(--jlcc-acento); background: #fff8ef; }
.jlcc .jlcc-rapida:focus-visible { outline: 2px solid var(--jlcc-acento); outline-offset: 2px; }

.jlcc .jlcc-escribir {
	display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px 12px;
	background: var(--jlcc-blanco); border-top: 1px solid var(--jlcc-linea);
}
.jlcc .jlcc-escribir textarea {
	flex: 1; resize: none; max-height: 132px; padding: 11px 14px; border-radius: 16px;
	background: var(--jlcc-fondo); border: 1px solid transparent; font-size: 16px; line-height: 1.4; color: var(--jlcc-tinta);
	outline: none; transition: border-color .15s, background .15s;
}
.jlcc .jlcc-escribir textarea:focus { border-color: var(--jlcc-acento); background: var(--jlcc-blanco); }
.jlcc .jlcc-escribir textarea::placeholder { color: #9a9388; }
.jlcc .jlcc-enviar {
	width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center;
	background: var(--jlcc-acento); color: var(--jlcc-tinta); transition: transform .15s, opacity .15s;
}
.jlcc .jlcc-enviar svg { stroke-width: 2.4; }
.jlcc .jlcc-enviar:hover { transform: translateY(-1px); }
.jlcc .jlcc-enviar[disabled] { opacity: .35; cursor: default; transform: none; }
.jlcc .jlcc-enviar:focus-visible { outline: 2px solid var(--jlcc-tinta); outline-offset: 2px; }

@keyframes jlcc-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes jlcc-salta { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }

/* ---------------------------------------------------------------- móvil: pantalla completa */
@media (max-width: 639px) {
	.jlcc .jlcc-panel {
		right: 0; bottom: 0; left: 0; top: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0;
		transform: translateY(24px);
	}
	.jlcc .jlcc-cabecera { padding-top: max(16px, env(safe-area-inset-top)); }
	.jlcc .jlcc-escribir { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
	.jlcc .jlcc-lanzador { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
	html.jlcc-abierto, html.jlcc-abierto body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.jlcc .jlcc-panel, .jlcc .jlcc-m, .jlcc .jlcc-lanzador, .jlcc .jlcc-escribiendo span { animation: none; transition: none; }
	.jlcc .jlcc-mensajes { scroll-behavior: auto; }
}
