/* BD Lead Chat · estilos del widget público.
   Los botones, enlaces y campos llevan el prefijo #bdlc-root para que los estilos
   globales del tema o de Elementor (button, input, a…) no los pisen. */

.bdlc {
	--bdlc-primary: #262B3E;
	--bdlc-accent: #DB9600;
	--bdlc-bg: #F8F8F8;
	--bdlc-text: #262B3E;
	--bdlc-radius: 18px;
	--bdlc-x: 24px;
	--bdlc-y: 24px;
	--bdlc-font: var(--e-global-typography-text-font-family, "Poppins"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bdlc-font-title: var(--e-global-typography-primary-font-family, "Playfair Display"), Georgia, serif;
	--bdlc-shadow: 0 24px 60px -12px rgba(38, 43, 62, .35), 0 8px 20px -8px rgba(38, 43, 62, .2);

	position: fixed;
	bottom: var(--bdlc-y);
	z-index: 999999999;
	font-family: var(--bdlc-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--bdlc-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-align: left;
}
.bdlc--left { left: var(--bdlc-x); }
.bdlc--right { right: var(--bdlc-x); }
.bdlc *, .bdlc *::before, .bdlc *::after { box-sizing: border-box; }
#bdlc-root button, #bdlc-root input, #bdlc-root a { font-family: inherit; }
#bdlc-root [hidden] { display: none !important; }

/* ---------- Botón flotante ---------- */
#bdlc-root .bdlc-launcher {
	position: relative;
	width: 62px;
	height: 62px;
	min-width: 0;
	min-height: 0;
	border-radius: 50%;
	border: 0;
	margin: 0;
	padding: 0;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	color: #fff;
	background: var(--bdlc-accent);
	background-image: linear-gradient(135deg, color-mix(in srgb, var(--bdlc-accent), #fff 14%), color-mix(in srgb, var(--bdlc-accent), #000 14%));
	box-shadow: 0 10px 28px -6px rgba(38, 43, 62, .45);
	text-transform: none;
	letter-spacing: 0;
	transition: transform .25s ease, box-shadow .25s ease;
}
#bdlc-root .bdlc-launcher:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 32px -6px rgba(38, 43, 62, .5); background: var(--bdlc-accent); color: #fff; }
#bdlc-root .bdlc-launcher:focus { outline: none; }
#bdlc-root .bdlc-launcher:focus-visible { outline: 3px solid rgba(255, 255, 255, .8); outline-offset: 3px; }
#bdlc-root .bdlc-launcher svg { width: 28px; height: 28px; position: absolute; color: #fff; transition: opacity .2s ease, transform .25s ease; }
#bdlc-root .bdlc-launcher .bdlc-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
#bdlc-root .bdlc-launcher.is-open .bdlc-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
#bdlc-root .bdlc-launcher.is-open .bdlc-ico-close { opacity: 1; transform: none; }
.bdlc-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--bdlc-accent);
	animation: bdlc-pulse 2.4s ease-out infinite;
	pointer-events: none;
}
.bdlc.is-open .bdlc-ring, .bdlc.was-opened .bdlc-ring { display: none; }
@keyframes bdlc-pulse {
	0% { transform: scale(1); opacity: .8; }
	100% { transform: scale(1.75); opacity: 0; }
}

/* ---------- Bocadillo junto al botón ---------- */
.bdlc-teaser {
	position: absolute;
	bottom: 76px;
	width: max-content;
	max-width: min(280px, calc(100vw - 2 * var(--bdlc-x)));
	background: #fff;
	color: var(--bdlc-text);
	border-radius: 14px;
	padding: 12px 34px 12px 16px;
	font-size: 13.5px;
	line-height: 1.45;
	box-shadow: 0 12px 30px -8px rgba(38, 43, 62, .35);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease;
}
.bdlc--left .bdlc-teaser { left: 0; }
.bdlc--right .bdlc-teaser { right: 0; }
.bdlc-teaser.is-visible { opacity: 1; transform: none; }
.bdlc-teaser::after {
	content: "";
	position: absolute;
	bottom: -6px;
	width: 12px;
	height: 12px;
	background: #fff;
	transform: rotate(45deg);
}
.bdlc--left .bdlc-teaser::after { left: 24px; }
.bdlc--right .bdlc-teaser::after { right: 24px; }
#bdlc-root .bdlc-teaser-close {
	position: absolute;
	top: 5px;
	right: 7px;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-size: 18px;
	line-height: 1;
	color: #9a9eb2;
	cursor: pointer;
	padding: 2px 5px;
	margin: 0;
}
#bdlc-root .bdlc-teaser-close:hover { color: var(--bdlc-text); background: none; }

