/* Contacto Rotativo — widget frontend */

.cr-widget {
	--cr-color: #00a884;
	--cr-color-ink: #ffffff;
	position: fixed;
	z-index: 999990;
	bottom: 22px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.cr-widget *,
.cr-widget *::before,
.cr-widget *::after {
	box-sizing: border-box;
}

.cr-pos-bottom-right {
	right: 22px;
}

.cr-pos-bottom-left {
	left: 22px;
}

/* ---------------------------------------------------------------- Launcher */
.cr-launcher {
	border: 0;
	cursor: pointer;
	background: none;
	padding: 0;
	display: inline-flex;
	align-items: center;
	font: inherit;
	filter: drop-shadow( 0 8px 24px rgba( 0, 0, 0, 0.18 ) );
	transition: transform 0.15s ease;
}

.cr-launcher:hover {
	transform: translateY( -2px );
}

.cr-launcher:focus-visible {
	outline: 3px solid rgba( 0, 0, 0, 0.25 );
	outline-offset: 3px;
}

/* Arrastrable */
.cr-draggable .cr-launcher {
	cursor: grab;
	touch-action: none;
}

.cr-dragging .cr-launcher {
	cursor: grabbing;
	transform: none !important;
}

.cr-dragging {
	user-select: none;
}

.cr-ico {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

/* Diseño: Burbuja */
.cr-design-bubble .cr-launcher {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	justify-content: center;
}

/* Diseño: Píldora */
.cr-design-pill .cr-launcher {
	gap: 8px;
	padding: 12px 20px;
	border-radius: 999px;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	font-weight: 600;
}

/* Diseño: Minimalista */
.cr-design-minimal .cr-launcher {
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: #ffffff;
	color: #111827;
	font-weight: 600;
	border: 1px solid #e5e7eb;
}

.cr-design-minimal .cr-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var( --cr-color );
}

/* Diseño: Asesores + CTA */
.cr-design-advisors_cta .cr-launcher {
	gap: 12px;
	padding: 10px 12px 10px 14px;
	border-radius: 999px;
	background: #ffffff;
	color: #111827;
	border: 1px solid #eef0f2;
}

.cr-design-advisors_cta .cr-cta-title {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.2;
}

.cr-design-advisors_cta .cr-cta-status {
	font-size: 12px;
	color: #6b7280;
	display: flex;
	align-items: center;
	gap: 5px;
}

.cr-design-advisors_cta .cr-arrow {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
}

/* Diseño: Racimo de fotos */
.cr-design-photos_cluster .cr-launcher {
	gap: 10px;
	padding: 8px 8px 8px 14px;
	border-radius: 999px;
	background: #111827;
	color: #ffffff;
}

.cr-design-photos_cluster .cr-arrow {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Avatares apilados */
.cr-avatars {
	display: inline-flex;
	align-items: center;
}

.cr-avatars .cr-av {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	margin-left: -10px;
	background-size: cover;
	background-position: center;
	background-color: var( --cr-color );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.cr-avatars .cr-av:first-child {
	margin-left: 0;
}

.cr-online-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	display: inline-block;
}

/* ------------------------------------------------------------------- Popup */
.cr-popup {
	position: absolute;
	bottom: calc( 100% + 12px );
	max-width: 250px;
	background: #ffffff;
	color: #111827;
	padding: 10px 14px;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.15 );
	font-size: 13px;
	line-height: 1.4;
	animation: cr-pop 0.25s ease;
}

.cr-pos-bottom-right .cr-popup {
	right: 0;
}

.cr-pos-bottom-left .cr-popup {
	left: 0;
}

.cr-popup-close {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 0;
	background: #111827;
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	line-height: 1;
}

@keyframes cr-pop {
	from { opacity: 0; transform: translateY( 6px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

/* ------------------------------------------------------------------- Panel */
.cr-panel {
	position: absolute;
	bottom: calc( 100% + 14px );
	width: 340px;
	max-width: calc( 100vw - 32px );
	background: #ffffff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.25 );
	animation: cr-pop 0.2s ease;
}

.cr-pos-bottom-right .cr-panel {
	right: 0;
}

.cr-pos-bottom-left .cr-panel {
	left: 0;
}

.cr-panel-head {
	background: var( --cr-color );
	color: var( --cr-color-ink );
	padding: 18px 44px 18px 18px;
	position: relative;
}

.cr-panel-head h3 {
	margin: 0 0 4px;
	font-size: 16px;
}

.cr-panel-head p {
	margin: 0;
	font-size: 13px;
	opacity: 0.9;
}

.cr-panel-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.2 );
	color: inherit;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.cr-panel-body {
	padding: 16px 18px 18px;
}

.cr-field {
	margin-bottom: 12px;
}

.cr-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 5px;
	color: #374151;
}

.cr-field .cr-req-mark {
	color: #ef4444;
}

.cr-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	font-size: 14px;
	color: #111827;
}

.cr-field input:focus {
	outline: none;
	border-color: var( --cr-color );
	box-shadow: 0 0 0 3px rgba( 0, 0, 0, 0.06 );
}

.cr-field.cr-has-error input {
	border-color: #ef4444;
}

.cr-field-error {
	color: #ef4444;
	font-size: 12px;
	margin-top: 4px;
	display: none;
}

.cr-field.cr-has-error .cr-field-error {
	display: block;
}

.cr-submit {
	width: 100%;
	border: 0;
	border-radius: 12px;
	padding: 12px;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 4px;
}

.cr-submit:disabled {
	opacity: 0.7;
	cursor: default;
}

.cr-note {
	margin-top: 12px;
	font-size: 11px;
	color: #9ca3af;
	text-align: center;
}

.cr-status {
	text-align: center;
	padding: 8px 0 0;
	font-size: 13px;
	color: #374151;
	display: none;
}

.cr-status.cr-status--error {
	color: #ef4444;
}

.cr-status.is-visible {
	display: block;
}

.cr-hidden {
	display: none !important;
}

/* -------------------------------------------------------------- Chat */
.cr-panel--chat .cr-panel-body {
	padding: 0;
	display: flex;
	flex-direction: column;
	height: 420px;
	max-height: calc( 100vh - 160px );
}

.cr-chat-msgs {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #f7f8fa;
}

.cr-msg {
	max-width: 82%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
}

.cr-msg--bot {
	align-self: flex-start;
	background: #ffffff;
	color: #111827;
	border: 1px solid #eceef1;
	border-bottom-left-radius: 4px;
}

.cr-msg--bot a {
	color: var( --cr-color );
	text-decoration: underline;
	word-break: break-all;
}

.cr-msg--bot a:hover {
	opacity: 0.8;
}

.cr-msg--user {
	align-self: flex-end;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	border-bottom-right-radius: 4px;
}

.cr-typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.cr-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9ca3af;
	animation: cr-blink 1.2s infinite ease-in-out;
}

