/* ============================================================
   agente.css
   Estilos del asistente virtual (widget flotante de preguntas y
   respuestas predefinidas). Usa variables CSS para que sea
   fácil adaptarlo a la paleta real de cada sitio: sobrescribe
   estas variables en tu propio style.css, o cámbialas aquí.
   ============================================================ */

:root{
  --agente-primary: #0e223a;   /* color principal (burbuja, cabecera) */
  --agente-accent:  #25d366;   /* color de acento (botón lanzador, CTA) */
  --agente-bg:      #ffffff;   /* fondo del panel de chat */
  --agente-bubble-bot: #f1f5f9;
  --agente-text:    #111827;
  --agente-text-soft: #475569;
  --agente-radius: 16px;
}

#agente-launcher{
  position: fixed;
  /* 92px = deja sitio debajo para el botón flotante de WhatsApp
     (.sticky-whatsapp, en style.css), que ocupa esa esquina hasta
     1100px de ancho. Sin este hueco, ambos botones se solapan en
     móvil y tablet. */
  bottom: 92px;
  right: 22px;
  height: 60px;
  padding: 0 22px 0 18px;
  border-radius: 30px;
  background: var(--agente-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transition: transform .15s ease;
}
#agente-launcher:hover{ transform: scale(1.04); }
#agente-launcher svg{ width: 26px; height: 26px; flex-shrink: 0; }
#agente-launcher span{ font-weight: 700; font-size: .98rem; white-space: nowrap; }

#agente-panel{
  position: fixed;
  bottom: 164px; /* encima del launcher ya desplazado (ver #agente-launcher) */
  right: 22px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  background: var(--agente-bg);
  border-radius: var(--agente-radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: inherit;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
#agente-panel.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#agente-header{
  background: linear-gradient(135deg, var(--agente-primary), var(--agente-primary-light, var(--agente-primary)));
  color: #fff;
  padding: 16px 18px;
  display:flex; align-items:center; gap: 12px;
  flex-shrink: 0;
}
#agente-avatar{
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0;
}
#agente-avatar svg{ width: 22px; height: 22px; }
#agente-header-text{ flex: 1; min-width: 0; }
#agente-header .title{ font-weight: 700; font-size: 1rem; }
#agente-header .subtitle{
  font-size: .78rem; color: #c9d3e2; margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.agente-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--agente-accent);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
#agente-close{
  background: transparent; border: none; color: #fff;
  font-size: 1.3rem; line-height: 1; cursor: pointer; opacity:.85;
  width: 44px; height: 44px; /* área táctil cómoda, aunque el icono sea pequeño */
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#agente-close:hover{ opacity: 1; }

#agente-body{
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agente-bubble{
  background: var(--agente-bubble-bot);
  color: var(--agente-text);
  padding: 12px 14px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  font-size: .92rem;
  line-height: 1.45;
  max-width: 92%;
}
.agente-bubble.user{
  background: var(--agente-primary);
  color: #fff;
  align-self: flex-end;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}

.agente-options{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.agente-option-btn{
  background: #fff;
  border: 1.5px solid var(--agente-primary);
  color: var(--agente-primary);
  padding: 12px 14px;
  min-height: 44px; /* tamaño cómodo para dedo en móvil */
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.agente-option-btn:hover{
  background: var(--agente-primary);
  color: #fff;
}
.agente-option-btn.whatsapp{
  border-color: var(--agente-accent);
  color: var(--agente-accent);
}
.agente-option-btn.whatsapp:hover{
  background: var(--agente-accent);
  color: #fff;
}

.agente-back-btn{
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--agente-text-soft);
  font-size: .82rem;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
}

#agente-form{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: var(--agente-bg);
}
#agente-input{
  flex: 1;
  min-width: 0;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  padding: 12px 14px;
  min-height: 44px; /* tamaño cómodo para dedo en móvil */
  font-size: .92rem;
  font-family: inherit;
  outline: none;
  color: var(--agente-text);
}
#agente-input:focus{ border-color: var(--agente-primary); }
#agente-send{
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--agente-accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#agente-send:hover{ opacity: .9; }

/* En móvil, el botón del Agente pasa a circular y sin texto (para no
   acaparar tanto sitio en pantalla), pero se mantiene ligeramente más
   grande que el de WhatsApp y con más sombra, para que se note que es
   el más importante de los dos. */
@media (max-width: 600px){
  #agente-launcher{
    width: 58px;
    height: 58px;
    bottom: 80px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.35);
  }
  #agente-launcher span{ display: none; }
  #agente-launcher svg{ width: 26px; height: 26px; }
  #agente-panel{ bottom: 148px; }
}

@media (max-width: 420px){
  #agente-panel{ right: 16px; left: 16px; width: auto; }
  #agente-launcher{ right: 16px; }
}

/* Desde 1100px .sticky-whatsapp (style.css) se oculta, así que el
   Agente puede volver a su esquina habitual sin dejar hueco. */
@media (min-width: 1100px){
  #agente-launcher{ bottom: 22px; }
  #agente-panel{ bottom: 94px; }
}
