/* ========== Bot flotante (base) ========== */
#vc-bot{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1060;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* tamaño del botón lanzador (editables) */
  --size: 72px;              /* 56/64/72/80 según prefieras */
  --ink: #0f172a;
  --brand: #332876;
  --turq: #31b3a0;
}

/* ========== Botón lanzador (SVG como background) ========== */
#vc-bot-launcher{
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;

  /* ==========background: var(--brand) url("/img/chat_Brackie_vcs.svg") center / 88% no-repeat;========== */
  background: var(--brand) url("/img/chat_BrackieAnimado_vcs.svg") center / 88% no-repeat;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .2s ease;
}
#vc-bot-launcher:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
#vc-bot-launcher:focus-visible{
  outline: 3px solid var(--turq);
  outline-offset: 3px;
}

/* ========== Hint (tooltip al hover del botón) ========== */
.vc-bot-hint{
  position: absolute;
  right: calc(var(--size) + 12px);
  bottom: 0;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .15s ease, transform .15s ease;
}
#vc-bot-launcher:hover + .vc-bot-hint{
  opacity: 1;
  transform: translateY(0);
}
.vc-bot-hint::after{
  content: "";
  position: absolute;
  right: -6px;
  bottom: 14px;
  width: 0; height: 0;
  border-left: 6px solid var(--brand);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ========== Panel ========== */
/* Usamos position:absolute relativo a #vc-bot (fixed), como en tu CSS original */
#vc-bot-panel{
  position: absolute;
  right: 0;
  bottom: calc(var(--size) + 14px); /* antes: 70px fijo */
  width: 320px;
  max-height: 75vh;                /* tu ajuste */
  overflow: hidden;

  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  display: none;
  flex-direction: column;
}
/* Soporta tu lógica existente y la nueva */
#vc-bot-panel[aria-expanded="true"],
#vc-bot-panel.open{
  display: flex;
}