/* ---------- Ventana ---------- */
.bdlc-window {
	position: absolute;
	bottom: 78px;
	width: 430px;
	max-width: calc(100vw - 2 * var(--bdlc-x));
	height: 690px;
	max-height: calc(100vh - var(--bdlc-y) - 100px);
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	background: #fff;
	border-radius: var(--bdlc-radius);
	box-shadow: var(--bdlc-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(.97);
	transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.bdlc--left .bdlc-window { left: 0; transform-origin: bottom left; }
.bdlc--right .bdlc-window { right: 0; transform-origin: bottom right; }
.bdlc-window.is-open { opacity: 1; transform: none; }

/* ---------- Cabecera ---------- */
.bdlc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 14px 16px 18px;
	margin: 0;
	background: var(--bdlc-primary);
	background-image: linear-gradient(120deg, color-mix(in srgb, var(--bdlc-primary), #fff 9%), var(--bdlc-primary) 65%);
	color: #fff;
	flex: 0 0 auto;
}
.bdlc-avatar, .bdlc-msg-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--bdlc-accent);
	color: #fff;
	font-family: var(--bdlc-font-title);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: .02em;
	flex: 0 0 auto;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .28);
}
.bdlc-avatar img, .bdlc-msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; }
.bdlc-head-text { flex: 1 1 auto; min-width: 0; }
.bdlc-title {
	font-family: var(--bdlc-font-title);
	font-weight: 600;
	font-size: 17px;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #fff;
}
.bdlc-status { font-size: 12px; opacity: .82; display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #fff; }
.bdlc-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .25); flex: 0 0 auto; }
#bdlc-root .bdlc-close {
	border: 0;
	margin: 0;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	width: 34px;
	height: 34px;
	min-width: 0;
	min-height: 0;
	border-radius: 50%;
	display: grid;
	place-items: center;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	box-shadow: none;
	flex: 0 0 auto;
	transition: background .2s;
}
#bdlc-root .bdlc-close:hover { background: rgba(255, 255, 255, .22); color: #fff; }
#bdlc-root .bdlc-close svg { width: 16px; height: 16px; color: #fff; }

/* ---------- Cuerpo ---------- */
.bdlc-body {
	flex: 1 1 auto;
	overflow-y: auto;
	background: var(--bdlc-bg);
	padding: 18px 14px 10px;
	overscroll-behavior: contain;
}
.bdlc-messages { display: flex; flex-direction: column; gap: 8px; }
.bdlc-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 88%;
	animation: bdlc-in .25s ease both;
}
.bdlc-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.bdlc-msg-avatar { width: 28px; height: 28px; font-size: 11px; box-shadow: none; }
.bdlc-msg--cont .bdlc-msg-avatar { visibility: hidden; }
.bdlc-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	white-space: pre-line;
}
.bdlc-msg--bot .bdlc-bubble {
	background: #fff;
	color: var(--bdlc-text);
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(38, 43, 62, .06), 0 1px 0 rgba(38, 43, 62, .03);
}
.bdlc-msg--user .bdlc-bubble { background: var(--bdlc-primary); color: #fff; border-bottom-right-radius: 4px; }
@keyframes bdlc-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
.bdlc-typing .bdlc-bubble { display: flex; gap: 4px; padding: 14px 14px; }
.bdlc-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #b8bccb;
	animation: bdlc-blink 1.2s infinite ease-in-out;
}
.bdlc-typing span:nth-child(2) { animation-delay: .15s; }
.bdlc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bdlc-blink {
	0%, 80%, 100% { transform: translateY(0); opacity: .4; }
	40% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Pie: opciones, campo, notas ---------- */
.bdlc-footer {
	flex: 0 0 auto;
	background: #fff;
	border-top: 1px solid #eef0f4;
	padding: 10px 14px 12px;
	margin: 0;
}
.bdlc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bdlc-chips:empty { display: none; }
#bdlc-root .bdlc-chip {
	appearance: none;
	-webkit-appearance: none;
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	border: 1.5px solid var(--bdlc-accent);
	background: #fff;
	color: var(--bdlc-text);
	border-radius: 999px;
	padding: 8px 14px;
	margin: 0;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: background .2s, color .2s, transform .15s;
	animation: bdlc-in .3s ease both;
}
#bdlc-root .bdlc-chip:hover { background: var(--bdlc-accent); color: #fff; transform: translateY(-1px); text-decoration: none; }
#bdlc-root .bdlc-chip:focus { outline: none; }
#bdlc-root .bdlc-chip:focus-visible { outline: 2px solid var(--bdlc-primary); outline-offset: 2px; }
#bdlc-root .bdlc-chip--cta {
	background: var(--bdlc-accent);
	color: #fff;
	padding: 11px 18px;
	font-size: 14.5px;
	font-weight: 600;
	box-shadow: 0 8px 20px -8px var(--bdlc-accent);
}
#bdlc-root .bdlc-chip--cta:hover { filter: brightness(1.06); color: #fff; background: var(--bdlc-accent); }
#bdlc-root .bdlc-chip--cta svg { width: 18px; height: 18px; color: #fff; }
#bdlc-root .bdlc-chip--wa { background: #25D366; border-color: #25D366; box-shadow: 0 8px 20px -8px #25D366; }
#bdlc-root .bdlc-chip--wa:hover { background: #1DA851; border-color: #1DA851; filter: none; }
.bdlc-form { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; padding: 0; }
.bdlc-chips:empty + .bdlc-form { margin-top: 0; }
#bdlc-root .bdlc-input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 44px;
	min-height: 0;
	border: 1.5px solid #e2e5ee;
	border-radius: 999px;
	padding: 0 16px;
	margin: 0;
	font: inherit;
	font-size: 14.5px;
	line-height: normal;
	color: var(--bdlc-text);
	background: #fafbfd;
	outline: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
