/*
 * chat-widget.css - Estilos del widget de chat profesional CON PROTECCIÓN CSS
 * Versión: 0.1.0 - FOUC FIX + Neutral Fallback Colors
 * Copyright © 2025 JomBotix
 * 
 * CRÍTICO: Este CSS está diseñado para integrarse en sitios de terceros
 * donde NO controlamos el CSS del host. Usa protección agresiva contra conflictos.
 */

/* ==========================================================================
   CSS RESET INTERNO - PROTECCIÓN CONTRA HOST CSS - ALTA ESPECIFICIDAD
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget,
.jombotix-chat-widget.jombotix-chat-widget *,
.jombotix-chat-widget.jombotix-chat-widget *::before,
.jombotix-chat-widget.jombotix-chat-widget *::after {
  /* Reset completo de propiedades que pueden heredarse */
  all: unset;
  box-sizing: border-box;

  /* Font stack específico del widget */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 400;

  /* Layout defaults */
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;

  /* Text defaults */
  color: inherit;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  word-spacing: normal;
  text-align: left;
  direction: ltr;

  /* Visual defaults */
  opacity: 1;
  visibility: visible;
  outline: none;
  box-shadow: none;

  /* Position defaults */
  position: static;
  z-index: auto;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;

  /* Transform defaults */
  transform: none;
  transition: none;
  animation: none;

  /* Misc */
  vertical-align: baseline;
  white-space: normal;
  word-wrap: initial;
  cursor: auto;
}