.cr-typing span:nth-child( 2 ) { animation-delay: 0.2s; }
.cr-typing span:nth-child( 3 ) { animation-delay: 0.4s; }

@keyframes cr-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

.cr-handoff {
	align-self: center;
	margin-top: 6px;
	border: 0;
	border-radius: 12px;
	padding: 11px 18px;
	background: #25d366;
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.cr-handoff:disabled {
	opacity: 0.7;
	cursor: default;
}

.cr-wa-link {
	align-self: center;
	margin-top: 6px;
	color: var( --cr-color );
	font-weight: 600;
	text-decoration: underline;
}

/* Opciones (botones) del flujo guiado */
.cr-options {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-self: stretch;
	margin: 4px 0 2px;
}

.cr-option {
	text-align: left;
	background: #ffffff;
	color: var( --cr-color );
	border: 1.5px solid var( --cr-color );
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.cr-option:hover {
	background: var( --cr-color );
	color: var( --cr-color-ink );
}

.cr-panel--guided .cr-panel-body {
	height: auto;
	max-height: calc( 100vh - 160px );
	min-height: 260px;
}

/* Paso de captura de dato (input dentro del flujo guiado) */
.cr-input-wrap {
	align-self: stretch;
	margin: 4px 0 2px;
}

.cr-input-step {
	display: flex;
	gap: 8px;
}

.cr-input-field {
	flex: 1 1 auto;
	border: 1.5px solid var( --cr-color );
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 14px;
	color: #111827;
}

.cr-input-field:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba( 0, 0, 0, 0.06 );
}

.cr-input-field.cr-invalid {
	border-color: #ef4444;
}

.cr-input-error {
	color: #ef4444;
	font-size: 12px;
	margin: 4px 4px 0;
	min-height: 14px;
}

.cr-composer {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eceef1;
	background: #ffffff;
}

.cr-composer-input {
	flex: 1 1 auto;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 14px;
	color: #111827;
}

.cr-composer-input:focus {
	outline: none;
	border-color: var( --cr-color );
}

.cr-send {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var( --cr-color );
	color: var( --cr-color-ink );
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

@media ( max-width: 480px ) {
	.cr-panel {
		width: calc( 100vw - 24px );
	}

	.cr-panel--chat .cr-panel-body {
		height: 60vh;
	}
}
