/* ==========================================================
   TODO FIESTA — Asistente virtual (estilo claro)
   Usa las variables de tf.css.
   ========================================================== */
.bot { position: fixed; right: 22px; bottom: 22px; z-index: 70; font-family: var(--font-body); }

/* ---------- Botón flotante ---------- */
.bot__launcher {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--vino); color: var(--marfil);
  display: grid; place-items: center;
  box-shadow: 0 14px 30px -12px rgba(109, 59, 71, .7);
  transition: transform .35s var(--ease), background .3s;
}
.bot__launcher:hover { transform: scale(1.06); background: var(--vino-2); }
.bot__launcher::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--vino);
  animation: botRing 3s 3;
}
@keyframes botRing { from { transform: scale(1); opacity: .6; } to { transform: scale(1.5); opacity: 0; } }
.bot__launcher-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--marfil); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bot__launcher-icon circle { fill: var(--marfil); stroke: none; }
.bot__launcher-icon, .bot__launcher-close { grid-area: 1 / 1; transition: transform .35s var(--ease), opacity .25s; }
.bot__launcher-close { font-size: 30px; font-weight: 300; line-height: 1; opacity: 0; transform: rotate(-90deg) scale(.6); }
.bot__launcher[aria-expanded="true"] .bot__launcher-icon { opacity: 0; transform: rotate(90deg) scale(.6); }
.bot__launcher[aria-expanded="true"] .bot__launcher-close { opacity: 1; transform: none; }
.bot__launcher[aria-expanded="true"]::before { animation: none; opacity: 0; }

.bot__tip {
  position: absolute; right: 74px; bottom: 14px; white-space: nowrap;
  padding: 10px 16px; font-size: 13.5px; font-weight: 500;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 999px; color: var(--tinta);
  box-shadow: 0 14px 30px -16px rgba(63, 56, 51, .45);
  animation: botTip .5s var(--ease-out);
}
@keyframes botTip { from { opacity: 0; transform: translateX(12px); } }

/* ---------- Panel ---------- */
.bot__panel {
  position: absolute; right: 0; bottom: 78px; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--linea); border-radius: 16px; background: var(--blanco);
  box-shadow: 0 36px 76px -30px rgba(31, 26, 27, .48);
  opacity: 0; transform: translateY(16px); transform-origin: bottom right;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.bot__panel.is-open { opacity: 1; transform: none; }
/* mientras está cerrado no debe tapar clicks de la página */
.bot__panel[hidden] { display: none; }
.bot__panel:not(.is-open) { pointer-events: none; }

.bot__head {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--marfil);
}
.marca--chip {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--bronce); background: var(--blanco);
}
.marca--chip img { width: 30px; height: auto; }
.bot__title { font-family: var(--serif); font-weight: 500; font-size: 19px; color: var(--tinta); line-height: 1.2; }
.bot__status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--suave); }
.bot__status span { width: 7px; height: 7px; border-radius: 50%; background: var(--wa); }
.bot__close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--linea);
  background: transparent; color: var(--tinta); font-size: 22px; font-weight: 300; line-height: 1; cursor: pointer;
  transition: background .25s;
}
.bot__close:hover { background: var(--blanco); }

.bot__msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.bot__msgs::-webkit-scrollbar { width: 6px; }
.bot__msgs::-webkit-scrollbar-thumb { background: var(--linea); border-radius: 99px; }

.bot__msg {
  max-width: 86%; padding: 11px 15px; font-size: 14.5px; line-height: 1.55; color: var(--tinta);
  border-radius: 14px; animation: botIn .35s var(--ease-out);
}
@keyframes botIn { from { opacity: 0; transform: translateY(8px); } }
.bot__msg--bot { align-self: flex-start; background: var(--marfil); border-bottom-left-radius: 4px; }
.bot__msg--yo { align-self: flex-end; background: var(--vino); color: var(--marfil); border-bottom-right-radius: 4px; }
.bot__msg b { color: var(--vino); font-weight: 500; }
.bot__msg--yo b { color: inherit; }

.bot__dots { display: inline-flex; gap: 4px; padding: 2px 0; }
.bot__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--suave); animation: botDot 1.2s infinite; }
.bot__dots i:nth-child(2) { animation-delay: .15s; }
.bot__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes botDot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.bot__actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 92%; }
.bot__action {
  display: inline-block; padding: 9px 16px; font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  background: var(--vino); color: var(--marfil); border: 0; border-radius: 6px; transition: background .25s;
}
.bot__action:hover { background: var(--tinta); }

.bot__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 12px; }
.bot__chips:empty { display: none; }
.bot__chip {
  padding: 7px 13px; font: 400 13px var(--sans); cursor: pointer; color: var(--texto);
  background: transparent; border: 1px solid var(--linea); border-radius: 999px;
  transition: border-color .25s, color .25s;
}
.bot__chip:hover { border-color: var(--vino); color: var(--vino); }

.bot__form { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--blanco); }
.bot__form input {
  flex: 1; min-width: 0; background: var(--marfil); border: 1px solid transparent; color: var(--tinta);
  border-radius: 999px; padding: 12px 16px; font: 400 15px var(--sans); transition: border-color .2s;
}
.bot__form input:focus { outline: none; border-color: var(--vino); }
.bot__form input::placeholder { color: #a99f97; }
.bot__form button {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--vino); display: grid; place-items: center; transition: background .25s;
}
.bot__form button:hover { background: var(--tinta); }
.bot__form button svg { width: 18px; height: 18px; fill: var(--marfil); margin-left: 2px; }

@media (max-width: 600px) {
  .bot { right: 16px; bottom: 16px; }
  .bot__launcher { width: 54px; height: 54px; }
  .bot__panel {
    position: fixed; right: 0; left: 0; bottom: 0; top: auto;
    width: 100%; height: min(86vh, 640px); border-radius: 18px 18px 0 0;
    transform-origin: bottom center;
  }
  .bot__msg { max-width: 90%; font-size: 15px; }
  /* con el chat abierto, los botones flotantes molestan */
  body.bot-open .wa-float, body.bot-open .bot__launcher { opacity: 0; pointer-events: none; }
  body.bot-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .bot__panel { transition: none; }
  .bot__launcher::before { animation: none; }
}
