/* ====== BOTONES FLOTANTES ====== */
.float-btn { position: fixed; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: all 0.3s ease; z-index: 998; }
.float-btn:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.whatsapp-float { bottom: 30px; right: 30px; background: #25d366; color: white; font-size: 30px; animation: pulse-wa 2s infinite; }
.whatsapp-float:hover { transform: translateY(-5px) scale(1.05); color: white; animation: none; }

.ia-float { bottom: 100px; right: 30px; background: #ffffff; color: #3902a0; animation: pulse-ia 2s infinite; }
.ia-float:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.3); animation: none; }
.ia-float svg { width: 35px; height: 35px; }
@keyframes ia-bounce { 0% { transform: translateY(0); } 50% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@keyframes ia-blink { 0%, 90%, 100% { r: 10; } 95% { r: 1; } }
.ia-eye { animation: ia-blink 4s infinite; transform-box: fill-box; transform-origin: center; }
.ia-antenna-ball { animation: ia-bounce 1s infinite; transform-box: fill-box; transform-origin: center bottom; }

.ia-tooltip { position: absolute; right: 75px; top: 50%; transform: translateY(-50%); background: white; color: #0e0e1a; padding: 12px 18px; border-radius: 12px; width: 220px; font-size: 0.85rem; text-align: center; font-weight: 600; box-shadow: 0 5px 20px rgba(57,2,160,0.15); border: 1px solid rgba(0,0,0,0.05); opacity: 1; visibility: visible; pointer-events: none; z-index: 1000; line-height: 1.4; animation: tooltip-entrar 0.6s cubic-bezier(0.68,-0.55,0.27,1.55) 1s both; transition: opacity 0.3s, visibility 0.3s; }
.ia-tooltip.hidden { opacity: 0; visibility: hidden; }
.ia-tooltip::after { content: ''; position: absolute; top: 50%; right: -6px; transform: translateY(-50%); border-width: 6px 0 6px 6px; border-style: solid; border-color: transparent transparent transparent white; }
.ia-float:hover .ia-tooltip:not(.hidden) { transform: translateY(-50%) scale(1.05); box-shadow: 0 8px 25px rgba(57,2,160,0.25); }
@keyframes tooltip-entrar { 0% { opacity: 0; transform: translateY(-50%) translateX(20px); } 100% { opacity: 1; transform: translateY(-50%) translateX(0); } }

.scroll-top { bottom: 30px; right: auto; left: 30px; background: #3902a0; color: white; font-size: 24px; opacity: 0; visibility: hidden; z-index: 997; }
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { background: #fd073c; }
@keyframes pulse-wa { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.7); } 70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@keyframes pulse-ia { 0% { box-shadow: 0 0 0 0 rgba(57,2,160,0.7); } 70% { box-shadow: 0 0 0 15px rgba(57,2,160,0); } 100% { box-shadow: 0 0 0 0 rgba(57,2,160,0); } }

/* ====== CHAT WIDGET ====== */
.chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 400px;
  height: min(820px, calc(100vh - 100px));
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(57,2,160,0.2), 0 0 0 1px rgba(57,2,160,0.06);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.35s, visibility 0.35s;
}
.chat-widget.open { transform: scale(1) translateY(0); opacity: 1; visibility: visible; }

.chat-header { background: linear-gradient(135deg, #3902a0, #24006b); padding: 14px 16px; display: flex; align-items: center; gap: 12px; position: relative; flex-shrink: 0; }
.chat-header::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #fd073c, rgba(255,255,255,0.3)); }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.2); }
.chat-avatar svg { width: 26px; height: 26px; }
.chat-header-info h4 { color: white; font-size: 0.9rem; font-weight: 700; line-height: 1.2; }
.chat-header-info p { color: rgba(255,255,255,0.65); font-size: 0.7rem; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; display: inline-block; animation: statusPulse 2s infinite; }
@keyframes statusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.chat-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.15); border: none; color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; flex-shrink: 0; }
.chat-close:hover { background: #fd073c; transform: rotate(90deg); box-shadow: 0 4px 12px rgba(253,7,60,0.4); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8f9fc;
  scrollbar-width: thin;
  scrollbar-color: rgba(57,2,160,0.1) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(57,2,160,0.12); border-radius: 10px; }

.chat-bubble { max-width: 82%; padding: 14px 18px; border-radius: 18px; font-size: 0.85rem; line-height: 1.7; animation: bubbleIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275) both; position: relative; word-wrap: break-word; overflow-wrap: break-word; }
@keyframes bubbleIn { 0% { opacity: 0; transform: translateY(8px) scale(0.95); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.chat-bubble.bot { background: white; color: #0e0e1a; align-self: flex-start; border-bottom-left-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.chat-bubble.user { background: linear-gradient(135deg, #3902a0, #4c1dab); color: white; align-self: flex-end; border-bottom-right-radius: 6px; box-shadow: 0 3px 12px rgba(57,2,160,0.2); }
.chat-bubble .bubble-time { font-size: 0.58rem; opacity: 0.45; margin-top: 8px; display: block; }
.chat-bubble.user .bubble-time { text-align: right; color: rgba(255,255,255,0.6); }
.chat-bubble strong { font-weight: 700; color: #3902a0; }
.chat-bubble.user strong { color: white; }

.typing-indicator { display: flex; align-items: center; gap: 5px; padding: 14px 18px; background: white; border-radius: 18px; border-bottom-left-radius: 6px; align-self: flex-start; box-shadow: 0 1px 4px rgba(0,0,0,0.06); animation: bubbleIn 0.3s ease both; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: #3902a0; opacity: 0.35; animation: typingBounce 1.4s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-5px); opacity: 1; } }

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 12px 8px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.quick-reply-btn {
  padding: 5px 11px;
  border-radius: 16px;
  border: 1.5px solid rgba(57,2,160,0.18);
  background: white;
  color: #3902a0;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  line-height: 1.3;
}
.quick-reply-btn:hover { background: #3902a0; color: white; border-color: #3902a0; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(57,2,160,0.18); }

.chat-input-area { padding: 10px 14px; background: white; border-top: 1px solid rgba(0,0,0,0.04); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chat-input { flex: 1; border: 1.5px solid rgba(57,2,160,0.1); border-radius: 22px; padding: 10px 16px; font-size: 0.82rem; font-family: 'Poppins', sans-serif; color: #0e0e1a; outline: none; transition: border-color 0.3s, box-shadow 0.3s; background: #f8f9fc; }
.chat-input::placeholder { color: #aaa; font-size: 0.78rem; }
.chat-input:focus { border-color: #3902a0; box-shadow: 0 0 0 3px rgba(57,2,160,0.06); background: white; }
.chat-send { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #3902a0, #4c1dab); border: none; color: white; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; flex-shrink: 0; box-shadow: 0 3px 10px rgba(57,2,160,0.25); }
.chat-send:hover { background: linear-gradient(135deg, #fd073c, #e0002f); transform: scale(1.08); box-shadow: 0 4px 14px rgba(253,7,60,0.25); }
.chat-send:active { transform: scale(0.95); }

.chat-footer { padding: 5px 14px 7px; background: #f8f9fc; text-align: center; flex-shrink: 0; }
.chat-footer a { font-size: 0.6rem; color: #bbb; text-decoration: none; transition: color 0.3s; }
.chat-footer a:hover { color: #3902a0; }

/* ====== RESPONSIVE MÓVIL ====== */
@media (max-width: 900px) {
  .whatsapp-float { bottom: 30px; right: 20px; width: 55px; height: 55px; font-size: 28px; }
  .ia-float { bottom: 90px; right: 20px; width: 55px; height: 55px; }
  .ia-float svg { width: 32px; height: 32px; }
  .ia-tooltip { right: 70px; width: 190px; font-size: 0.8rem; padding: 10px 14px; animation: tooltip-entrar-movil 0.6s cubic-bezier(0.68,-0.55,0.27,1.55) 1s both; }
  @keyframes tooltip-entrar-movil { 0% { opacity: 0; transform: translateY(-50%) translateX(15px); } 100% { opacity: 1; transform: translateY(-50%) translateX(0); } }
  .scroll-top { left: 20px; width: 50px; height: 50px; font-size: 20px; }
  .chat-widget { bottom: 0; right: 0; left: 0; width: 100%; height: 100%; max-height: 100vh; border-radius: 0; transform-origin: bottom center; }
  .chat-widget.open { border-radius: 0; }
  .chat-bubble { max-width: 85%; font-size: 0.88rem; }
  .quick-replies { gap: 7px; padding: 8px 14px 10px; }
  .quick-reply-btn { padding: 8px 14px; font-size: 0.73rem; border-radius: 18px; }
}