/* ============================================
   VORS 在线商城 - WhatsApp 悬浮聊天气泡
   ============================================ */

/* 悬浮按钮容器 */
.wa-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--font-body);
}

/* 主悬浮按钮 */
.wa-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.wa-fab:hover {
  background: #20bd5a;
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.wa-fab:active {
  transform: scale(0.95);
}

.wa-fab svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  flex-shrink: 0;
}

/* 红色通知点 */
.wa-fab-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #e63946;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: wa-pulse 2s infinite;
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(230, 57, 70, 0); }
}

/* 展开的聊天卡片 */
.wa-chat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 300px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-chat-card.wa-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 卡片头部 */
.wa-chat-header {
  background: #25D366;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.wa-chat-header-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-chat-header-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.wa-chat-header-info {
  flex: 1;
}

.wa-chat-header-name {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.wa-chat-header-status {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.wa-status-dot {
  width: 8px;
  height: 8px;
  background: #80ffb4;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 关闭按钮 */
.wa-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.wa-chat-close:hover { opacity: 1; }

.wa-chat-close svg {
  width: 20px;
  height: 20px;
  fill: rgba(255,255,255,0.8);
}

/* 卡片主体 */
.wa-chat-body {
  padding: 16px 18px;
  background: var(--color-bg-card);
}

.wa-chat-greeting {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* 快捷消息气泡 */
.wa-quick-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-quick-btn {
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #25D366;
  font-size: 13px;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-quick-btn::before {
  content: '💬';
  font-size: 14px;
}

.wa-quick-btn:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.5);
  transform: translateX(3px);
}

/* 底部联系按钮 */
.wa-chat-footer {
  padding: 14px 18px 18px;
}

.wa-open-chat-btn {
  width: 100%;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
}

.wa-open-chat-btn:hover {
  background: #20bd5a;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}

.wa-open-chat-btn svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

/* 打字指示动画 */
.wa-typing {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
}

.wa-typing span {
  width: 6px;
  height: 6px;
  background: #25D366;
  border-radius: 50%;
  animation: wa-typing-bounce 1.4s ease-in-out infinite;
}

.wa-typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wa-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
  .wa-fab-container {
    bottom: 16px;
    right: 16px;
  }

  .wa-fab {
    width: 54px;
    height: 54px;
  }

  .wa-fab svg {
    width: 28px;
    height: 28px;
  }

  .wa-chat-card {
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}