.vc-bot-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--brand);
  color: #fff;
}
.vc-bot-close{
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.vc-bot-body{
  padding: 12px;
  overflow-y: auto;
}

/* Mensajes */
.vc-bot-msg{
  font-size: 14px;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 8px 0;
  max-width: 90%;
}
.vc-bot-msg--bot{
  background: #f1f5f9;
  color: var(--ink);
  border: 1px solid #e2e8f0;

  /* Para colocar el avatar de Brackie a la izquierda del texto */
  display: flex;
  align-items: center;
  gap: 10px;
}
.vc-bot-msg--user{
  background: var(--turq);
  color: #fff;
  margin-left: auto;
}

/* Avatar de Brackie dentro del mensaje */
.vc-bot-avatar{
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
}

/* Quick actions */
.vc-bot-quick{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 6px;
}
.vc-bot-quick > button{
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
}
.vc-bot-quick > button:hover{ background: #f8fafc; }

/* Acciones extras */
.vc-bot-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.vc-bot-actions a,
.vc-bot-actions button{
  font-size: 13px;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}
.vc-bot-actions a.btn-wa{
  background: #10b98120;
  border-color: #10b98166;
  color: #065f46;
}
.vc-bot-actions a.btn-wa:hover{ background: #10b98130; }

/* Formulario */
.vc-bot-form{
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.vc-bot-form input{
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
}
.vc-bot-form button{
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
}
.vc-bot-form-hint{ color: #64748b; font-size: 12px; }

/* Modo oscuro */
@media (prefers-color-scheme: dark){
  #vc-bot-panel{ background: #0f172a; }
  .vc-bot-header{ background: #0b1220; }
  .vc-bot-msg--bot{ background: #0b1020; color: #e2e8f0; border-color: #1f2937; }
  .vc-bot-quick > button{ background: #0f172a; color: #e2e8f0; border-color: #1f2937; }
  .vc-bot-actions a, .vc-bot-actions button{ background: #0f172a; color: #e2e8f0; border-color: #1f2937; }
  .vc-bot-form input{ background: #0f172a; color: #e2e8f0; border-color: #1f2937; }
}

/* Responsivo */
@media (max-width: 576px){
  #vc-bot{ right: 14px; bottom: 14px; --size: 64px; }
  .vc-bot-hint{ display:none; } /* ocultar hint en móvil */
}

/* ====== Estados interactivos: Quick actions y Actions ====== */
#vc-bot{
  --brand: #332876;   /* morado corporativo */
  --accent: #e30613;  /* rojo corporativo   */
}

/* Transiciones suaves y sin flash */
.vc-bot-quick > button,
.vc-bot-actions a, .vc-bot-actions button{
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* HOVER (puedes dejarlo como lo tenías o usar esta versión) */
.vc-bot-quick > button:hover{
  background: #f8fafc;
  color: var(--brand);
  border-color: #e2e8f0;
}

/* FOCUS / FOCUS-VISIBLE: fondo blanco + texto morado + aro de enfoque */
.vc-bot-quick > button:focus,
.vc-bot-quick > button:focus-visible,
.vc-bot-actions a:focus,
.vc-bot-actions a:focus-visible,
.vc-bot-actions button:focus,
.vc-bot-actions button:focus-visible{
  background: #ffffff;
  color: var(--brand);
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(51,40,118,.18);
}

/* ACTIVE (al presionar) — blanco con texto rojo para feedback claro */
.vc-bot-quick > button:active,
.vc-bot-actions a:active,
.vc-bot-actions button:active{
  background: #ffffff;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.04);
}

/* ESTADO SELECCIONADO / DESHABILITADO (cuando bloqueas un botón tras elegirlo) */
.vc-bot-quick > button.is-active,
.vc-bot-quick > button[aria-pressed="true"],
.vc-bot-quick > button:disabled{
  background: #ffffff !important;
  color: var(--brand) !important;        /* morado para mantener identidad */
  border-color: var(--brand) !important;
  opacity: 1;                            /* evita verse “apagado” */
  cursor: default;
}

/* Variante si prefieres rojo en seleccionado/deshabilitado (opcional): */
/*
.vc-bot-quick > button.is-active,
.vc-bot-quick > button[aria-pressed="true"],
.vc-bot-quick > button:disabled{
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}
*/

/* Modo oscuro: conserva legibilidad en estados blancos */
@media (prefers-color-scheme: dark){
  .vc-bot-quick > button:focus,
  .vc-bot-quic



/* ===== Intro con Brackie dentro del bot ===== */
/* Bubble oscura específica del mensaje de bienvenida */
.vc-bot-msg--intro{
  background: var(--ink);      /* #0f172a */
  color: #fff;
  border-color: #1f2937;
}

/* Tamaño del SVG de Brackie dentro del mensaje */
.vc-bot-msg--intro .vc-brackie-svg{
  width: 44px;               /* ajusta 40–48 si prefieres */
  height: 44px;
  flex: 0 0 44px;
  display: block;
}

/* Parpadeo sutil de ojos (usa class="eye" en el SVG) */
.vc-bot-msg--intro .vc-brackie-svg .eye{
  transform-origin: center;
  animation: vc-blink 3.2s infinite;
}
.vc-bot-msg--intro .vc-brackie-svg .eye.r{ animation-delay: .2s; }

@keyframes vc-blink{
  0%,92%,100%{ transform: scaleY(1); }
  94%{ transform: scaleY(.12); }
}


/* Tamaño del SVG en el mensaje de bienvenida */
.vc-bot-msg--intro .vc-brackie-svg{
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block;
}

/* Parpadeo de ojos */
.vc-bot-msg--intro .vc-brackie-svg .eye{
  transform-origin: center;
  animation: vc-blink 3.2s infinite;
}
.vc-bot-msg--intro .vc-brackie-svg .eye.r{ animation-delay: .2s; }

@keyframes vc-blink{
  0%,92%,100%{ transform: scaleY(1); }
  94%{ transform: scaleY(.12); }
}

/* SALUDO: rotación del brazo derecho alrededor del hombro */
.vc-bot-msg--intro .arm-wave{
  transform-origin: 12px 8px;        /* pivote cercano al hombro, en coords del grupo */
  animation: vc-wave 1.8s ease-in-out infinite;
}

@keyframes vc-wave{
  0%,100% { transform: translate(366px,220px) rotate(0deg); }
  50%     { transform: translate(366px,220px) rotate(-32deg); }
}


/* ====== AJUSTES DE TAMAÑO Y ESPACIOS ====== */

/* 1) Brackie más grande en el saludo */
.vc-bot-msg--intro .vc-brackie-svg{
  width: 64px;        /* antes 44px */
  height: 64px;
  flex: 0 0 64px;
}
.vc-bot-msg{ 
  gap: 12px;          /* más aire entre avatar y texto */
  max-width: 100%;    /* evita recorte lateral del bubble (antes 90%) */
  padding: 12px 14px; /* un poco más de padding interno */
}
.vc-bot-msg--intro{
  border-radius: 14px; /* esquinas suaves para bubble grande */
}

/* 2) Panel más grande (alto y ancho) */
#vc-bot-panel{
  width: min(380px, 92vw); /* antes 320px */
  max-height: 82vh;        /* antes 75vh */
  border-radius: 18px;
}

/* Cuerpo con más respiración */
.vc-bot-body{
  padding: 14px 16px;               /* más margen lateral para que no se sienta “pegado” */
  overflow-y: auto;
}

/* Quick actions: menos apretadas (más alto y separación) */
.vc-bot-quick{
  grid-template-columns: 1fr 1fr;
  gap: 12px;                        /* antes 8px */
  margin: 12px 0 8px;
}
.vc-bot-quick > button{
  padding: 12px;                    /* antes 8px */
  font-size: 14px;
  border-radius: 12px;
}

/* Acciones extra con misma respiración */
.vc-bot-actions{
  gap: 10px;
  margin-top: 8px;
}
.vc-bot-actions a, .vc-bot-actions button{
  padding: 10px 12px;
  border-radius: 12px;
}

/* Header un pelín más alto para balance visual */
.vc-bot-header{ padding: 14px 16px; }

/* ====== RESPONSIVO ====== */
/* En pantallas chicas, baja un poco para que no tape demasiado */
@media (max-width: 576px){
  #vc-bot-panel{
    width: min(94vw, 420px);
    max-height: 78vh;
  }
  .vc-bot-body{ padding: 12px; }
  .vc-bot-msg--intro .vc-brackie-svg{
    width: 52px; height: 52px;     /* un poco más chico en móvil */
    flex-basis: 52px;
  }
  .vc-bot-quick{ gap: 10px; }
}


/* ===== Panel: estados (open / min / closed) ===== */

/* por defecto (closed) no se muestra */
#vc-bot-panel{ display:none; }

/* visible cuando está abierto o minimizado */
#vc-bot-panel[data-state="open"],
#vc-bot-panel[data-state="min"]{
  display:flex;                    /* tu panel usa flex-column */
  flex-direction: column;
  transform-origin: bottom right;
  transition: transform .18s ease, opacity .18s ease;
}

/* estado: abierto (como siempre) */
#vc-bot-panel[data-state="open"]{
  opacity: 1;
  transform: scale(1);
}

/* estado: minimizado: solo header visible */
#vc-bot-panel[data-state="min"]{
  opacity: 1;
  transform: scale(.98);
}
#vc-bot-panel[data-state="min"] .vc-bot-body{
  display: none;                   /* oculta la conversación pero la conserva */
}
#vc-bot-panel[data-state="min"] .vc-bot-header{
  border-bottom-left-radius: 16px; /* redondea esquinas inferiores */
  border-bottom-right-radius: 16px;
}

/* Accesibilidad visual al pasar de min a open */
#vc-bot-panel[data-state="open"] .vc-bot-header{
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0
