/* ==========================================================================
   Bot de atendimento (chat flutuante)
   ========================================================================== */

.bot-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: #08090a;
  cursor: pointer;
  box-shadow: 0 14px 34px -10px rgba(255, 214, 0, .75);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.bot-launcher:hover { transform: scale(1.06); box-shadow: 0 18px 44px -10px rgba(255, 214, 0, .9); }
.bot-launcher svg { width: 27px; height: 27px; }
.bot-launcher .bot-close-ic { display: none; }
.bot-launcher.is-open .bot-open-ic { display: none; }
.bot-launcher.is-open .bot-close-ic { display: block; }

.bot-launcher .bot-dot {
  position: absolute;
  top: 1px; right: 1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #25d366;
  border: 3px solid var(--bg);
}
.bot-launcher.is-open .bot-dot { display: none; }

/* painel ------------------------------------------------------------------ */
.bot-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 96;
  display: flex;
  flex-direction: column;
  width: min(392px, calc(100vw - 28px));
  height: min(640px, calc(100vh - 110px));
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 18px;
  background: var(--bg-2);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(.98);
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.bot-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.bot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(140deg, rgba(255, 214, 0, .16), rgba(255, 214, 0, .03));
  border-bottom: 1px solid var(--line);
}
.bot-head img { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.bot-head .bh-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bot-head .bh-n {
  font-family: var(--f-display);
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}
.bot-head .bh-s {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #25d366;
}
.bot-head .bh-s i { width: 6px; height: 6px; border-radius: 50%; background: #25d366; }
.bot-head .bh-x {
  margin-left: auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: var(--txt-dim);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: background .2s, color .2s;
}
.bot-head .bh-x:hover { background: rgba(255, 255, 255, .12); color: var(--txt); }

/* mensagens --------------------------------------------------------------- */
.bot-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}
.bot-body::-webkit-scrollbar { width: 6px; }
.bot-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }

.bot-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.8px;
  line-height: 1.5;
  animation: botIn .3s var(--ease) both;
}
@keyframes botIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bot-msg.in {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: var(--txt);
}
.bot-msg.out {
  align-self: flex-end;
  background: var(--yellow);
  color: #08090a;
  font-weight: 600;
  border-bottom-right-radius: 5px;
}
.bot-msg b { font-weight: 800; }
.bot-msg .bot-line { display: block; }
.bot-msg .bot-line + .bot-line { margin-top: 7px; }
.bot-msg a { color: var(--yellow); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.bot-msg.out a { color: #08090a; }

.bot-typing { display: flex; gap: 4px; padding: 13px 14px; }
.bot-typing i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--txt-mute);
  animation: botBlink 1.2s infinite;
}
.bot-typing i:nth-child(2) { animation-delay: .18s; }
.bot-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes botBlink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

/* atalhos ----------------------------------------------------------------- */
.bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 11px;
}
.bot-chip {
  flex-shrink: 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 214, 0, .34);
  border-radius: 999px;
  background: rgba(255, 214, 0, .07);
  color: var(--yellow);
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.bot-chip:hover { background: rgba(255, 214, 0, .16); border-color: rgba(255, 214, 0, .6); }

/* campo de texto ---------------------------------------------------------- */
.bot-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.bot-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--txt);
  font-family: var(--f-body);
  font-size: 13.8px;
  outline: none;
  transition: border-color .2s;
}
.bot-input::placeholder { color: var(--txt-mute); }
.bot-input:focus { border-color: var(--yellow); }
.bot-send {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: #08090a;
  cursor: pointer;
  transition: transform .2s var(--ease), opacity .2s;
}
.bot-send:hover { transform: scale(1.06); }
.bot-send svg { width: 18px; height: 18px; }

/* WhatsApp flutuante sobe pra não brigar com o bot */
.wa-float { bottom: 90px; z-index: 94; }

@media (max-width: 620px) {
  .bot-panel {
    right: 10px;
    left: 10px;
    bottom: 84px;
    width: auto;
    height: min(540px, calc(100vh - 120px));
  }
  .bot-launcher { right: 14px; bottom: 14px; width: 54px; height: 54px; }
  .wa-float { right: 14px; bottom: 80px; width: 50px; height: 50px; }
  .wa-float svg { width: 26px; height: 26px; }
}
