/* =========================
   SoftwareGAM IA Chat Bridge
   Skin Premium (limpio)
   ========================= */

.sgia-chat-locked{
  padding:16px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background:#fafafa;
  max-width:760px;
  margin:24px auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Contenedor principal */
.sgia-chat-embed{
  width:100%;
  max-width:760px;
  margin:24px auto;
  border:1px solid rgba(0,0,0,.08);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 14px 40px rgba(0,0,0,.10);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Header */
.sgia-chat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border-bottom:1px solid rgba(0,0,0,.06);
}

.sgia-chat-title{
  font-size:16px;
  font-weight:800;
  line-height:1.2;
}

.sgia-chat-reset{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  cursor:pointer;
  font-size:18px;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Mensajes */
.sgia-chat-messages{
  height:420px;
  min-height:360px;       /* FIX para themes que colapsan contenedores */
  display:block !important; /* FIX Divi/flex raros */
  overflow:auto;
  padding:18px;
  background:#fbfbfb;
}

/* Filas */
.sgia-msg{
  display:flex;
  margin:8px 0;
}

.sgia-user{ justify-content:flex-end; }
.sgia-assistant{ justify-content:flex-start; }

/* Burbujas */
.sgia-bubble{
  max-width:85%;
  padding:11px 13px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.06);
  font-size:14px;
  line-height:1.35;
  white-space:pre-wrap;
  word-wrap:break-word;
}

.sgia-user .sgia-bubble{
  background:#e9f2ff;
}

.sgia-assistant .sgia-bubble{
  background:#ffffff;
}

/* Input */
.sgia-chat-input{
  display:flex;
  gap:10px;
  padding:14px 16px;
  border-top:1px solid rgba(0,0,0,.06);
  background:#fff;
}

.sgia-chat-text{
  flex:1;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.12);
  outline:none;
  background:#fff;
}

.sgia-chat-text:focus{
  border-color: rgba(11,31,42,.45);
}

.sgia-chat-send{
  padding:12px 16px;
  border-radius:14px;
  border:0;
  background:#0B1F2A;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.sgia-chat-send:hover{
  opacity:.92;
}

/* Footer */
.sgia-chat-footnote{
  text-align:center;
  padding:10px 14px;
  font-size:12px;
  color:rgba(0,0,0,.55);
  border-top:1px solid rgba(0,0,0,.06);
  background:#fff;
}

/* =========================
   Burbuja flotante
   ========================= */

.sgia-bubble-wrap{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:99999;
}

.sgia-bubble-btn{
  width:54px;
  height:54px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  cursor:pointer;
  font-size:22px;
  box-shadow:0 10px 30px rgba(0,0,0,0.12);
}

.sgia-bubble-panel{
  display:none;
  position:absolute;
  right:0;
  bottom:66px;
  width:360px;
  max-width: calc(100vw - 36px);
  box-shadow:0 12px 40px rgba(0,0,0,0.18);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}

.sgia-bubble-panel .sgia-chat-messages{
  height:300px;
  min-height:260px;
}