/* Elementos que necesitan display específico */
/* ==========================================================================
   Reset CSS Limpio y Escalable para Widget Third-Party
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget {
  /* Reset limpio que preserva elementos HTML naturales */
  all: initial;

  /* Restablecer solo las propiedades esenciales del contenedor */
  position: fixed !important;
  z-index: 2147483640 !important;
  box-sizing: border-box;

  /* Re-aplicar font base después del reset */
  font-family: var(--jombotix-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset específico para elementos de UI del widget (no mensajes) */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-container,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-header,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-interface,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-input,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-footer,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-buttons-container {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Reset solo para botones del widget (no elementos HTML de mensajes) */
.jombotix-chat-widget.jombotix-chat-widget button {
  cursor: pointer;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
}

/* Reset para inputs del widget */
.jombotix-chat-widget.jombotix-chat-widget input,
.jombotix-chat-widget.jombotix-chat-widget textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
}

/* ==========================================================================
   Variables CSS con Namespace Protegido
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget {
  /* Font y layout - INYECCIÓN DINÁMICA desde backend */
  --jombotix-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif; /* Fallback - será sobrescrito */
  --jombotix-max-height: 700px;
  --jombotix-width: 400px;
  --jombotix-distance-from-edge: 20px;
  --jombotix-container-border-radius: 20px; /* Fallback - será sobrescrito */
  --jombotix-header-padding: 15px;
  --jombotix-footer-padding: 5px 20px;
  --jombotix-messages-padding: 10px 10px 10px 10px;
  --jombotix-input-padding: 12px 20px 15px;
  --jombotix-input-field-border-radius: 28px; /* ✅ MD3 más redondeado */
  --jombotix-input-field-padding: 4px 12px; /* ✅ MD3 más espacio */
  --jombotix-textarea-border-radius: 28px;
  --jombotix-textarea-padding: 12px 16px;
  --jombotix-message-border-radius: 20px; /* ✅ MD3 Large corners */
  --jombotix-message-tail-radius: 4px; /* ✅ MD3 Pequeña esquina asimétrica */
  --jombotix-quick-reply-border-radius: 20px; /* ✅ MD3 Pastilla */
  --jombotix-quick-reply-padding: 9px 9px; /* ✅ MD3 Más espacio interno */

  /* Colores - Material Design 3 Palette
   * IMPORTANTE: NO hardcodear estos valores aquí
   * Se inyectan desde branding-utils.js con setProperty(..., 'important')
   * Los valores aquí son SOLO fallback si falla la carga del backend
   *
   * NOTA: Fallback usa gris neutro para evitar FOUC (Flash of Unstyled Content)
   * Si aparece gris, significa que el branding no cargó correctamente
   */
  --jombotix-color-primary: #757575; /* MD Grey 600 - Neutral fallback (evita FOUC) */
  --jombotix-color-primary-dark: #616161; /* MD Grey 700 - Darker variant */
  --jombotix-color-accent: #616161; /* MD Grey 700 - Neutral fallback */
  --jombotix-color-user-message: #757575; /* MD Grey - mensajes usuario */
  --jombotix-color-button-outline: rgba(117, 117, 117, 0.3); /* Grey fallback */
  --jombotix-color-background: #ffffff; /* ✅ Fondo blanco limpio MD3 */
  --jombotix-color-surface: #ffffff; /* ✅ Surface blanco */
  --jombotix-color-bot-message-bg: #f5f5f5; /* ✅ Gris suave para mensajes bot MD3 */
  --jombotix-color-on-primary: #ffffff;
  --jombotix-color-text-primary: rgba(0, 0, 0, 0.87);
  --jombotix-color-text-secondary: rgba(0, 0, 0, 0.6);

  /* Colores grises para modales */
  --jombotix-color-gray-light: #f5f5f5;
  --jombotix-color-gray-medium: #e0e0e0;
  --jombotix-color-gray-dark: #bdbdbd;

  /* Estados especiales - Error, Success, Warning */
  --jombotix-color-error: #f44336;
  --jombotix-color-urgent: #f44336;
  --jombotix-color-urgent-dark: #d32f2f;
  --jombotix-color-urgent-fade: rgba(244, 67, 54, 0.5);
  --jombotix-color-urgent-bg-light: rgba(244, 67, 54, 0.1);
  --jombotix-color-urgent-bg-lighter: rgba(244, 67, 54, 0.05);
  --jombotix-color-on-urgent: #ffffff;

  --jombotix-color-success: #4caf50;
  --jombotix-color-on-success: #ffffff;

  --jombotix-color-warning: #ff9800;
  --jombotix-color-warning-dark: #f57c00;
  --jombotix-color-on-warning: #ffffff;

  --jombotix-color-info: #2196f3;

  --jombotix-color-disabled-bg: #e0e0e0;
  --jombotix-color-disabled-text: rgba(0, 0, 0, 0.4);

  /* UI Elements adicionales */
  --jombotix-border-color: #e0e0e0;
  --jombotix-header-button-bg: rgba(224, 224, 224, 0.5);
  --jombotix-header-button-hover-bg: rgba(224, 224, 224, 0.5);
  --jombotix-scrollbar-color: rgba(0, 0, 0, 0.15);
  --jombotix-scrollbar-hover-color: rgba(0, 0, 0, 0.2);
  --jombotix-overlay-bg: rgba(0, 0, 0, 0.4);
  --jombotix-ripple-color: rgba(55, 71, 79, 0.2);

  /* Sombras especializadas */
  --jombotix-shadow-urgent: 0 2px 8px rgba(244, 67, 54, 0.2);
  --jombotix-shadow-urgent-strong: 0 4px 12px rgba(244, 67, 54, 0.4);
  --jombotix-shadow-warning: 0 3px 10px rgba(255, 152, 0, 0.3);

  /* Tipografía adicional */
  --jombotix-font-family-mono: 'Courier New', monospace;

  /* Border radius adicionales */
  --jombotix-logo-border-radius: 12px;
  --jombotix-quick-reply-border-radius-mobile: 20px;

  /* Color de sombra como RGB para usar con rgba() */
  --jombotix-shadow-color: 84, 110, 122; /* RGB de --jombotix-color-accent */

  /* Z-index hierarchy específica para evitar conflictos */
  --jombotix-z-base: 2147483640;
  --jombotix-z-toggle: 2147483641;
  --jombotix-z-container: 2147483642;
  --jombotix-z-header: 2147483643;
  --jombotix-z-messages: 2147483644;
  --jombotix-z-input: 2147483645;
  --jombotix-z-buttons: 2147483646;
  --jombotix-z-overlay: 2147483647;

  /* Sombras */
  --jombotix-shadow-2dp: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
  --jombotix-shadow-4dp: 0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --jombotix-shadow-8dp: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
    0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);

  /* Base styles aplicados al contenedor root */
  font-family: var(--jombotix-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Contenedor Principal y Animaciones
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-container {
  /* Propiedades críticas que sí necesitan !important */
  position: fixed !important;
  z-index: var(--jombotix-z-container) !important;

  /* Resto de propiedades sin !important */
  bottom: 100px;
  right: var(--jombotix-distance-from-edge);
  width: var(--jombotix-width);
  max-height: var(--jombotix-max-height);
  height: calc(100vh - 120px);
  background: var(--jombotix-color-background);
  border-radius: var(--jombotix-container-border-radius);
  box-shadow: var(--jombotix-shadow-8dp);
  overflow: hidden;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-container.jombotix-expanded {
  width: 680px;
  height: 88vh;
  max-height: 88vh !important; /* Sobrescribir max-height cuando está expandido */
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-container.jombotix-position-left {
  right: auto;
  left: var(--jombotix-distance-from-edge);
  transform-origin: bottom left;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-container.jombotix-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
  Cabecera
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--jombotix-header-padding);
  /* 🎨 Gradiente sutil con paleta de marca */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-accent-dark) 0%,
    var(--jombotix-color-primary) 100%
  );
  color: var(--jombotix-color-on-primary);
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  z-index: var(--jombotix-z-header);
  /* 🌟 Sombra sutil para separar del contenido */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
  overflow: hidden;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-text {
  display: flex;
  flex-direction: column;
  padding-left: 10px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-name {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  color: white;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-brand-subtitle {
  font-size: 13px;
  opacity: 0.8;
  white-space: nowrap;
  color: white;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-buttons-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-header-button {
  /*color: var(--jombotix-color-on-primary);*/
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  /* 🌟 Transiciones suaves y modernas */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.85;
  position: relative;
  overflow: hidden;
  /* 🎨 Sombra sutil */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-header-button:hover {
  background: var(--jombotix-header-button-hover-bg, rgba(224, 224, 224, 0.5));
  opacity: 1;
  transform: translateY(-1px);
  /* 🌟 Sombra más pronunciada en hover */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-header-button:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ✨ Efecto de brillo sutil en botones del header */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-header-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-header-button:hover::before {
  left: 100%;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-header-button
  .jombotix-material-icons-outlined {
  font-size: 18px;
  line-height: 1;
  color: var(--jombotix-color-on-primary);
  display: inline-block;
  cursor: pointer;
}

/* ==========================================================================
   Interfaz del Chat y Mensajes
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-interface {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--jombotix-z-messages);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: var(--jombotix-messages-padding);
  display: flex;
  flex-direction: column;
  /* gap: 6px; comentado por pruebas para espacio */
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message-wrapper {
  display: flex; /* ✅ Activado para layout horizontal avatar + mensaje */
  gap: 4px;
  max-width: 95%;
  align-items: flex-end; /* ✅ Alinea avatar abajo como WhatsApp */
  margin-bottom: 6px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message-wrapper.bot {
  align-self: flex-start;
  padding-right: 10px;
  margin-top: 0; /* ✅ Reset margin */
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message-wrapper.user {
  align-self: flex-end;
  padding-left: 30px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-message-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  min-width: 0;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-bot-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  /* Alineación controlada por wrapper (align-items: flex-end) */
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message {
  text-align: left;
  padding: 12px 16px; /* ✅ MD3 Medium internal spacing */
  border-radius: var(--jombotix-message-border-radius);
  max-width: 100%;
  word-wrap: break-word;
  font-size: 14px; /* ✅ MD3 Body text size */
  line-height: 1.5; /* ✅ MD3 Readable line height */
  animation: jombotix-message-in 0.3s ease;
}

@keyframes jombotix-message-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.user {
  background-color: var(--jombotix-color-user-message);
  color: white;
  /* ✅ Estilo WhatsApp/Telegram: esquina inferior derecha plana (0px) */
  border-radius: 20px 20px 0px 20px;
  /* ✅ MD3 Elevation Level 1 */
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot {
  background-color: var(--jombotix-color-bot-message-bg); /* ✅ Gris suave MD3 */
  color: var(--jombotix-color-text-primary);
  /* ✅ Estilo WhatsApp/Telegram: esquina inferior izquierda plana (0px) */
  border-radius: 20px 20px 20px 0px;
  /* ✅ MD3 Elevation Level 1 más sutil */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-message
  .jombotix-timestamp {
  display: block;
  font-size: 10px;
  color: white;
  text-align: right;
  margin-top: 4px;
  opacity: 0.7;
}

/* ==========================================================================
   Indicador de "Escribiendo..." (Mejorado con frases rotativas)
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-indicator {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  background-color: var(--jombotix-color-surface);
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
  min-height: 40px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-dots .jombotix-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  animation: jombotix-typing-blink 1.4s infinite both;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-typing-dots
  .jombotix-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-typing-dots
  .jombotix-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-text {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  font-style: italic;
  transition: opacity 0.3s ease;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes jombotix-typing-blink {
  50% {
    opacity: 0.5;
  }
}

/* ==========================================================================
   Input de Chat
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-input {
  padding: 15px 15px 15px;
  /* ✅ MD3: Eliminar border-top para diseño más limpio */
  border-top: none;
  background-color: var(--jombotix-color-background);
  z-index: var(--jombotix-z-input);
  width: 100%;
  transition: all 0.3s ease;
}

/* Ensure proper layout for the input field */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-input-field {
  display: flex;
  align-items: center;
  /* ✅ MD3: Background gris claro para contraste sutil */
  background-color: #f5f5f5;
  /* ✅ MD3: Sin borde, diseño más limpio */
  border: none;
  border-radius: var(--jombotix-input-field-border-radius);
  padding: var(--jombotix-input-field-padding);
  margin: 0;
  /* ✅ MD3: Sombra más sutil (Elevation Level 0) */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-input-field:focus-within {
  /* ✅ MD3: Focus con background más claro y sombra más notoria */
  background-color: #f9f9f9;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* Input area styling */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--jombotix-color-text-primary);
  resize: none;
  outline: none;
  min-height: 41px;
  max-height: 76px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  word-wrap: break-word;
  transition: height 0.2s ease;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-textarea:focus {
  outline: none;
  /* ✅ MD3: Focus transparente para mantener consistencia visual */
  background-color: transparent;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-send-button {
  /* 🎨 Gradiente con paleta de marca (gris azulado) */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-accent) 0%,
    var(--jombotix-color-primary) 100%
  );
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  min-width: 38px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  margin: 0 0 0 6px;
  padding: 0;
  font-weight: normal;
  /* 🌟 Sombra elegante con colores de marca */
  box-shadow: 0 4px 12px rgba(var(--jombotix-shadow-color), 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* 🔧 Estilos específicos para el icono de enviar */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-send-button
  .jombotix-icon {
  width: 18px;
  height: 18px;
  margin-left: 1px;
  z-index: 1;
  position: relative;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-send-button:disabled {
  background: linear-gradient(
    135deg,
    var(--jombotix-color-gray-medium) 0%,
    var(--jombotix-color-gray-dark) 100%
  );
  cursor: not-allowed;
  transform: scale(1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-send-button:not(:disabled):hover {
  /* 🚀 Hover con gradiente más intenso usando paleta de marca */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-primary-dark) 100%,
    var(--jombotix-color-accent-dark) 0%  
  );
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(var(--jombotix-shadow-color), 0.4),
    0 4px 8px rgba(0, 0, 0, 0.15);
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-send-button:not(:disabled):active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 2px 8px rgba(var(--jombotix-shadow-color), 0.3),
    0 1px 4px rgba(0, 0, 0, 0.1);
}

/* ✨ Efecto de brillo sutil en el botón */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-send-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-send-button:hover::before {
  left: 100%;
}

/* ==========================================================================
   Scrollbar Styling - Modern & Professional
   ========================================================================== */
/* Webkit Browsers (Chrome, Safari, newer Edge) */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-messages::-webkit-scrollbar,
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-textarea::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-messages::-webkit-scrollbar-track,
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-textarea::-webkit-scrollbar-track {
  background: transparent;
  margin: 3px;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-messages::-webkit-scrollbar-thumb,
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-textarea::-webkit-scrollbar-thumb {
  background: var(--jombotix-scrollbar-color, rgba(0, 0, 0, 0.15));
  border-radius: 20px;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-messages::-webkit-scrollbar-thumb:hover,
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-textarea::-webkit-scrollbar-thumb:hover {
  background: var(--jombotix-scrollbar-hover-color, rgba(0, 0, 0, 0.2));
}

/* Firefox */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-messages,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--jombotix-scrollbar-color, rgba(0, 0, 0, 0.15))
    transparent;
}

/* ==========================================================================
   Footer y Botón Toggle
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--jombotix-footer-padding);
  font-size: 12px;
  color: var(--jombotix-color-text-secondary);
  background-color: var(--jombotix-color-surface);
  flex-shrink: 0;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-footer a {
  color: var(--jombotix-color-text-secondary);
  text-decoration: none;
  font-weight: 400;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   @SCOPE - Para browsers modernos (Chrome 118+, Safari 17.4+)
   ================================================================= */

@scope (.jombotix-chat-widget) {
  /* Root container */
  :scope {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
      'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Elementos base */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
  }

  /* Indicador de conexión */
  .jombotix-connection-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
  }

  .jombotix-connection-status.jombotix-online {
    background-color: #4caf50;
    box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
    animation: jombotix-pulse-online 2s infinite;
  }

  .jombotix-connection-status.jombotix-checking {
    background-color: #2196f3;
    animation: jombotix-pulse-checking 1s infinite;
  }

  .jombotix-connection-status.jombotix-connecting {
    background-color: #ffc107;
    animation: jombotix-pulse 1.5s infinite;
  }

  .jombotix-connection-status.jombotix-offline {
    background-color: #9e9e9e;
    animation: none;
  }

  .jombotix-connection-status.jombotix-error {
    background-color: #f44336;
    animation: jombotix-pulse-error 1s infinite;
  }

  .jombotix-connection-status.jombotix-unknown {
    background-color: #ffc107;
    animation: jombotix-pulse 2s infinite;
  }

  /* Contenedor principal */
  .jombotix-chat-container {
    position: fixed;
    z-index: var(--jombotix-z-container);
    bottom: 100px;
    right: var(--jombotix-distance-from-edge);
    width: var(--jombotix-width);
    max-height: var(--jombotix-max-height);
    background: var(--jombotix-color-background);
    border-radius: var(--jombotix-container-border-radius);
    box-shadow: var(--jombotix-shadow-8dp);
  }

  /* Contenedor expandido */
  .jombotix-chat-container.jombotix-expanded {
    width: 680px;
    height: 88vh;
    max-height: 88vh;
  }

  /* Elementos interactivos */
  button {
    cursor: pointer;
    background: none;
    border: none;
  }

  /* Asegurar que los iconos dentro de botones tengan cursor pointer */
  button .jombotix-material-icons-outlined,
  .jombotix-header-button .jombotix-material-icons-outlined {
    cursor: pointer;
  }

  input,
  textarea {
    -webkit-appearance: none;
    appearance: none;
    font-family: var(--jombotix-font-family);
    border: 1px solid var(--jombotix-border);
    border-radius: var(--jombotix-radius);
  }

  /* Mensajes - CORREGIDAS */
  .jombotix-chat-message {
    font-family: var(--jombotix-font-family);
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: var(--jombotix-message-border-radius);
    overflow-wrap: break-word;
    width: 100%;
  }

  .jombotix-chat-message.bot {
    background: #f5f5f5;
    color: #333;
  }

  .jombotix-chat-message.user {
    background: var(--jombotix-color-user-message);
    color: white;
    margin-left: auto;
  }

  .jombotix-chat-message-wrapper.bot {
    align-self: flex-start;
  }

  .jombotix-chat-message-wrapper.user {
    align-self: flex-end;
  }
}

/* Fallback para browsers sin @scope */
@supports not (selector(@scope)) {
  /* Ya cubierto por nuestros selectores de alta especificidad */
}

/* ==========================================================================
   RESPONSIVE - Sin !important abusivo
   ========================================================================== */
@media (max-width: 480px) {
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none; /* Eliminar limitación de altura */
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    border-radius: 0;
  }

  /* Asegurar que el modo expandido funcione bien en móvil */
  .jombotix-chat-widget.jombotix-chat-widget
    .jombotix-chat-container.jombotix-expanded {
    width: 100vw;
    height: 100vh;
    max-height: none !important; /* Sin limitación de altura */
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    border-radius: 0;
  }

  .jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-messages {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }

  /* Ajustar altura de mensajes en modo expandido en móvil */
  .jombotix-chat-widget.jombotix-chat-widget
    .jombotix-chat-container.jombotix-expanded
    .jombotix-chat-messages {
    max-height: calc(100vh - 180px);
  }

  /* Ocultar botón de expandir en móvil */
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-expand-chat {
    display: none;
  }

  /* Ajustes para la burbuja flotante en móvil */
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle {
    bottom: 15px;
    right: 15px;
    width: 56px;
    height: 56px;
  }

  .jombotix-chat-widget.jombotix-chat-widget
    .jombotix-chat-toggle
    .jombotix-material-icons-outlined {
    font-size: 22px;
  }

  /* 🎭 Mejorar typing indicator en mobile */
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-text {
    font-size: 12px;
    max-width: 200px;
  }

  .jombotix-chat-widget.jombotix-chat-widget .jombotix-typing-content {
    gap: 8px;
  }
}

/* ==========================================================================
   Chat Toggle Button - REDISEÑO COMPLETO MODERNO
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle {
  /* Propiedades críticas que sí necesitan !important */
  position: fixed !important;
  z-index: var(--jombotix-z-toggle) !important;

  /* 🎨 FOUC FIX: Invisible hasta que branding esté listo */
  opacity: 0;
  transition: opacity 0.3s ease-out, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* 🎨 Diseño moderno y elegante */
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 20px; /* Redondeado elegante, no circular */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-primary) 0%,
    var(--jombotix-color-accent) 100%
  );
  /* 🌟 Sombra elegante con colores de marca */
  box-shadow: 0 8px 25px rgba(var(--jombotix-shadow-color), 0.25),
    0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  /* 🎯 Borde sutil para definición */
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ✅ FOUC FIX: Mostrar botón cuando branding está listo */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle.jombotix-ready,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle.jombotix-fallback {
  opacity: 1;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle:hover {
  transform: translateY(-3px) scale(1.02);
  border-radius: 24px; /* Más redondeado en hover */
  /* 🚀 Sombra más intensa en hover */
  box-shadow: 0 12px 35px rgba(var(--jombotix-shadow-color), 0.35),
    0 6px 18px rgba(0, 0, 0, 0.2);
  background: linear-gradient(
    135deg,
    var(--jombotix-color-accent-dark) 0%,
    var(--jombotix-color-primary) 100%
  );
  border-color: rgba(255, 255, 255, 0.2);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 6px 20px rgba(var(--jombotix-shadow-color), 0.3),
    0 3px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🎯 Estado abierto - Mantener colores atractivos */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle.jombotix-open {
  border-radius: 16px; /* Menos redondeado cuando está abierto */
  /* 🎨 Mismo gradiente atractivo - no invitar a cerrar */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-primary) 0%,
    var(--jombotix-color-accent) 100%
  );
  box-shadow: 0 6px 20px rgba(var(--jombotix-shadow-color), 0.4),
    0 3px 10px rgba(0, 0, 0, 0.2);
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-toggle.jombotix-open:hover {
  border-radius: 20px;
  transform: translateY(-2px) scale(1.01);
  /* 🚀 Mismo hover elegante que el estado cerrado */
  background: linear-gradient(
    135deg,
    var(--jombotix-color-accent-dark) 0%,
    var(--jombotix-color-primary) 100%
  );
}

/* 🎨 NUEVO ICONO MINIMALISTA - Chat Bubbles */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3c5.5 0 10 3.58 10 8s-4.5 8-10 8c-1.24 0-2.43-.18-3.53-.5C5.55 21 2 21 2 21c2.33-2.33 2.7-3.9 2.75-4.5C3.05 15.07 2 13.13 2 11c0-4.42 4.5-8 10-8z'/%3E%3C/svg%3E")
    no-repeat center;
  background-size: contain;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; /* 🎯 Permitir que el cursor del botón padre funcione */
}

/* 🌟 Líneas indicadoras de estado (3 líneas que se animan) */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle::before {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 16px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12' fill='white'%3E%3Cpath d='M0 2h16v2H0V2zm0 4h12v2H0V6zm0 4h8v2H0v-2z'/%3E%3C/svg%3E")
    no-repeat center;
  background-size: contain;
  opacity: 0.7;
  z-index: 2;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; /* 🎯 Permitir que el cursor del botón padre funcione */
}

/* 🔄 Estado abierto - Transformar líneas en X */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-toggle.jombotix-open::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.854 4.854a.5.5 0 0 0-.708-.708L8 8.293 3.854 4.146a.5.5 0 1 0-.708.708L7.293 9l-4.147 4.146a.5.5 0 0 0 .708.708L8 9.707l4.146 4.147a.5.5 0 0 0 .708-.708L8.707 9l4.147-4.146z'/%3E%3C/svg%3E")
    no-repeat center;
  background-size: 12px 12px;
  transform: rotate(180deg);
  opacity: 0.9;
}

/* ✨ Efecto de onda sutil en hover */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle:hover::after {
  transform: scale(1.1);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle:hover::before {
  opacity: 1;
}

/* 🌊 Animación de pulso suave cuando está cerrado */
@keyframes jombotix-chat-breath {
  0%,
  100% {
    box-shadow: 0 8px 25px rgba(var(--jombotix-shadow-color), 0.25),
      0 4px 12px rgba(0, 0, 0, 0.15);
  }
  50% {
    box-shadow: 0 12px 35px rgba(var(--jombotix-shadow-color), 0.35),
      0 6px 18px rgba(0, 0, 0, 0.2);
  }
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-toggle:not(.jombotix-open) {
  animation: jombotix-chat-breath 4s ease-in-out infinite;
  animation-delay: 3s; /* Empezar después de 3 segundos */
}

/* 🎯 Ocultar iconos antiguos */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-toggle .jombotix-icon,
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-toggle
  .jombotix-material-icons-outlined {
  display: none;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-unread-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 500;
  background-color: var(--jombotix-color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  padding: 2px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-connection-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
  position: relative;
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

/* Estado online con efecto de pulso tipo radar/sonar */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-connection-status.jombotix-online {
  background-color: #4caf50;
  box-shadow: 0 0 0 rgba(76, 175, 80, 0.4);
  animation: jombotix-pulse-online 2s infinite;
}

/* Eliminamos el pseudo-elemento y usamos box-shadow para el efecto */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-connection-status.jombotix-connecting {
  background-color: #ffc107;
  animation: jombotix-pulse 1.5s infinite;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-connection-status.jombotix-offline {
  background-color: #f44336;
}

/* ==========================================================================
   Ripple Effect & Keyframes
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: jombotix-ripple 0.6s linear;
  pointer-events: none;
}

@keyframes jombotix-ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Animación de pulso estándar */
@keyframes jombotix-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Animación de pulso para el estado online usando box-shadow */
@keyframes jombotix-pulse-online {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* Animación de pulso para el estado checking */
@keyframes jombotix-pulse-checking {
  0% {
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.3);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    transform: scale(1);
  }
}

/* Animación de pulso para el estado error */
@keyframes jombotix-pulse-error {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    background-color: #f44336;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(244, 67, 54, 0.3);
    background-color: #ff5722;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    background-color: #f44336;
  }
}

/* Animación antigua removida - ahora usamos jombotix-chat-breath */

/* ==========================================================================
   Corrección para el warning de overflow
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget img,
.jombotix-chat-widget.jombotix-chat-widget video,
.jombotix-chat-widget.jombotix-chat-widget canvas {
  max-width: 100%;
  height: auto;
  overflow: hidden;
}

/* ==========================================================================
   Material Icons - Google Fonts CDN (Loaded by config-loader.js)
   ========================================================================== */
/* ✅ Material Icons base styles */
.jombotix-chat-widget.jombotix-chat-widget .material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px; /* Default size */
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  vertical-align: middle;
  /* ✅ Support for all WebKit browsers */
  -webkit-font-smoothing: antialiased;
  /* ✅ Support for Safari and Chrome */
  text-rendering: optimizeLegibility;
  /* ✅ Support for Firefox */
  -moz-osx-font-smoothing: grayscale;
  /* ✅ Support for IE */
  font-feature-settings: 'liga';

  /* Color */
  color: currentColor;
  pointer-events: none;
}

/* ✅ MD3 Icon sizes */
.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-15 {
  font-size: 15px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-18 {
  font-size: 18px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-20 {
  font-size: 20px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-24 {
  font-size: 24px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-28 {
  font-size: 28px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-36 {
  font-size: 36px;
}

.jombotix-chat-widget.jombotix-chat-widget .material-icons.md-48 {
  font-size: 48px;
}

/* ==========================================================================
   DEPRECATED: Legacy SVG Icons (kept for backward compatibility)
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 1;
  vertical-align: middle;
  fill: currentColor;
  pointer-events: none;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon.jombotix-icon-sm {
  width: 20px;
  height: 20px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon.jombotix-icon-lg {
  width: 28px;
  height: 28px;
}

/* Chat icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-chat {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14h-4l-2 2-2-2H4V4h16v12z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Close icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Send icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-send {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Refresh icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-refresh {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Expand icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-expand {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Compress icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-compress {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Home icon - Reset chat to initial state */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-home {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* DEPRECATED - Mantener por compatibilidad pero marcar como obsoleto */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-material-icons-outlined {
  /* Fallback a texto cuando no hay Material Icons */
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-style: normal;
  font-size: 18px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;

  /* Mostrar texto de respaldo */
  color: currentColor;
}

/* Respaldos de texto para compatibilidad */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-material-icons-outlined:before {
  content: attr(data-fallback);
}

/* Asegurar que los iconos del header se muestran correctamente */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-header-button
  .jombotix-icon {
  width: 23px;
  height: 23px;
}

/* Asegurar que el icono de enviar se muestra correctamente */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-send-button
  .jombotix-icon {
  width: 18px !important;
  height: 18px !important;
  margin-left: 1px;
  z-index: 1;
  position: relative;
}

/* Asegurar que los iconos del botón de chat se muestran correctamente */
.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-toggle
  .jombotix-icon {
  width: 24px;
  height: 24px;
}

/* Phone icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02L6.62 10.79z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Email icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Calendar icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-calendar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Check icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-check {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Arrow back icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-arrow-back {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Person icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-person {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Info icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-info {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Medical icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-medical {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 8h-2v3h-3v2h3v3h2v-3h3v-2h-3V8zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Schedule icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-schedule {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Question icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-question {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Delete/Trash icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-delete {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Minimize icon */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-minimize {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23424242' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M20 12H4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Check/Confirm icon for cancel button */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-icon-check-circle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ==========================================================================
   Modal de Confirmación - Diseño Premium
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget.jombotix-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.4) !important; /* Más sutil y menos opresivo */
  backdrop-filter: blur(2px) !important; /* Blur más ligero */
  z-index: 2147483650 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-family: var(--jombotix-font-family) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget.jombotix-modal-overlay.jombotix-modal-show {
  opacity: 1 !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget.jombotix-modal-overlay.jombotix-modal-hide {
  opacity: 0 !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal {
  background: white !important;
  border-radius: 20px !important; /* Más redondeado y elegante */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1) !important;
  max-width: 380px !important;
  width: 90% !important;
  margin: 20px !important;
  transform: scale(0.95) translateY(10px) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow: hidden !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-show
  .jombotix-modal {
  transform: scale(1) translateY(0) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-hide
  .jombotix-modal {
  transform: scale(0.95) translateY(10px) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-header {
  background: linear-gradient(
    135deg,
    var(--jombotix-color-primary) 0%,
    var(--jombotix-color-accent) 100%
  ) !important;
  padding: 24px 28px 20px 28px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-header::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%
  ) !important;
  pointer-events: none !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-header
  h3 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: white !important;
  font-family: var(--jombotix-font-family) !important;
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-header
  h3::before {
  content: '' !important;
  width: 24px !important;
  height: 24px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  flex-shrink: 0 !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-body {
  padding: 20px 15px !important;
  background: white !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-body
  p {
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #4a5568 !important;
  font-family: var(--jombotix-font-family) !important;
  text-align: center !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-actions {
  padding: 10px 20px 20px 20px !important;
  display: flex !important;
  gap: 10px !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  background: white !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 11px 18px !important;
  border-radius: 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  font-family: var(--jombotix-font-family) !important;
  text-decoration: none !important;
  outline: none !important;
  min-width: 110px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  ) !important;
  transition: left 0.5s !important;
  pointer-events: none !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn:hover::before {
  left: 100% !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn:focus {
  /* outline: 2px solid var(--jombotix-color-accent) !important; commented by tests */
  /* outline-offset: 2px !important; commented by tests */
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn:active {
  transform: translateY(0) scale(0.96) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-primary {
  background: linear-gradient(
    135deg,
    var(--jombotix-color-accent) 0%,
    var(--jombotix-color-primary) 100%
  ) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(var(--jombotix-shadow-color), 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(var(--jombotix-shadow-color), 0.4),
    0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-secondary {
  background: linear-gradient(
    135deg,
    var(--jombotix-color-gray-light) 0%,
    var(--jombotix-color-gray-medium) 100%
  ) !important;
  color: #424242 !important;
  border: 1px solid #9e9e9e !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-secondary:hover {
  background: linear-gradient(
    135deg,
    var(--jombotix-color-gray-medium) 0%,
    var(--jombotix-color-gray-dark) 100%
  ) !important;
  border-color: #757575 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

/* 🎨 Botón de peligro (Borrar todo) */
.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid transparent !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.jombotix-chat-widget.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-modal-btn-danger:active {
  transform: translateY(0) scale(0.96) !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3) !important;
}

/* =====================================
   ERROR HANDLER BUTTONS
   ===================================== */

/* Botón de reintentar error */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-retry-button {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
  color: white !important;
  border: none !important;
  padding: 12px 20px !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3) !important;
  margin: 8px 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-retry-button:hover {
  background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4) !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-retry-button:active {
  transform: translateY(0px) !important;
  box-shadow: 0 2px 10px rgba(255, 152, 0, 0.3) !important;
}

/* Botones de contacto de emergencia */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-button {
  border: none !important;
  padding: 14px 20px !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  margin: 6px 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  text-decoration: none !important;
  min-width: 140px !important;
  justify-content: center !important;
}

/* Botón de teléfono */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-phone {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-phone:hover {
  background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

/* Botón de email */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-email {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3) !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-email:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4) !important;
}

/* Botón de WhatsApp */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3) !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-whatsapp:hover {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4) !important;
}

/* Efectos comunes para todos los botones de contacto */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-button:active {
  transform: translateY(0px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
}

/* Animación de aparición para botones de error */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-retry-button,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-button {
  animation: jombotix-error-button-appear 0.5s ease-out !important;
}

@keyframes jombotix-error-button-appear {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0px) scale(1);
  }
}

/* Estados responsive para móviles */
@media (max-width: 480px) {
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-retry-button,
  .jombotix-chat-widget.jombotix-chat-widget .jombotix-contact-button {
    width: 100% !important;
    margin: 6px 0 !important;
    min-width: unset !important;
  }
}

/* ==========================================================================
   Estilos para contenido HTML en mensajes del bot
   ========================================================================== */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  display: block;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-message.bot
  p:last-child {
  margin-bottom: 0;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot ol,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot ul {
  margin: 8px 0 12px 0;
  line-height: 1.6;
  display: block;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot ol {
  list-style-type: decimal;
  list-style-position: inside;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot ul {
  list-style-type: disclosure-closed;
  list-style-position: inside;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot li {
  margin: 4px 0px 5px 5px;
  line-height: 1.5;
  display: list-item;
}

/* Párrafos dentro de elementos de lista - sin margin extra */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot li p {
  margin: 0;
  line-height: 1.5;
  display: inline;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot strong,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot b {
  font-weight: 600;
  color: var(--jombotix-color-text-primary);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot a {
  color: #007acc;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: pointer;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot a:hover {
  color: #005a99;
  text-decoration: underline;
  background-color: rgba(0, 122, 204, 0.1);
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot em,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot i {
  font-style: italic;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot code {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 20px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot pre {
  background: rgba(0, 0, 0, 0.1);
  padding: 8px 12px;
  border-radius: 20px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  margin: 8px 0;
}

.jombotix-chat-widget.jombotix-chat-widget
  .jombotix-chat-message.bot
  blockquote {
  border-left: 3px solid var(--jombotix-color-accent);
  padding: 8px 0 8px 12px;
  margin: 8px 0;
  font-style: italic;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0 4px 4px 0;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h1,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h2,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h3,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h4,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h5,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h6 {
  margin: 12px 0 8px 0;
  font-weight: 600;
  color: var(--jombotix-color-text-primary);
  line-height: 1.3;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h1 {
  font-size: 1.4em;
}
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h2 {
  font-size: 1.3em;
}
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h3 {
  font-size: 1.2em;
}
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h4 {
  font-size: 1.1em;
}
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h5 {
  font-size: 1.05em;
}
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot h6 {
  font-size: 1em;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  margin: 12px 0;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot th,
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot td {
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  text-align: left;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-message.bot th {
  background: rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

/* ==========================================================================
   Botón discreto (link-subtle) para acciones secundarias como "cancelar"
   ========================================================================== 
.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle {
  /* Eliminar el estilo de botón, hacerlo parecer un link 
  background: transparent !important;
  background-color: transparent !important;  
  box-shadow: none !important;
  padding: 1px 2px !important;
  font-size: 12px !important;
  color: rgba(0, 0, 0, 0.4) !important;
  text-decoration: none;
  font-weight: 400 !important;
  transition: color 0.2s ease;
  /* Prevenir cualquier overlay o fondo heredado 
  outline: none !important;
}*/
/*
.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle:hover {
  color: rgba(0, 0, 0, 0.6) !important;
  background: transparent !important;
  background-color: var(--jombotix-color-primary) !important;
  text-decoration: underline;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle:active {
  color: rgba(0, 0, 0, 0.7) !important;
  background: transparent !important;
  background-color: transparent !important;
}

.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle:focus {
  color: rgba(0, 0, 0, 0.6) !important;
  background: transparent !important;
  background-color: transparent !important;
  outline: none !important;
}*/
/*
.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle:focus-visible {
   Accesibilidad: outline solo para navegación por teclado 
  outline: 1px dotted rgba(0, 0, 0, 0.3) !important;
  outline-offset: 2px !important;
  background: transparent !important;
  background-color: transparent !important;
}*/

.jombotix-chat-widget.jombotix-chat-widget .jombotix-btn-link-subtle:disabled {
  color: rgba(0, 0, 0, 0.2) !important;
  background: transparent !important;
  background-color: transparent !important;
  cursor: not-allowed !important;
  display: none !important;
}

/* Selector de máxima especificidad para sobrescribir CUALQUIER estilo heredado
   Combina: button HTML + múltiples clases + estado disabled 
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle,
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle.jombotix-disabled,
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle:disabled,
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle[disabled] {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}*/

/* Estados interactivos con máxima especificidad 
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle:hover,
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle:active,
.jombotix-chat-widget.jombotix-chat-widget button.jombotix-chat-quick-reply.jombotix-btn-link-subtle:focus {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}*/

/* ==========================================================================
   Grupo de botones (button-group) - Integración visual del botón cancelar
   ========================================================================== */
/* Estilos base para grupos de botones (CRÍTICO: NO comentar - afecta a quick-replies) */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Integración visual del botón cancelar dentro del mensaje del bot */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-message-content-wrapper {
  position: relative;
}

/* ✅ REFACTORIZADO: Botón cancel SIEMPRE en esquina superior derecha
   Independientemente de si hay otros botones o no */
.jombotix-chat-widget.jombotix-chat-widget .jombotix-chat-button-group #cancel {
  position: absolute;
  bottom: -25px;
  right: -25px;
  margin: 0px;
  padding: 1px 2px;
  pointer-events: auto;
  z-index: 1;
}