/* ===== Chatbot híbrido de Guille Ferveg ===== */
.gf-chat-launcher{
  position:fixed;
  left:28px;
  bottom:28px;
  z-index:1200;
  width:58px;
  height:58px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,var(--accent,#6c63ff),var(--accent2,#a78bfa));
  color:#fff;
  box-shadow:0 16px 42px rgba(0,0,0,.36);
  cursor:pointer;
  transition:transform .2s ease,box-shadow .2s ease;
}
.gf-chat-launcher:hover{
  transform:translateY(-2px) scale(1.03);
  box-shadow:0 20px 48px rgba(0,0,0,.42);
}
.gf-chat-launcher svg{
  width:27px;
  height:27px;
  fill:currentColor;
}
.gf-chat-launcher[aria-expanded="true"] .gf-chat-open-icon{display:none;}
.gf-chat-launcher[aria-expanded="false"] .gf-chat-close-icon{display:none;}

.gf-chat-panel{
  position:fixed;
  left:28px;
  bottom:98px;
  z-index:1199;
  width:min(460px,calc(100vw - 40px));
  height:min(690px,calc(100vh - 120px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.11);
  border-radius:22px;
  background:rgba(13,13,22,.96);
  color:var(--text,#ececf5);
  box-shadow:0 24px 70px rgba(0,0,0,.5);
  backdrop-filter:blur(18px);
  opacity:0;
  visibility:hidden;
  transform:translateY(14px) scale(.98);
  transform-origin:left bottom;
  transition:opacity .22s ease,transform .22s ease,visibility .22s;
}
.gf-chat-panel.is-open{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}
html[data-theme="light"] .gf-chat-panel{
  background:rgba(255,255,255,.97);
  border-color:rgba(20,20,35,.12);
  box-shadow:0 24px 65px rgba(36,27,68,.2);
}

.gf-chat-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 17px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(135deg,rgba(108,99,255,.16),rgba(167,139,250,.07));
}
html[data-theme="light"] .gf-chat-header{
  border-bottom-color:rgba(20,20,35,.09);
}
.gf-chat-avatar{
  width:46px;
  height:46px;
  flex:0 0 auto;
  border-radius:14px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:#11111c;
  border:1px solid rgba(167,139,250,.28);
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.gf-chat-avatar img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.gf-chat-heading{min-width:0;flex:1;}
.gf-chat-heading strong{
  display:block;
  font-family:'Space Grotesk',sans-serif;
  font-size:.95rem;
  line-height:1.2;
}
.gf-chat-heading span{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:3px;
  color:var(--muted,#9999b8);
  font-size:.7rem;
}
.gf-chat-online{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#10b981;
  box-shadow:0 0 10px rgba(16,185,129,.7);
}
.gf-chat-header-actions{display:flex;gap:5px;}
.gf-chat-icon-btn{
  width:34px;
  height:34px;
  border:0;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:transparent;
  color:var(--muted,#9999b8);
  cursor:pointer;
}
.gf-chat-icon-btn:hover{
  background:rgba(255,255,255,.07);
  color:var(--text,#ececf5);
}
html[data-theme="light"] .gf-chat-icon-btn:hover{background:rgba(20,20,35,.06);}
.gf-chat-icon-btn svg{width:18px;height:18px;fill:currentColor;}

.gf-chat-messages{
  flex:1;
  overflow-y:auto;
  padding:20px 18px;
  scroll-behavior:smooth;
  scrollbar-width:thin;
  scrollbar-color:rgba(167,139,250,.4) transparent;
}
.gf-chat-row{
  display:flex;
  margin-bottom:12px;
}
.gf-chat-row.user{justify-content:flex-end;}
.gf-chat-bubble{
  max-width:86%;
  padding:11px 13px;
  border-radius:16px;
  font-size:.84rem;
  line-height:1.55;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
}
.gf-chat-row.bot .gf-chat-bubble{
  border:1px solid rgba(255,255,255,.08);
  border-bottom-left-radius:5px;
  background:rgba(255,255,255,.055);
  color:var(--soft,#c9c9dc);
}
.gf-chat-row.user .gf-chat-bubble{
  border-bottom-right-radius:5px;
  background:linear-gradient(135deg,var(--accent,#6c63ff),var(--accent2,#a78bfa));
  color:#fff;
}
html[data-theme="light"] .gf-chat-row.bot .gf-chat-bubble{
  background:rgba(108,99,255,.06);
  border-color:rgba(108,99,255,.11);
  color:#363549;
}

.gf-chat-links{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:10px;
}
.gf-chat-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:6px 11px;
  border:1px solid rgba(167,139,250,.3);
  border-radius:999px;
  background:rgba(108,99,255,.1);
  color:var(--accent2,#a78bfa);
  font-size:.72rem;
  font-weight:700;
  text-decoration:none;
}
.gf-chat-link:hover{
  border-color:var(--accent2,#a78bfa);
  background:rgba(108,99,255,.18);
  color:var(--text,#ececf5);
}

.gf-chat-typing{
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-width:54px;
}
.gf-chat-typing i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--muted,#9999b8);
  animation:gfChatDot 1.1s infinite ease-in-out;
}
.gf-chat-typing i:nth-child(2){animation-delay:.15s;}
.gf-chat-typing i:nth-child(3){animation-delay:.3s;}
@keyframes gfChatDot{
  0%,70%,100%{transform:translateY(0);opacity:.35;}
  35%{transform:translateY(-4px);opacity:1;}
}


.gf-chat-form{
  display:flex;
  align-items:flex-end;
  gap:10px;
  padding:14px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(8,8,13,.42);
}
html[data-theme="light"] .gf-chat-form{
  border-top-color:rgba(20,20,35,.09);
  background:rgba(245,245,250,.68);
}
.gf-chat-input{
  flex:1;
  min-height:58px;
  max-height:150px;
  resize:none;
  overflow-y:auto;
  border:1px solid rgba(255,255,255,.1);
  border-radius:13px;
  outline:none;
  padding:13px 14px;
  background:rgba(255,255,255,.045);
  color:var(--text,#ececf5);
  font-family:'Inter',sans-serif;
  font-size:.88rem;
  line-height:1.45;
}
.gf-chat-input:focus{border-color:var(--accent2,#a78bfa);}
.gf-chat-input::placeholder{color:var(--muted,#9999b8);}
html[data-theme="light"] .gf-chat-input{
  background:#fff;
  border-color:rgba(20,20,35,.12);
  color:#232331;
}
.gf-chat-send{
  width:48px;
  height:48px;
  flex:0 0 auto;
  border:0;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--accent,#6c63ff),var(--accent2,#a78bfa));
  color:#fff;
  cursor:pointer;
}
.gf-chat-send:disabled{opacity:.48;cursor:not-allowed;}
.gf-chat-send svg{width:19px;height:19px;fill:currentColor;}
.gf-chat-note{
  padding:0 14px 10px;
  color:var(--muted,#9999b8);
  font-size:.62rem;
  line-height:1.4;
  text-align:center;
}
.gf-chat-error{
  display:none;
  padding:8px 13px;
  color:#fca5a5;
  font-size:.68rem;
  text-align:center;
}
.gf-chat-error.is-visible{display:block;}

@media(max-width:760px){
  .gf-chat-launcher{
    left:16px;
    bottom:20px;
    width:52px;
    height:52px;
  }
  .gf-chat-panel{
    left:12px;
    right:12px;
    bottom:88px;
    width:auto;
    height:min(720px,calc(100dvh - 100px));
    transform-origin:center bottom;
  }
}

@media(prefers-reduced-motion:reduce){
  .gf-chat-launcher,
  .gf-chat-panel,
  .gf-chat-typing i{
    transition:none;
    animation:none;
  }
}
