/* JEZZ Chatbot · widget */
.jcc-root {
	--jcc-accent: #5B3DF5;
	--jcc-header-bg: #12122A;
	--jcc-header-text: #FFFFFF;
	--jcc-chat-bg: #F8F8FC;
	--jcc-bot-bubble: #FFFFFF;
	--jcc-bot-text: #12122A;
	--jcc-user-text: #FFFFFF;
	--jcc-radius: 20px;
	--jcc-width: 380px;
	--jcc-height: 620px;
	--jcc-offset-x: 24px;
	--jcc-offset-y: 24px;
	--jcc-launcher: 62px;
	--jcc-z: 99999;
	font-size: 14px;
	line-height: 1.5;
	color: var(--jcc-bot-text);
}
.jcc-root *, .jcc-root *::before, .jcc-root *::after { box-sizing: border-box; }
.jcc-root.jcc-font-system, .jcc-root.jcc-font-system input, .jcc-root.jcc-font-system button, .jcc-root.jcc-font-system textarea { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.jcc-root.jcc-font-inherit input, .jcc-root.jcc-font-inherit button, .jcc-root.jcc-font-inherit textarea { font-family: inherit; }

/* Burbuja flotante */
.jcc-launcher-wrap {
	position: fixed;
	bottom: var(--jcc-offset-y);
	right: var(--jcc-offset-x);
	z-index: var(--jcc-z);
	display: flex;
	align-items: center;
	gap: 10px;
}
.jcc-pos-left .jcc-launcher-wrap { right: auto; left: var(--jcc-offset-x); flex-direction: row-reverse; }
.jcc-root .jcc-launcher {
	width: var(--jcc-launcher);
	height: var(--jcc-launcher);
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--jcc-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 28px rgba(18, 18, 42, .28);
	transition: transform .18s ease;
	overflow: hidden;
}
.jcc-root .jcc-launcher:hover { transform: scale(1.06); }
.jcc-root .jcc-launcher:focus-visible { outline: 3px solid var(--jcc-header-bg); outline-offset: 3px; }
.jcc-launcher img { width: 60%; height: 60%; object-fit: contain; display: block; }
.jcc-launcher svg { width: 46%; height: 46%; }
.jcc-launcher-text {
	background: #fff;
	color: #12122A;
	font-weight: 600;
	font-size: 14px;
	padding: 9px 14px;
	border-radius: 999px;
	box-shadow: 0 6px 20px rgba(18, 18, 42, .16);
	white-space: nowrap;
	cursor: pointer;
}
.jcc-launcher-text:empty { display: none; }
.jcc-root.jcc-is-open .jcc-launcher-text { display: none; }

/* Ventana */
.jcc-panel {
	position: fixed;
	bottom: calc(var(--jcc-offset-y) + var(--jcc-launcher) + 14px);
	right: var(--jcc-offset-x);
	z-index: var(--jcc-z);
	width: var(--jcc-width);
	max-width: calc(100vw - 32px);
	height: var(--jcc-height);
	max-height: calc(100vh - var(--jcc-offset-y) - var(--jcc-launcher) - 40px);
	background: var(--jcc-chat-bg);
	border-radius: var(--jcc-radius);
	box-shadow: 0 24px 60px rgba(18, 18, 42, .24);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.jcc-pos-left .jcc-panel { right: auto; left: var(--jcc-offset-x); }
.jcc-panel.jcc-open { display: flex; animation: jcc-in .22s ease; }
@keyframes jcc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Cabecera */
.jcc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 10px 14px 16px;
	background: var(--jcc-header-bg);
	color: var(--jcc-header-text);
	flex: none;
}
.jcc-avatar {
	width: 42px;
	height: 42px;
	flex: none;
	border-radius: 50%;
	background: var(--jcc-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.jcc-avatar.jcc-shape-rounded { border-radius: 10px; }
.jcc-avatar.jcc-shape-square { border-radius: 0; }
.jcc-avatar.jcc-shape-none { background: transparent; border-radius: 0; }
.jcc-avatar.jcc-has-img { background: #fff; }
.jcc-avatar.jcc-has-img.jcc-shape-none { background: transparent; }
.jcc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jcc-avatar.jcc-shape-none img { object-fit: contain; }
.jcc-avatar svg { width: 48%; height: 48%; color: #fff; }
.jcc-head-text { flex: 1; min-width: 0; }
.jcc-title { font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--jcc-header-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jcc-subtitle { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .82; color: var(--jcc-header-text); white-space: nowrap; overflow: hidden; }
.jcc-subtitle span:last-child { overflow: hidden; text-overflow: ellipsis; }
.jcc-subtitle:has(span[data-p]:empty), .jcc-subtitle.jcc-empty { display: none; }
.jcc-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC97; flex: none; }
.jcc-badge-test { background: #d63638; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .8px; padding: 3px 7px; border-radius: 999px; flex: none; }
.jcc-root .jcc-icon-btn {
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--jcc-header-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	opacity: .85;
	box-shadow: none;
}
.jcc-root .jcc-icon-btn:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.jcc-root .jcc-icon-btn:focus-visible { outline: 2px solid var(--jcc-header-text); }
.jcc-icon-btn svg { width: 18px; height: 18px; }

/* Mensajes */
.jcc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 14px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--jcc-chat-bg);
	scroll-behavior: smooth;
}
.jcc-msg {
	max-width: 86%;
	padding: 10px 14px;
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.jcc-msg p { margin: 0 0 6px; }
.jcc-msg p:last-child { margin: 0; }
.jcc-bot {
	align-self: flex-start;
	background: var(--jcc-bot-bubble);
	color: var(--jcc-bot-text);
	border: 1px solid rgba(18, 18, 42, .08);
	border-radius: 4px 16px 16px 16px;
}
.jcc-user {
	align-self: flex-end;
	background: var(--jcc-accent);
	color: var(--jcc-user-text);
	border-radius: 16px 4px 16px 16px;
}
.jcc-msg a { color: inherit; text-decoration: underline; }
.jcc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.jcc-options:empty { display: none; }
.jcc-root .jcc-opt {
	min-height: 36px;
	margin: 0;
	padding: 7px 14px;
	border: 1.5px solid var(--jcc-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--jcc-accent);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: background .15s, color .15s;
}
.jcc-root .jcc-opt:hover, .jcc-root .jcc-opt:focus-visible { background: var(--jcc-accent); color: #fff; outline: none; }
.jcc-root .jcc-opt.jcc-opt-contact { border-style: solid; }
.jcc-typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px; background: var(--jcc-bot-bubble); border: 1px solid rgba(18, 18, 42, .08); border-radius: 4px 16px 16px 16px; }
.jcc-typing span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: jcc-blink 1.2s infinite; }
.jcc-typing span:nth-child(2) { animation-delay: .2s; }
.jcc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes jcc-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }

/* Formulario CF7 dentro del chat */
.jcc-form-tpl[hidden] { display: none !important; }
.jcc-formbox {
	background: #fff;
	border: 1px solid rgba(18, 18, 42, .1);
	border-radius: 14px;
	padding: 14px;
	color: #12122A;
	font-size: 13px;
}
.jcc-formbox p { margin: 0 0 10px; }
.jcc-formbox label { display: block; font-weight: 600; font-size: 12px; }
.jcc-formbox input[type="text"], .jcc-formbox input[type="email"], .jcc-formbox input[type="tel"], .jcc-formbox input[type="url"], .jcc-formbox input[type="number"], .jcc-formbox input[type="date"], .jcc-formbox select, .jcc-formbox textarea {
	width: 100% !important;
	max-width: 100%;
	margin-top: 4px;
	padding: 9px 11px;
	border: 1px solid #D5D5E2;
	border-radius: 8px;
	background: #fff;
	color: #12122A;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: none;
}
.jcc-formbox textarea { min-height: 80px; max-height: 160px; }
.jcc-formbox input:focus, .jcc-formbox select:focus, .jcc-formbox textarea:focus { outline: 2px solid var(--jcc-accent); outline-offset: 0; border-color: transparent; }
.jcc-formbox .wpcf7-list-item { margin: 0; }
.jcc-formbox .wpcf7-acceptance label, .jcc-formbox .wpcf7-checkbox label { font-weight: 400; display: flex; gap: 6px; align-items: flex-start; }
.jcc-formbox input[type="submit"], .jcc-formbox button[type="submit"] {
	width: 100%;
	min-height: 44px;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--jcc-header-bg);
	color: var(--jcc-header-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.jcc-formbox .wpcf7-spinner { display: block; margin: 8px auto 0; }
.jcc-formbox .wpcf7-response-output { margin: 10px 0 0 !important; padding: 8px 10px !important; border-radius: 8px; font-size: 12px; }

/* Pie */
.jcc-footer { background: #fff; border-top: 1px solid rgba(18, 18, 42, .07); flex: none; }
.jcc-input-row { display: flex; gap: 8px; padding: 10px 12px 6px; }
/* Campo de escritura bien visible: fondo gris claro, borde marcado y texto de ejemplo oscuro.
   Con !important porque muchos temas (Elementor, Hello...) pisan el estilo de los input. */
#jcc-root.jcc-root .jcc-input {
	flex: 1;
	min-width: 0;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 14px !important;
	border: 1.5px solid #8E8EA6 !important;
	border-radius: 12px !important;
	background: #F2F3F7 !important;
	color: #12122A !important;
	font-size: 15px !important;
	font-weight: 500;
	box-shadow: none !important;
}
#jcc-root.jcc-root .jcc-input::placeholder { color: #3A3A4E !important; opacity: 1 !important; font-weight: 500; }
#jcc-root.jcc-root .jcc-input:hover { border-color: #5E5E78 !important; }
#jcc-root.jcc-root .jcc-input:focus { outline: none !important; border-color: var(--jcc-accent) !important; background: #fff !important; box-shadow: 0 0 0 3px rgba(91, 61, 245, .15) !important; }
.jcc-root .jcc-send {
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	flex: none;
	border: 0;
	border-radius: 12px;
	background: var(--jcc-accent);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none;
}
.jcc-root .jcc-send:disabled { opacity: .5; cursor: default; }
.jcc-footer-links { display: flex; justify-content: center; padding: 0 12px 2px; }
.jcc-root .jcc-contact-link {
	margin: 0;
	padding: 4px 6px;
	border: 0;
	background: transparent;
	color: var(--jcc-accent);
	font-size: 12px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	box-shadow: none;
	min-height: 0;
}
.jcc-disclaimer { text-align: center; font-size: 11px; color: #6A6A82; padding: 2px 12px 9px; }
.jcc-disclaimer:empty { display: none; }

/* Móvil: pantalla completa */
@media (max-width: 480px) {
	.jcc-root:not(.jcc-preview) .jcc-panel {
		inset: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}
	.jcc-root.jcc-is-open:not(.jcc-preview) .jcc-launcher-wrap { display: none; }
	#jcc-root.jcc-root .jcc-input { font-size: 16px !important; }
}

/* Vista previa en el panel de administración */
.jcc-root.jcc-preview { position: relative; height: 100%; }
.jcc-preview .jcc-panel { position: absolute; bottom: calc(var(--jcc-launcher) + 14px); right: 0; max-height: none; height: min(var(--jcc-height), 560px); max-width: 100%; }
.jcc-preview .jcc-launcher-wrap { position: absolute; bottom: 0; right: 0; }
.jcc-preview.jcc-pos-left .jcc-panel { right: auto; left: 0; }
.jcc-preview.jcc-pos-left .jcc-launcher-wrap { right: auto; left: 0; }
.jcc-root .jcc-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }

/* Selector de idioma (1.1.0) */
.jcc-root .jcc-input:disabled { opacity: .55; cursor: not-allowed; }
.jcc-root .jcc-langs { gap: 8px; }
.jcc-root .jcc-opt.jcc-opt-lang { font-weight: 600; min-width: calc(50% - 4px); justify-content: center; text-align: center; }

.jcc-root .jcc-opt.jcc-opt-lang { display: inline-flex; align-items: center; gap: 8px; }
.jcc-root .jcc-flag { flex: 0 0 auto; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.jcc-root .jcc-msg-lang { display: inline-flex; align-items: center; gap: 8px; }
/* Vista previa del panel: mismo campo de escritura */
#jcc-preview .jcc-input { height: 46px; border: 1.5px solid #8E8EA6; background: #F2F3F7; font-size: 15px; font-weight: 500; }
#jcc-preview .jcc-input::placeholder { color: #3A3A4E; opacity: 1; }

/* Botones de contacto: Escríbenos / Llámanos / WhatsApp */
.jcc-root .jcc-opt-contact { display: inline-flex; align-items: center; gap: 6px; border-style: solid; }
.jcc-root .jcc-opt-contact svg { flex: none; }
.jcc-root .jcc-opt-wa { border-color: #1FA855; color: #128C4A; }
.jcc-root .jcc-opt-wa:hover, .jcc-root .jcc-opt-wa:focus-visible { background: #1FA855; color: #fff; }
.jcc-footer-links { gap: 6px 16px; flex-wrap: wrap; }
.jcc-root .jcc-contact-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none !important; }
.jcc-root .jcc-contact-link span { text-decoration: underline; }
.jcc-root .jcc-contact-wa { color: #128C4A; }

/* Barra de contacto bajo el campo de escritura: tres botones grandes y bien visibles */
.jcc-footer-links.jcc-contact-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px 12px 8px; }
/* Escríbenos: la acción principal, a lo ancho en la primera fila. Llámanos y WhatsApp, mitad y mitad debajo. */
.jcc-contact-bar .jcc-cbtn-write { grid-column: 1 / -1; order: -1; }
.jcc-contact-bar .jcc-cbtn:not(.jcc-cbtn-write):only-of-type,
.jcc-contact-bar .jcc-cbtn-write + .jcc-cbtn:last-child { grid-column: 1 / -1; }
.jcc-root .jcc-cbtn {
	flex: 1 1 0;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 8px 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-radius: 12px;
	border: 1.5px solid var(--jcc-accent);
	background: #fff;
	color: var(--jcc-accent);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.15;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none !important;
	box-shadow: 0 2px 6px rgba(18, 18, 42, .08);
	cursor: pointer;
	transition: transform .12s ease, filter .12s ease;
}
.jcc-root .jcc-cbtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.jcc-root .jcc-cbtn svg { flex: none; width: 17px; height: 17px; }
.jcc-root .jcc-cbtn:hover { transform: translateY(-1px); filter: brightness(.97); }
.jcc-root .jcc-cbtn:focus-visible { outline: 3px solid var(--jcc-header-bg); outline-offset: 2px; }
.jcc-root .jcc-cbtn-write { background: var(--jcc-accent); color: #fff; min-height: 48px; font-size: 15px; box-shadow: 0 4px 12px rgba(18, 18, 42, .18); }
.jcc-root .jcc-cbtn-write svg { width: 19px; height: 19px; }
.jcc-root .jcc-cbtn-call { background: #fff; color: var(--jcc-accent); }
.jcc-root .jcc-cbtn-wa { background: #fff; border-color: #1FA855; color: #128C4A; }
@media (max-width: 360px) {
	.jcc-root .jcc-cbtn { font-size: 13px; gap: 4px; padding: 8px 4px; }
	.jcc-root .jcc-cbtn svg { width: 15px; height: 15px; }
}

/* Escritura bloqueada al llegar al límite de la conversación */
#jcc-root.jcc-root .jcc-input.jcc-input-locked { background: #EDEDF3 !important; border-style: dashed !important; cursor: not-allowed; opacity: 1; }
#jcc-root.jcc-root .jcc-input.jcc-input-locked::placeholder { color: #12122A !important; font-weight: 600; }
