/* Compact WhatsApp chat launcher — minimize / hide */
.wa-chat {
  --wa-green: #25d366;
  --wa-green-dark: #128c7e;
  --wa-ink: #111b21;
  --wa-muted: #667781;
  --wa-bubble: #fff;
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 1040;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}
.wa-chat.is-hidden {
  display: none !important;
}
.wa-chat__fab {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  box-shadow: 0 6px 18px rgba(18, 140, 126, 0.4);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}
.wa-chat__fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(18, 140, 126, 0.5);
}
.wa-chat__fab svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}
.wa-chat__fab-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  border: 2px solid #fff;
}
.wa-chat.is-open .wa-chat__fab {
  display: none;
}

.wa-chat__panel {
  width: min(300px, calc(100vw - 28px));
  background: var(--wa-bubble);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  animation: wa-chat-in 0.2s ease;
}
.wa-chat.is-open .wa-chat__panel {
  display: flex;
}
@keyframes wa-chat-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(135deg, var(--wa-green-dark), #075e54);
  color: #fff;
}
.wa-chat__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wa-chat__avatar svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}
.wa-chat__meta {
  flex: 1;
  min-width: 0;
}
.wa-chat__meta strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-chat__meta span {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 1px;
}
.wa-chat__tools {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.wa-chat__tools button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  opacity: 0.9;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
}
.wa-chat__tools button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.wa-chat__body {
  background: #ece5dd;
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 12px 12px;
  padding: 14px 12px 12px;
  min-height: 110px;
}
.wa-chat__bubble {
  max-width: 92%;
  background: #fff;
  color: var(--wa-ink);
  border-radius: 0 12px 12px 12px;
  padding: 9px 11px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  position: relative;
}
.wa-chat__bubble time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--wa-muted);
  margin-top: 4px;
}
.wa-chat__foot {
  padding: 10px 12px 12px;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-chat__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 22px;
  background: var(--wa-green);
  color: #fff !important;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}
.wa-chat__cta:hover {
  background: #1ebe57;
  color: #fff !important;
  transform: translateY(-1px);
}
.wa-chat__cta svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.wa-chat__hint {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: var(--wa-muted);
}

/* Sit above bottom nav / cart FAB on shop */
body.has-pnl-tabbar .wa-chat,
body.has-bottom-nav .wa-chat,
.auth-panel-body .wa-chat,
.auth-app-body .wa-chat {
  bottom: 78px;
}
@media (max-width: 767px) {
  .wa-chat { right: 12px; bottom: 16px; }
  body.has-pnl-tabbar .wa-chat,
  body.has-bottom-nav .wa-chat,
  .auth-panel-body .wa-chat,
  .auth-app-body .wa-chat {
    bottom: 74px;
  }
}
