.emb-root, .emb-root * { box-sizing: border-box; }
.emb-root {
	--emb-bg: #0b0b0b;
	--emb-bg2: #161616;
	--emb-gold: #d4af37;
	--emb-gold-soft: #f1d98a;
	--emb-text: #f4f1ea;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

/* Reinicio de botones para que el tema de WordPress no los pise */
.emb-root button {
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	margin: 0;
	min-height: 0;
	height: auto;
	width: auto;
	-webkit-appearance: none;
	appearance: none;
}

/* Botón flotante (por defecto abajo a la IZQUIERDA; el sitio ya usa la derecha) */
.emb-root .emb-launcher {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid var(--emb-gold) !important;
	border-radius: 999px !important;
	background: var(--emb-bg) !important;
	color: var(--emb-gold-soft) !important;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .35) !important;
	transition: transform .15s ease, opacity .15s ease;
}
.emb-root .emb-launcher:hover,
.emb-root .emb-launcher:focus {
	background: var(--emb-bg) !important;
	color: var(--emb-gold-soft) !important;
	transform: translateY(-2px);
}
.emb-root .emb-launcher .emb-launcher-ico,
.emb-root .emb-launcher .emb-launcher-txt { color: var(--emb-gold-soft) !important; }
.emb-root .emb-launcher.emb-hidden { opacity: 0; pointer-events: none; transform: scale(.9); }
.emb-launcher-ico { font-size: 18px; }

/* Panel */
.emb-root .emb-panel {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 99999;
	display: none;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 40px);
	background: var(--emb-bg);
	color: var(--emb-text);
	border: 1px solid var(--emb-gold);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.emb-root .emb-panel.emb-open { display: flex; }

/* Variante: botón a la derecha (se elige en Ajustes) */
.emb-root.emb-pos-right .emb-launcher,
.emb-root.emb-pos-right .emb-panel { left: auto; right: 20px; }

.emb-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: var(--emb-bg2);
	border-bottom: 1px solid rgba(212, 175, 55, .35);
}
.emb-title { display: flex; flex-direction: column; }
.emb-title strong { color: var(--emb-gold-soft); font-size: 15px; }
.emb-title span { font-size: 12px; opacity: .75; color: var(--emb-text); }
.emb-root .emb-close {
	border: 0 !important;
	background: transparent !important;
	color: var(--emb-text) !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	box-shadow: none !important;
}

/* Mensajes */
.emb-list {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.emb-row { display: flex; }
.emb-row.emb-user { justify-content: flex-end; }
.emb-bubble {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	color: var(--emb-text);
}
.emb-assistant .emb-bubble { background: var(--emb-bg2); border: 1px solid rgba(212, 175, 55, .25); border-bottom-left-radius: 4px; }
.emb-user .emb-bubble { background: var(--emb-gold); color: #111; border-bottom-right-radius: 4px; }
.emb-bubble a { color: var(--emb-gold-soft); text-decoration: underline; }
.emb-user .emb-bubble a { color: #111; }

/* Botón de WhatsApp */
.emb-root a.emb-wa {
	align-self: flex-start;
	margin: 2px 0 4px;
	padding: 11px 18px;
	border-radius: 999px;
	background: #25d366;
	color: #06361b !important;
	font-weight: 700;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
}
.emb-root a.emb-wa:hover { filter: brightness(1.05); }

/* Escribiendo... */
.emb-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 2px;
	border-radius: 50%;
	background: var(--emb-gold);
	animation: emb-bounce 1.2s infinite ease-in-out;
}
.emb-dot:nth-child(2) { animation-delay: .15s; }
.emb-dot:nth-child(3) { animation-delay: .3s; }
@keyframes emb-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* Respuestas rápidas */
.emb-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.emb-root .emb-chip {
	padding: 7px 12px;
	border: 1px solid var(--emb-gold) !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--emb-gold-soft) !important;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	box-shadow: none !important;
}
.emb-root .emb-chip:hover { background: rgba(212, 175, 55, .15) !important; }

/* Entrada */
.emb-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba(212, 175, 55, .35);
	background: var(--emb-bg2);
	margin: 0;
}
.emb-root input.emb-input {
	flex: 1;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid rgba(212, 175, 55, .4) !important;
	border-radius: 10px !important;
	background: var(--emb-bg) !important;
	color: var(--emb-text) !important;
	font: inherit;
	box-shadow: none !important;
}
.emb-root input.emb-input:focus { outline: 2px solid var(--emb-gold); outline-offset: 0; }
.emb-root .emb-send {
	padding: 0 14px;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--emb-gold) !important;
	color: #111 !important;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: none !important;
}
.emb-root .emb-send:disabled, .emb-root .emb-input:disabled { opacity: .55; cursor: not-allowed; }

.emb-foot {
	padding: 6px 12px 10px;
	background: var(--emb-bg2);
	font-size: 11px;
	opacity: .65;
	color: var(--emb-text);
}

/* Botón de adjuntar comprobante */
.emb-root .emb-attach {
	flex: 0 0 auto;
	padding: 0 8px;
	border: 1px solid rgba(212, 175, 55, .4) !important;
	border-radius: 10px !important;
	background: transparent !important;
	color: var(--emb-gold-soft) !important;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
}
.emb-root .emb-attach:disabled { opacity: .45; cursor: not-allowed; }
.emb-foot a { color: var(--emb-gold-soft); text-decoration: underline; }

/* Móvil: el panel ocupa casi toda la pantalla */
@media (max-width: 480px) {
	.emb-root .emb-panel,
	.emb-root.emb-pos-right .emb-panel {
		right: 8px;
		left: 8px;
		bottom: 8px;
		width: auto;
		max-width: none;
		height: 78vh;
	}
	.emb-root .emb-launcher { left: 12px; bottom: 12px; padding: 11px 15px; }
	.emb-root.emb-pos-right .emb-launcher { left: auto; right: 12px; }
}
