#bexie-bot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 18px 30px rgba(24, 54, 99, 0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; 
  transition: all 0.25s ease-in-out;
}

#bexie-bot-toggle:hover {
  transform: scale(1.08);
}

#bexie-bot-toggle.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

/* --- IMAGEN ROBOT --- */
#bexie-bot-toggle img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* --- VENTANA CHAT --- */
#bexie-bot {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 360px;
  max-height: 530px;
  background: #ffffff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  z-index: 9998;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  color: #1f2937;
}

#bexie-bot.open {
  transform: translateY(0);
  opacity: 1;
}

#bexie-bot.closed {
  transform: translateY(120%);
  opacity: 0;
}

/* --- CABECERA --- */
.bot-header {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}

.bot-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  transition: transform 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.bot-close:hover {
  transform: scale(1.15);
  color: #fef3c7;
}

/* --- CUERPO --- */
.bot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fffbf5;
}

/* --- MENSAJES --- */
.bot-msg {
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 85%;
  line-height: 1.5;
  font-size: 15px;
}

.bot-left {
  background: #fff;
  border: 1px solid #fde68a;
  color: #1f2937;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.1);
}

.bot-right {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  align-self: flex-end;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

/* --- BOTONES OPCIONES --- */
.bot-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.bot-opt {
  background: #fff;
  color: #1f2937;
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
}

.bot-opt:hover {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border-color: #f97316;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* ===============================
   MOBILE (ÚNICO BLOQUE LIMPIO)
   =============================== */
@media (max-width: 768px) {

  #bexie-bot-toggle {
    width: 48px;
    height: 48px;
    bottom: 85px; /* evita barra inferior */
    right: 12px;
  }

  #bexie-bot-toggle img {
    width: 70%;
    height: 70%;
  }

  #bexie-bot {
    width: 95%;
    right: 2.5%;
    bottom: 80px;
    max-height: 80vh;
    border-radius: 16px;
  }

}
/* ===== FIX DEFINITIVO MOBILE ===== */
@media (max-width: 768px) {

  #bexie-bot-toggle {
    width: 48px !important;
    height: 48px !important;
    bottom: 85px !important;
    right: 12px !important;
    padding: 6px !important;
    overflow: hidden !important;
  }

  #bexie-bot-toggle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

}


/* ══════════════════════════════════════
   BOT BEXIE — MOBILE OPTIMIZADO
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  
  #bexie-bot-toggle {
    width: 56px !important;
    height: 56px !important;
    bottom: 140px !important;   /* por encima de la barra "Ahorra 60%" */
    right: 12px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    filter: drop-shadow(0 4px 10px rgba(24, 54, 99, 0.3));
    overflow: visible !important;
  }
  
  #bexie-bot-toggle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  /* Ventana del chat ajustada para que no pise la barra inferior */
  #bexie-bot {
    width: 95%;
    right: 2.5%;
    bottom: 200px;
    max-height: calc(100vh - 220px);
    border-radius: 16px;
  }
}
