/* ============================================
   WhatsApp Widget
   ============================================ */

#wa-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Trigger button ── */
#wa-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #765285;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(118, 82, 133, .45);
  transition: transform .2s ease, box-shadow .2s ease;
  outline: none;
}
#wa-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(118, 82, 133, .55);
  background: #5a3d66;
}
#wa-trigger svg { display: block; }

/* Pulse ring */
#wa-trigger::before {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(118, 82, 133, .3);
  animation: wa-pulse 2.2s ease-out infinite;
}
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ── Panel ── */
#wa-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
  overflow: hidden;

  /* hidden state */
  opacity: 0;
  transform: translateY(12px) scale(.96);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#wa-panel.wa-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Panel header */
#wa-panel-header {
  background: #0f2740;
  padding: 16px 18px 14px;
  color: #fff;
}
#wa-panel-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
#wa-panel-header p {
  margin: 0;
  font-size: 12px;
  opacity: .8;
  color: #fff;
}

/* Contacts list */
#wa-panel-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f5f5;
  text-decoration: none;
  color: inherit;
  transition: background .18s ease, transform .18s ease;
}
.wa-contact:hover {
  background: #f0eaf3;
  transform: translateX(3px);
  text-decoration: none;
  color: inherit;
}

/* Avatar */
.wa-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #765285;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wa-info { flex: 1; min-width: 0; }
.wa-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-status {
  font-size: 11px;
  color: #ef7d32;
  margin-top: 2px;
}

/* Arrow icon */
.wa-arrow {
  flex-shrink: 0;
  color: #765285;
}

/* Footer */
#wa-panel-footer {
  padding: 8px 12px 12px;
  text-align: center;
  font-size: 10px;
  color: #aaa;
}
#wa-panel-footer a { color: #aaa; text-decoration: none; }

/* ── Mobile ── */
@media (max-width: 480px) {
  #wa-widget {
    bottom: 16px;
    right: 16px;
  }
  #wa-panel {
    width: calc(100vw - 32px);
    right: -8px; /* align to screen edge with gap */
  }
}
