

/* ===============================
   BOTÓN FLOTANTE (FAB)
================================ */
#bc-chat-fab{
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: var(--brand-degradado);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  z-index: 999999;
}

/* ===============================
   PANEL DEL CHAT
================================ */
.bc-chat{
  position: fixed;
  right: 22px;
  bottom: 92px;

  width: clamp(320px, 92vw, 420px);
  height: clamp(520px, 70vh, 720px);

  border-radius: 18px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;

  display: flex;
  flex-direction: column;

  transform-origin: bottom right;
  transition: transform .15s ease, opacity .15s ease, visibility .15s ease;
  z-index: 999999;
}

/* Cerrado */
.bc-chat.closed{
  opacity: 0;
  visibility: hidden;
  transform: scale(.96);
  pointer-events: none;
}

/* Abierto */
.bc-chat.open{
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

/* ===============================
   HEADER
================================ */
.bc-chat__header{
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: var(--color-logo);
  border-bottom: 1px solid var(--color-logo);
}

.bc-chat__brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.bc-chat__logo{
  width: 28px;
  height: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.bc-chat__logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bc-chat__title{
  display:flex;
  flex-direction:column;
  line-height:1.1;
  color:#fff;
}
.bc-chat__subtitle{
  font-size:12px;
  opacity:.85;
}

.bc-chat__icon{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: var(--color-logo);
  font-size: 16px;
  cursor: pointer;
}

/* ===============================
   MENSAJES
================================ */
.bc-chat__messages{
  padding: 14px;
  flex: 1;
  min-height: 0;        /* 🔥 CLAVE */
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 10px;

  background: #fff;

  /* Scroll invisible */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bc-chat__messages::-webkit-scrollbar{
  display: none;
}

.bc-msg{
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  border: 1px solid var(--color-border);
  white-space: pre-wrap;
}

/* Usuario */
.bc-msg.user{
  align-self: flex-end;
  background: #f2f4f8;
  color: var(--color-text);
}

/* Bot */
.bc-msg.bot{
  align-self: flex-start;
  background: #ffffff;
  color: var(--color-text);
}

/* ===============================
   QUICK REPLIES
================================ */
.bc-chat__quick{
  padding: 0 14px 10px 14px;
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  background: #fff;
}

.bc-chip{
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  transition: background .15s ease;
}
.bc-chip:hover{
  background: #f2f4f8;
}

/* ===============================
   INPUT
================================ */
.bc-chat__form{
  padding: 12px 14px;
  display:flex;
  align-items:center;
  gap:10px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.bc-chat__input{
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}
.bc-chat__input::placeholder{
  color: var(--color-muted);
}

.bc-chat__send{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: var(--color-logo);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}
.bc-chat__send:hover{
  background: var(--brand-degradado);
}

/* ===============================
   FOOTER
================================ */
.bc-chat__footer{
  padding: 8px 14px 12px 14px;
  font-size: 12px;
  color: var(--color-muted);
  background: #fff;
}

/* ===============================
   RESPONSIVE
================================ */

/* Tablets */
@media (max-width: 768px){
  .bc-chat{
    right: 14px;
    bottom: 86px;
  }
  #bc-chat-fab{
    right: 14px;
    bottom: 14px;
  }
}

/* Mobile */
@media (max-width: 480px){
  .bc-chat{
    left: 12px;
    right: 12px;
    bottom: 12px;

    width: auto;
    height: min(78vh, 840px);
    border-radius: 16px;
  }

  #bc-chat-fab{
    right: 12px;
    bottom: 12px;
  }
}

/* Mobile pequeño → fullscreen */
@media (max-width: 380px){
  .bc-chat{
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

/* ===============================
   COLITA ABAJO EN LA ESQUINA
================================ */

.bc-msg{
  position: relative;
  padding-bottom: 14px; /* espacio para la colita */
}

/* ===== BOT (abajo-izquierda) ===== */
.bc-msg.bot::after{
  content:"";
  position:absolute;
  bottom:-8px;
  left:12px;
  width:0;
  height:0;
  border-left:8px solid transparent;
  border-right:8px solid transparent;
  border-top:8px solid #ffffff; /* fondo bot */
}

.bc-msg.bot::before{
  content:"";
  position:absolute;
  bottom:-9px;
  left:11px;
  width:0;
  height:0;
  border-left:9px solid transparent;
  border-right:9px solid transparent;
  border-top:9px solid var(--color-border); /* borde */
}

/* ===== USER (abajo-derecha) ===== */
.bc-msg.user::after{
  content:"";
  position:absolute;
  bottom:-8px;
  right:12px;
  width:0;
  height:0;
  border-left:8px solid transparent;
  border-right:8px solid transparent;
  border-top:8px solid #f2f4f8; /* fondo user */
}

.bc-msg.user::before{
  content:"";
  position:absolute;
  bottom:-9px;
  right:11px;
  width:0;
  height:0;
  border-left:9px solid transparent;
  border-right:9px solid transparent;
  border-top:9px solid var(--color-border); /* borde */
}





