/* ============================================
   WhatsApp floating widget
   ============================================ */

.wa-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--font-sans);
}

/* FAB */
.wa-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(37,211,102,0.4), 0 4px 12px rgba(0,0,0,0.15);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  order: 2;
}
.wa-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 16px 40px rgba(37,211,102,0.5), 0 6px 16px rgba(0,0,0,0.18);
}
.wa-fab:active { transform: translateY(0) scale(1); }
.wa-fab--open {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.wa-fab__icon {
  animation: wa-bob 2.6s ease-in-out infinite;
}
@keyframes wa-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

.wa-fab__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: #FF4D4D;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  animation: wa-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes wa-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* Nudge bubble */
.wa-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 12px 14px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px 14px 4px 14px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  order: 1;
  animation: wa-nudge-in 0.4s cubic-bezier(0.2,0.7,0.2,1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-nudge:hover { transform: translateY(-2px); }
.wa-nudge__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-nudge__body strong {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.wa-nudge__body span {
  font-size: 12px;
  color: var(--text-muted);
}
.wa-nudge__close {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  flex-shrink: 0;
}
.wa-nudge__close:hover { background: var(--surface-2); color: var(--text); }

@keyframes wa-nudge-in {
  0%   { opacity: 0; transform: translateY(8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Panel */
.wa-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,0.25), 0 8px 24px -8px rgba(0,0,0,0.12);
  overflow: hidden;
  order: 1;
  display: flex;
  flex-direction: column;
  animation: wa-panel-in 0.3s cubic-bezier(0.2,0.7,0.2,1);
  transform-origin: bottom right;
}
@keyframes wa-panel-in {
  0%   { opacity: 0; transform: translateY(12px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Head */
.wa-panel__head {
  position: relative;
  padding: 22px 18px 18px;
  color: #fff;
  overflow: hidden;
}
.wa-panel__head-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #128C7E 0%, #25D366 100%);
}
.wa-panel__head-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0, transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0, transparent 40%);
}
.wa-panel__head-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.wa-panel__avatars { display: flex; flex-shrink: 0; }
.wa-av {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6FB1D6, #054466);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #128C7E;
  margin-left: -10px;
}
.wa-av--1 { margin-left: 0; background: linear-gradient(135deg, #4A90E2, #0A7ABF); }
.wa-av--2 { background: linear-gradient(135deg, #F5A623, #D98E1F); z-index: 1; }
.wa-av--3 { background: linear-gradient(135deg, #7ED321, #128C7E); z-index: 2; }

.wa-panel__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wa-panel__sub {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}
.wa-online {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #B8FF7E;
  box-shadow: 0 0 0 2px rgba(184,255,126,0.3);
  animation: wa-pulse 2s infinite;
}
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(184,255,126,0.3); }
  50%      { box-shadow: 0 0 0 5px rgba(184,255,126,0); }
}

.wa-panel__close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.wa-panel__close:hover { background: rgba(255,255,255,0.15); }

/* Body */
.wa-panel__body {
  flex: 1;
  background:
    radial-gradient(circle at 0% 0%, var(--surface-2), transparent 60%),
    repeating-linear-gradient(45deg, transparent 0, transparent 30px, color-mix(in srgb, var(--text-faint) 5%, transparent) 30px, color-mix(in srgb, var(--text-faint) 5%, transparent) 31px),
    var(--bg-elev);
  padding: 18px 16px 12px;
  max-height: 320px;
  overflow-y: auto;
}

.wa-message { margin-bottom: 10px; }
.wa-msg-from {
  font-size: 11px;
  font-weight: 600;
  color: #128C7E;
  margin: 0 12px 4px;
}
.wa-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 4px 14px 14px 14px;
  max-width: 86%;
  box-shadow: var(--shadow-xs);
  text-wrap: pretty;
}
.wa-message + .wa-message .wa-msg-bubble {
  border-radius: 14px 14px 14px 4px;
  margin-left: 24px;
}
.wa-msg-time {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 4px;
  padding-left: 24px;
}

.wa-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.wa-quick button {
  text-align: left;
  background: var(--surface);
  border: 1px solid rgba(18,140,126,0.25);
  color: #128C7E;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.wa-quick button:hover {
  background: rgba(37,211,102,0.08);
  transform: translateX(2px);
}

/* Input */
.wa-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.wa-input input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border 0.15s ease, background 0.15s ease;
}
.wa-input input:focus {
  border-color: #128C7E;
  background: var(--surface);
}
.wa-input button {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.wa-input button:hover { background: #128C7E; transform: scale(1.05); }

.wa-foot {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 14px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

@media (max-width: 480px) {
  .wa-widget { bottom: 14px; right: 14px; }
  .wa-fab { width: 54px; height: 54px; }
  .wa-panel { width: calc(100vw - 28px); }
  .wa-nudge { max-width: calc(100vw - 92px); }
}
