/* ==========================================================================
   ALEXANDRIA - EL CHAT DE SOPORTE (estilo)
   ========================================================================== */

/* -------------------- EL BOTON FLOTANTE -------------------- */
.chatBotonFlotante {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem 1.3rem;
  background: linear-gradient(180deg, #ffd98a 0%, #f8b700 55%, #c98c00 100%);
  border: 1px solid #ffe9b8;
  border-radius: 50px;
  color: #2a1a04;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 22px rgba(248, 183, 0, .45);
  transition: transform .16s ease, box-shadow .16s ease, opacity .2s ease;
}
.chatBotonFlotante:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(248, 183, 0, .6);
}
.chatBotonFlotante.oculto { opacity: 0; pointer-events: none; }
.chatIcono { font-size: 1.2rem; line-height: 1; }

@media (max-width: 620px) {
  .chatBotonFlotante { right: 1rem; bottom: 1rem; padding: .8rem 1rem; }
  .chatEtiqueta { display: none; }
  .chatIcono { font-size: 1.5rem; }
}

/* -------------------- LA VENTANA -------------------- */
.chatVentana {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 850;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 2rem));
  height: min(620px, calc(100vh - 2rem));
  background: linear-gradient(180deg, #131b25, #0a0f15);
  border: 1px solid rgba(248, 183, 0, .45);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(.98);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.chatVentana.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.chatCabecera {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1rem;
  background: linear-gradient(180deg, rgba(248, 183, 0, .16), rgba(248, 183, 0, .05));
  border-bottom: 1px solid rgba(248, 183, 0, .3);
}
.chatAvatar {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: linear-gradient(180deg, #ffd98a, #f8b700);
  border-radius: 50%;
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.chatCabecera strong { display: block; color: #fff; font-size: .98rem; }
.chatCabecera small { display: block; color: #a8b8c8; font-size: .76rem; }
.chatCerrar {
  margin-left: auto;
  width: 34px; height: 34px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  color: #c8d6e4;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.chatCerrar:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* Los mensajes */
.chatCuerpo {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.chatMsg { max-width: 92%; padding: .7rem .9rem; border-radius: 13px; font-size: .9rem; line-height: 1.55; }
.chatMsg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  color: #e6eef6;
  border-bottom-left-radius: 4px;
}
.chatMsg.usuario {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(248, 183, 0, .22), rgba(248, 183, 0, .13));
  border: 1px solid rgba(248, 183, 0, .4);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatTitulo { margin: 0 0 .35rem; font-weight: 800; color: #ffd98a; font-size: .92rem; }
.chatTexto code {
  background: rgba(0, 0, 0, .45);
  padding: .1rem .35rem;
  border-radius: 5px;
  color: #ffd98a;
  font-size: .85em;
}
.chatTexto i { color: #a8b8c8; }

.chatBotones { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.chatBoton {
  display: inline-block;
  padding: .38rem .75rem;
  background: rgba(248, 183, 0, .14);
  border: 1px solid rgba(248, 183, 0, .45);
  border-radius: 8px;
  color: #ffd98a;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.chatBoton:hover { background: rgba(248, 183, 0, .28); color: #fff; }

/* Las preguntas rapidas */
.chatRapidas {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .55rem .8rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  max-height: 92px;
  overflow-y: auto;
}
.chatRapida {
  padding: .32rem .65rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  color: #b8c8d8;
  font-family: inherit;
  font-size: .76rem;
  cursor: pointer;
  white-space: nowrap;
}
.chatRapida:hover { background: rgba(248, 183, 0, .14); border-color: #f8b700; color: #ffd98a; }

/* Escribir */
.chatEscribir {
  display: flex;
  gap: .5rem;
  padding: .7rem .8rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  background: rgba(0, 0, 0, .22);
}
.chatEscribir input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .65rem .8rem;
  background: rgba(4, 8, 12, .9);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: #eaf1f8;
  font-family: inherit;
  font-size: 16px;
}
.chatEscribir input:focus { outline: none; border-color: #f8b700; box-shadow: 0 0 0 3px rgba(248, 183, 0, .16); }
.chatEscribir button {
  flex: 0 0 auto;
  width: 46px;
  background: linear-gradient(180deg, #ffd98a, #f8b700);
  border: 1px solid #ffe9b8;
  border-radius: 10px;
  color: #2a1a04;
  font-size: 1.05rem;
  cursor: pointer;
}
.chatEscribir button:hover { filter: brightness(1.08); }

/* En movil: a pantalla casi completa */
@media (max-width: 620px) {
  .chatVentana {
    right: .5rem; left: .5rem; bottom: .5rem;
    width: auto;
    height: min(78vh, 560px);
  }
  .chatMsg { max-width: 96%; font-size: .88rem; }
}