#bdlc-root .bdlc-input::placeholder { color: #9a9eb2; opacity: 1; }
#bdlc-root .bdlc-input:focus {
	border-color: var(--bdlc-accent);
	background: #fff;
	outline: none;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--bdlc-accent), transparent 82%);
}
#bdlc-root .bdlc-input.is-error { border-color: #e03131; animation: bdlc-shake .3s; }
@keyframes bdlc-shake {
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}
#bdlc-root .bdlc-send {
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	border-radius: 50%;
	border: 0;
	margin: 0;
	padding: 0;
	line-height: 1;
	background: var(--bdlc-primary);
	color: #fff;
	box-shadow: none;
	display: grid;
	place-items: center;
	cursor: pointer;
	flex: 0 0 auto;
	transition: background .2s, transform .15s;
}
#bdlc-root .bdlc-send:hover { background: var(--bdlc-accent); color: #fff; transform: scale(1.05); }
#bdlc-root .bdlc-send svg { width: 18px; height: 18px; color: #fff; }
.bdlc-error { font-size: 12.5px; color: #e03131; margin-top: 7px; line-height: 1.4; }
.bdlc-note { font-size: 11.5px; color: #8a8fa6; margin-top: 8px; line-height: 1.45; }
.bdlc-note:empty { display: none; }
#bdlc-root .bdlc-note a { color: var(--bdlc-accent); text-decoration: underline; }
#bdlc-root .bdlc-note a:hover { color: var(--bdlc-primary); }
#bdlc-root .bdlc-wa-quick {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	margin: 10px -14px -2px;
	padding: 9px 14px 0;
	border-top: 1px solid #eef0f4;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--bdlc-text);
	text-decoration: none;
	transition: color .2s;
}
#bdlc-root .bdlc-wa-quick svg { width: 18px; height: 18px; color: #25D366; flex: 0 0 auto; }
#bdlc-root .bdlc-wa-quick:hover { color: #128C7E; text-decoration: underline; }

/* ---------- Móvil ---------- */
@media (max-width: 520px) {
	.bdlc-window {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: var(--bdlc-radius) var(--bdlc-radius) 0 0;
		transform: translateY(100%);
	}
	.bdlc-window.is-open { transform: none; }
	#bdlc-root.is-open .bdlc-launcher { opacity: 0; pointer-events: none; }
	#bdlc-root .bdlc-input { font-size: 16px; } /* evita el zoom automático en iOS */
	.bdlc-msg { max-width: 92%; }
}
html.bdlc-lock, html.bdlc-lock body { overflow: hidden !important; }

@media (prefers-reduced-motion: reduce) {
	.bdlc *, .bdlc *::before, .bdlc *::after { animation: none !important; transition: none !important; }
}
