/* Estilos del widget de chat: flotante, moderno y amigable */

:root {
  --chat-primary: #0d6efd; /* Bootstrap primary */
  --chat-bg: #ffffff;
  --chat-text: #1f2937;
  --chat-shadow: 0 10px 25px rgba(0,0,0,.15);
  --chat-panel-width: 320px; /* más estrecho */
  --chat-launcher-width: 240px; /* más estrecho */
}

.chat-launcher {
  position: fixed;
  right: calc(24px + (var(--chat-panel-width) - var(--chat-launcher-width)) / 2);
  bottom: 24px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--chat-primary);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px; /* menos alto */
  font-size: 17px;   /* texto un poco más grande */
  box-shadow: var(--chat-shadow);
  cursor: pointer;
  user-select: none;
  transition: transform .18s ease, box-shadow .18s ease;
  will-change: transform;
  width: var(--chat-launcher-width);
  justify-content: center;
}

.chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(13,110,253,.35); }
.chat-launcher .dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; opacity: .95; animation: pulse 1.8s infinite; }
.chat-launcher .icon-bubble { position: absolute; right: -10px; top: 50%; transform: translate(20%, -50%); background: var(--chat-primary); color: #fff; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(13,110,253,.35), 0 0 0 4px rgba(255,255,255,.85); }
@keyframes pulse { 0% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.4); opacity: .4 } 100% { transform: scale(1); opacity: .8 } }

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: var(--chat-panel-width);
  max-height: 72vh;
  background: var(--chat-bg);
  border-radius: 18px;
  box-shadow: var(--chat-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1050;
}

.chat-panel.open { display: flex; animation: slideUp .22s ease; }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

.chat-header {
  background: linear-gradient(135deg, var(--chat-primary), #6ea8fe);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header .title { font-weight: 700; letter-spacing: .2px; }
.chat-header .close { background: rgba(255,255,255,.2); border: none; color: #fff; border-radius: 8px; padding: 4px 8px; cursor: pointer; }

.chat-body { padding: 12px; overflow-y: auto; flex: 1; background: #f8fafc; }
.chat-footer { padding: 10px; border-top: 1px solid #eef2f7; background: #fff; }
.composer { display: flex; gap: 8px; margin-top: 6px; }
.composer input { flex: 1; border: 1px solid #dbe3ef; border-radius: 10px; padding: 10px 12px; }
.composer button { background: var(--chat-primary); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; cursor: pointer; }

.msg { display: flex; margin: 6px 0; }
.msg .bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; box-shadow: 0 4px 10px rgba(0,0,0,.05); }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #e7f1ff; color: #174ea6; border-bottom-right-radius: 4px; }
.msg.admin .bubble { background: #fff; color: var(--chat-text); border-bottom-left-radius: 4px; }

.form-inline { display: grid; grid-template-columns: 1fr; gap: 8px; }
.form-inline input { border: 1px solid #dbe3ef; border-radius: 10px; padding: 10px 12px; }
.form-inline button { background: var(--chat-primary); color: #fff; border: none; border-radius: 10px; padding: 10px 12px; cursor: pointer; }

.question { font-weight: 600; margin: 10px 0 6px; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; }
.answers .answer-btn { background: #fff; border: 1px solid #dbe3ef; border-radius: 999px; padding: 8px 12px; cursor: pointer; transition: all .15s ease; }
.answers .answer-btn:hover { background: #0d6efd; color: #fff; border-color: #0d6efd; }

/* Botón WhatsApp con atención visual */
.answers .answer-btn.whatsapp-btn {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  box-shadow: 0 6px 16px rgba(37,211,102,.35);
  animation: whatsappPulse 1.6s ease-in-out infinite;
}
.answers .answer-btn.whatsapp-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
@keyframes whatsappPulse {
  0% { transform: scale(1); box-shadow: 0 6px 16px rgba(37,211,102,.35); }
  50% { transform: scale(1.06); box-shadow: 0 10px 24px rgba(37,211,102,.45); }
  100% { transform: scale(1); box-shadow: 0 6px 16px rgba(37,211,102,.35); }
}

.small-note { font-size: 12px; color: #64748b; }

/* Responsivo: pantallas grandes */
@media (min-width: 992px) {
  :root { --chat-panel-width: 380px; --chat-launcher-width: 280px; }
  .chat-panel { max-height: 74vh; bottom: 110px; }
  .chat-launcher { padding: 14px 22px; font-size: 18px; }
  .chat-launcher .dot { width: 12px; height: 12px; }
  .chat-launcher .icon-bubble { width: 46px; height: 46px; right: -14px; transform: translate(18%, -50%); }
}
@media (min-width: 1200px) {
  :root { --chat-panel-width: 430px; --chat-launcher-width: 300px; }
  .chat-panel { max-height: 76vh; }
  .chat-launcher { padding: 16px 24px; font-size: 19px; gap: 14px; }
  .chat-launcher .dot { width: 14px; height: 14px; }
  .chat-launcher .icon-bubble { width: 52px; height: 52px; right: -16px; transform: translate(16%, -50%); }
}

/* Responsivo: móviles */
@media (max-width: 576px) {
  .chat-launcher { right: 12px; left: 12px; bottom: 12px; padding: 10px 16px; font-size: 16px; gap: 10px; width: auto; }
  .chat-launcher .dot { width: 9px; height: 9px; }
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 84px; max-height: 70vh; }
  .chat-launcher .icon-bubble { width: 36px; height: 36px; right: -18px; }
  .composer button { padding: 10px 12px; }
}
