/* ===========================================================
   Brisa Nómade — asistente del sitio
   Usa las variables de color de index.html, con respaldo por si
   este archivo se carga suelto.
   =========================================================== */

.bn-chat *,
.bn-chat *::before,
.bn-chat *::after { box-sizing: border-box; }

/* ---------- botón flotante ---------- */
#bnChatBtn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9500;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--naranja, #D97B3A);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .25s, background .25s;
}
#bnChatBtn:hover { background: var(--rojo-sol, #C04F2E); transform: translateY(-2px); }
#bnChatBtn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#bnChatBtn svg { width: 28px; height: 28px; display: block; }
#bnChatBtn .bn-cerrar { display: none; }
#bnChatBtn[aria-expanded="true"] .bn-abrir { display: none; }
#bnChatBtn[aria-expanded="true"] .bn-cerrar { display: block; }

/* punto de aviso, solo hasta que lo abren por primera vez */
#bnChatBtn::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid var(--negro, #0a0d0f);
  animation: bnLatido 2.4s ease-in-out infinite;
}
#bnChatBtn.bn-visto::after { display: none; }
@keyframes bnLatido {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.25); opacity: .65; }
}

/* ---------- panel ---------- */
#bnChat {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 9500;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 130px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #23323a;
  border-radius: 16px;
  background: #0f1418;
  color: var(--blanco, #F5F0E8);
  font-family: 'Raleway', system-ui, sans-serif;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
#bnChat.bn-abierto { display: flex; animation: bnEntra .28s cubic-bezier(.22, 1, .36, 1); }
@keyframes bnEntra {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- encabezado ---------- */
.bn-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--azul-oscuro, #0D2E3A), var(--azul, #1E5F74));
  border-bottom: 1px solid #23323a;
  flex-shrink: 0;
}
.bn-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #000; }
.bn-head-txt { flex: 1; min-width: 0; line-height: 1.25; }
.bn-head-txt strong {
  display: block;
  font-family: 'Bebas Neue', 'Raleway', sans-serif;
  font-size: 1.15rem;
  letter-spacing: .08em;
}
.bn-head-txt span { font-size: .68rem; color: rgba(245, 240, 232, .65); display: flex; align-items: center; gap: 6px; }
.bn-head-txt span::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #25D366; flex-shrink: 0;
}
.bn-head button {
  background: rgba(255, 255, 255, .12);
  border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; font-size: .85rem; line-height: 1; flex-shrink: 0;
}
.bn-head button:hover { background: rgba(255, 255, 255, .24); }

/* ---------- conversación ---------- */
.bn-log {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #2a3a44 transparent;
}
.bn-log::-webkit-scrollbar { width: 8px; }
.bn-log::-webkit-scrollbar-thumb { background: #2a3a44; border-radius: 4px; }

.bn-msg {
  max-width: 86%;
  padding: 11px 14px;
  font-size: .86rem;
  line-height: 1.6;
  border-radius: 14px;
  animation: bnMsg .22s ease-out;
  overflow-wrap: anywhere;
}
@keyframes bnMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.bn-bot {
  align-self: flex-start;
  background: #182028;
  border: 1px solid #232f38;
  border-bottom-left-radius: 4px;
  color: #d9d3c8;
}
.bn-yo {
  align-self: flex-end;
  background: var(--naranja, #D97B3A);
  border-bottom-right-radius: 4px;
  color: #fff;
  font-weight: 500;
}
.bn-msg strong { color: var(--blanco, #F5F0E8); font-weight: 700; }
.bn-yo strong { color: #fff; }
.bn-msg a { color: var(--naranja, #D97B3A); }

/* listas de precios dentro de una respuesta */
.bn-lista { list-style: none; margin: 9px 0 0; padding: 0; }
.bn-lista li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #232f38;
}
.bn-lista li:last-child { border-bottom: none; }
.bn-lista .bn-it { flex: 1; min-width: 0; }
.bn-lista .bn-it small { display: block; color: #7d8b95; font-size: .72rem; margin-top: 1px; }
.bn-lista .bn-pr {
  color: var(--naranja, #D97B3A);
  font-weight: 700;
  white-space: nowrap;
  font-size: .84rem;
}
.bn-nota { color: #7d8b95; font-size: .74rem; font-style: italic; margin-top: 8px; display: block; }

/* ---------- indicador de escritura ---------- */
.bn-tipeo { display: flex; gap: 4px; align-items: center; padding: 13px 15px; }
.bn-tipeo i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4d5f6b; display: block;
  animation: bnPunto 1.3s infinite;
}
.bn-tipeo i:nth-child(2) { animation-delay: .18s; }
.bn-tipeo i:nth-child(3) { animation-delay: .36s; }
@keyframes bnPunto {
  0%, 60%, 100% { transform: translateY(0);   opacity: .45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ---------- botones sugeridos ---------- */
.bn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.bn-chips button {
  background: rgba(217, 123, 58, .1);
  border: 1px solid rgba(217, 123, 58, .38);
  color: var(--naranja, #D97B3A);
  padding: 7px 13px;
  border-radius: 40px;
  font-family: inherit;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.bn-chips button:hover { background: rgba(217, 123, 58, .22); transform: translateY(-1px); }
.bn-chips button:focus-visible { outline: 2px solid var(--naranja, #D97B3A); outline-offset: 2px; }

/* botón de WhatsApp dentro de una respuesta */
.bn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  background: #25D366;
  color: #fff !important;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background .2s;
}
.bn-wa:hover { background: #1da851; }
.bn-wa svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- entrada de texto ---------- */
.bn-pie {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #23323a;
  background: #0c1115;
  flex-shrink: 0;
}
.bn-pie input {
  flex: 1;
  min-width: 0;
  background: #171f26;
  border: 1px solid #26333c;
  color: var(--blanco, #F5F0E8);
  border-radius: 40px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: .84rem;
  outline: none;
  transition: border-color .2s;
}
.bn-pie input::placeholder { color: #5d6b76; }
.bn-pie input:focus { border-color: var(--naranja, #D97B3A); }
.bn-pie button {
  background: var(--naranja, #D97B3A);
  border: none;
  color: #fff;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.bn-pie button:hover { background: var(--rojo-sol, #C04F2E); }
.bn-pie button:disabled { opacity: .4; cursor: default; }
.bn-pie button svg { width: 17px; height: 17px; }

/* ---------- celular ---------- */
@media (max-width: 600px) {
  /* inset en vez de alto fijo: con 100dvh el panel quedaba corrido hacia abajo
     y dejaba ver el sitio por arriba en los navegadores móviles */
  #bnChat {
    inset: 0;
    width: auto; max-width: none;
    height: auto; max-height: none;
    border-radius: 0;
    border: none;
  }
  #bnChatBtn { right: 16px; bottom: 16px; width: 54px; height: 54px; }
  .bn-msg { max-width: 90%; font-size: .9rem; }
}

/* ---------- accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  #bnChat.bn-abierto, .bn-msg { animation: none; }
  #bnChatBtn::after, .bn-tipeo i { animation: none; }
  #bnChatBtn, .bn-chips button { transition: none; }
}
