/* ============================================
   AWD WhatsApp Concierge — Widget Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --awd-wa-green: #25D366;
  --awd-wa-green-dark: #128C7E;
  --awd-wa-green-darker: #075E54;
  --awd-wa-light: #DCF8C6;
  --awd-wa-bg: #ECE5DD;
  --awd-wa-accent: #e94560;
  --awd-wa-size: 64px;
  --awd-wa-bottom: 24px;
  --awd-wa-right: 24px;
  --awd-wa-left: 24px;
  --awd-wa-shadow: 0 4px 24px rgba(0,0,0,0.12);
  --awd-wa-shadow-strong: 0 8px 32px rgba(0,0,0,0.2);
}

/* ── Container ── */
.awd-wa-widget {
  position: fixed;
  bottom: var(--awd-wa-bottom);
  z-index: 999999;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  box-sizing: border-box;
}

.awd-wa-widget *,
.awd-wa-widget *::before,
.awd-wa-widget *::after {
  box-sizing: border-box;
}

.awd-wa-widget--right {
  right: var(--awd-wa-right);
}

.awd-wa-widget--left {
  left: var(--awd-wa-left);
}

/* ── Floating Button ── */
.awd-wa-fab {
  width: var(--awd-wa-size);
  height: var(--awd-wa-size);
  border-radius: 50%;
  background: var(--awd-wa-green);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--awd-wa-shadow-strong);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              background 0.2s ease;
  position: relative;
  padding: 0;
  outline: none;
}

.awd-wa-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 40px rgba(37, 211, 102, 0.4);
  background: var(--awd-wa-green-dark);
}

.awd-wa-fab:active {
  transform: scale(0.95);
}

.awd-wa-fab svg {
  width: 34px;
  height: 34px;
  fill: white;
}

/* Pulse */
.awd-wa-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--awd-wa-green);
  opacity: 0;
  animation: awd-wa-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes awd-wa-pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Badge */
.awd-wa-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: var(--awd-wa-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  border: 2px solid white;
  animation: awd-wa-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes awd-wa-badge-pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ── Tooltip ── */
.awd-wa-tooltip {
  position: absolute;
  bottom: calc(var(--awd-wa-size) + 12px);
  background: white;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--awd-wa-shadow);
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  animation: awd-wa-tooltip-in 0.5s 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}

.awd-wa-widget--right .awd-wa-tooltip {
  right: 0;
}

.awd-wa-widget--left .awd-wa-tooltip {
  left: 0;
}

.awd-wa-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}

.awd-wa-widget--right .awd-wa-tooltip::after {
  right: 24px;
}

.awd-wa-widget--left .awd-wa-tooltip::after {
  left: 24px;
}

@keyframes awd-wa-tooltip-in {
  to { opacity: 1; transform: translateY(0); }
}

.awd-wa-widget.popup-open .awd-wa-tooltip {
  display: none;
}

/* ── Popup ── */
.awd-wa-popup {
  position: absolute;
  bottom: calc(var(--awd-wa-size) + 16px);
  width: 360px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--awd-wa-shadow-strong);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.awd-wa-widget--right .awd-wa-popup {
  right: 0;
}

.awd-wa-widget--left .awd-wa-popup {
  left: 0;
}

.awd-wa-popup.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.awd-wa-header {
  background: var(--awd-wa-green-darker);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.awd-wa-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--awd-wa-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}

.awd-wa-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.awd-wa-header-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  gap: 5px;
}

.awd-wa-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--awd-wa-green);
  display: inline-block;
  animation: awd-wa-online-blink 2s infinite;
}

@keyframes awd-wa-online-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.awd-wa-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.awd-wa-close:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* Body */
.awd-wa-body {
  background: var(--awd-wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9c2b8' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  padding: 20px;
  min-height: 120px;
}

.awd-wa-bubble {
  background: white;
  border-radius: 0 12px 12px 12px;
  padding: 12px 16px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
  color: #303030;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  position: relative;
  animation: awd-wa-bubble-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.awd-wa-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-top: 0 solid transparent;
  border-right: 8px solid white;
  border-bottom: 8px solid transparent;
}

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

.awd-wa-bubble-time {
  font-size: 11px;
  color: #999;
  text-align: right;
  margin-top: 4px;
}

/* Footer */
.awd-wa-footer {
  background: white;
  padding: 14px 20px;
  border-top: 1px solid #eee;
}

.awd-wa-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--awd-wa-green);
  color: white !important;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none !important;
}

.awd-wa-cta:hover {
  background: var(--awd-wa-green-dark);
  transform: translateY(-1px);
  color: white !important;
  text-decoration: none !important;
}

.awd-wa-cta:active {
  transform: translateY(0);
}

.awd-wa-cta svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.awd-wa-gdpr {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* ── Mobile ── */
@media (max-width: 420px) {
  .awd-wa-popup {
    width: calc(100vw - 16px);
  }

  .awd-wa-widget--right .awd-wa-popup {
    right: -8px;
  }

  .awd-wa-widget--left .awd-wa-popup {
    left: -8px;
  }
}
