/* ── SWAH Brand Variables (logo palette: navy + crimson) ── */
:root {
  --sw-green:       #1d3461;
  --sw-green-dark:  #152548;
  --sw-green-light: #eef2f9;
  --sw-green-glow:  rgba(29,52,97,0.22);
  --sw-accent:      #c41e1e;
  --sw-bg:          #ffffff;
  --sw-surface:     #f6f8fc;
  --sw-border:      #d0daea;
  --sw-text:        #1a2a4a;
  --sw-muted:       #7a8db0;
  --sw-user-bubble: #1d3461;
  --sw-bot-bubble:  #f0f4fb;
  --sw-radius:      18px;
  --sw-shadow:      0 24px 64px rgba(21,37,72,0.18), 0 0 0 1px rgba(29,52,97,0.08);
}

/* ── Floating Bubble ── */
#swah-chat-bubble {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-green), var(--sw-green-dark));
  box-shadow: 0 8px 28px var(--sw-green-glow), 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,0.3);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s;
  z-index: 9999;
}
#swah-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 40px var(--sw-green-glow), 0 4px 12px rgba(0,0,0,0.2);
}
#swah-chat-bubble::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--sw-green);
  opacity: 0;
  animation: swah-pulse-ring 3s ease-out infinite;
}
@keyframes swah-pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.55); opacity: 0; }
}
.swah-notif-dot {
  position: absolute; top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: var(--sw-accent);
  border-radius: 50%;
  border: 2px solid #fff;
  animation: swah-notif-pop 1.5s ease-in-out infinite alternate;
}
@keyframes swah-notif-pop {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}
.swah-icon-close { display: none; }
#swah-chat-bubble.open .swah-icon-chat { display: none; }
#swah-chat-bubble.open .swah-icon-close { display: flex; }

/* ── Chat Window ── */
#swah-chat-window {
  position: fixed;
  bottom: 108px; right: 28px;
  width: 370px; height: 570px;
  background: var(--sw-bg);
  border-radius: var(--sw-radius);
  box-shadow: var(--sw-shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--sw-border);
  z-index: 9998;
  transform: scale(0.88) translateY(18px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.34,1.4,.64,1), opacity 0.25s ease;
  font-family: 'Nunito', sans-serif;
}
#swah-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.swah-chat-header {
  background: linear-gradient(135deg, var(--sw-green), var(--sw-green-dark));
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
  position: relative;
}
.swah-chat-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.15);
}
.swah-header-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.swah-header-info { flex: 1; }
.swah-header-name {
  font-size: 15px; font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.swah-header-sub {
  font-size: 12px; color: rgba(255,255,255,0.75);
  display: flex; align-items: center; gap: 5px;
  margin-top: 3px;
}
.swah-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7ee8a2;
  box-shadow: 0 0 6px #7ee8a2;
  animation: swah-blink 2s ease-in-out infinite;
}
@keyframes swah-blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.swah-header-close {
  background: rgba(255,255,255,0.15); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background 0.2s;
}
.swah-header-close:hover { background: rgba(255,255,255,0.28); }

/* Welcome banner */
.swah-welcome-banner {
  background: var(--sw-green-light);
  border-bottom: 1px solid var(--sw-border);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--sw-green-dark);
  display: flex; align-items: center; gap: 8px;
  line-height: 1.4;
  font-family: 'Nunito', sans-serif;
}
.swah-welcome-banner span { font-size: 16px; }

/* Messages */
.swah-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 14px; display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.swah-chat-messages::-webkit-scrollbar { width: 4px; }
.swah-chat-messages::-webkit-scrollbar-track { background: transparent; }
.swah-chat-messages::-webkit-scrollbar-thumb { background: var(--sw-border); border-radius: 4px; }

.swah-msg { display: flex; flex-direction: column; gap: 3px; animation: swah-msg-in 0.3s cubic-bezier(.34,1.4,.64,1); }
@keyframes swah-msg-in { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:none; } }
.swah-msg.user { align-items: flex-end; }
.swah-msg.bot  { align-items: flex-start; }

.swah-msg-row { display: flex; align-items: flex-end; gap: 7px; }
.swah-msg.bot .swah-msg-row { flex-direction: row; }
.swah-msg.user .swah-msg-row { flex-direction: row-reverse; }

.swah-bot-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--sw-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  margin-bottom: 2px;
}

.swah-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
  font-family: 'Nunito', sans-serif;
}
.swah-msg.user .swah-bubble {
  background: var(--sw-user-bubble);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.swah-msg.bot .swah-bubble {
  background: var(--sw-bot-bubble);
  color: var(--sw-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--sw-border);
}
.swah-msg.bot .swah-bubble a { color: var(--sw-green); font-weight: 600; }
.swah-msg.bot .swah-bubble code {
  background: rgba(29,52,97,0.08);
  color: var(--sw-green-dark);
  padding: 1px 5px; border-radius: 4px;
  font-size: 12.5px;
}
.swah-msg-time { font-size: 10.5px; color: var(--sw-muted); padding: 0 4px; font-family: 'Nunito', sans-serif; }

/* Typing */
.swah-typing-bubble { display:flex; align-items:center; gap:4px; padding:14px 16px; }
.swah-typing-bubble span {
  width:7px; height:7px; border-radius:50%;
  background: var(--sw-muted);
  animation: swah-typing 1.2s ease-in-out infinite;
}
.swah-typing-bubble span:nth-child(2){animation-delay:.2s;}
.swah-typing-bubble span:nth-child(3){animation-delay:.4s;}
@keyframes swah-typing { 0%,60%,100%{transform:translateY(0);opacity:0.4;} 30%{transform:translateY(-5px);opacity:1;} }

/* FAQ Chips */
.swah-faq-chips {
  padding: 0 12px 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.swah-faq-chip {
  background: var(--sw-green-light);
  border: 1px solid var(--sw-border);
  color: var(--sw-green-dark);
  font-size: 12px; font-weight: 600;
  font-family: 'Nunito', sans-serif;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.swah-faq-chip:hover {
  background: var(--sw-green);
  border-color: var(--sw-green);
  color: #fff;
  transform: translateY(-1px);
}

/* Input */
.swah-chat-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--sw-border);
  background: var(--sw-surface);
  display: flex; gap: 8px; align-items: flex-end;
}
#swah-chat-input {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--sw-border);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: 'Nunito', sans-serif;
  color: var(--sw-text);
  outline: none; resize: none;
  min-height: 40px; max-height: 90px;
  line-height: 1.5;
  transition: border-color 0.2s;
}
#swah-chat-input::placeholder { color: var(--sw-muted); }
#swah-chat-input:focus { border-color: var(--sw-green); }
#swah-send-btn {
  width: 40px; height: 40px;
  background: var(--sw-green);
  border: none; border-radius: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
#swah-send-btn:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(29,52,97,0.35); }
#swah-send-btn:active { transform: scale(0.95); }

/* ── Welcome Popup (bottom-right card) ── */
#swah-popup-overlay {
  position: fixed;
  bottom: 108px; right: 28px;
  width: 320px;
  z-index: 99997;
  animation: swah-popup-in 0.4s cubic-bezier(.34,1.4,.64,1);
}
#swah-popup-overlay.hiding {
  animation: swah-popup-out 0.3s ease forwards;
}
@keyframes swah-popup-in {
  from { opacity:0; transform: translateY(20px) scale(0.92); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
@keyframes swah-popup-out {
  to { opacity:0; transform: translateY(16px) scale(0.92); }
}

#swah-popup-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(21,37,72,0.18), 0 0 0 1px rgba(29,52,97,0.1);
  position: relative;
}

/* Compact hero strip */
.swah-popup-hero {
  background: linear-gradient(135deg, var(--sw-green) 0%, var(--sw-green-dark) 100%);
  padding: 18px 16px 14px;
  display: flex; align-items: center; gap: 12px;
  position: relative;
  overflow: hidden;
}
.swah-popup-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='38' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='1'/%3E%3C/svg%3E") center/160px repeat;
  opacity: 0.5;
}
.swah-popup-paw {
  font-size: 34px; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
  animation: swah-paw-bounce 2s ease-in-out infinite;
  position: relative;
}
@keyframes swah-paw-bounce {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-4px) rotate(5deg); }
}
.swah-popup-hero-text { flex: 1; position: relative; }
.swah-popup-hero h2 {
  font-size: 14px; font-weight: 800;
  color: #fff; line-height: 1.2;
  margin: 0 0 3px;
  font-family: 'Nunito', sans-serif;
}
.swah-popup-hero p {
  font-size: 11.5px; color: rgba(255,255,255,0.82);
  line-height: 1.4; margin: 0;
  font-family: 'Nunito', sans-serif;
}
.swah-popup-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff; font-size: 9px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  margin-bottom: 5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'Nunito', sans-serif;
}

.swah-popup-body {
  padding: 14px 16px 16px;
}

.swah-popup-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.swah-popup-info-card {
  background: var(--sw-green-light);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.swah-popup-info-card .ic-icon { font-size: 18px; margin-bottom: 3px; }
.swah-popup-info-card .ic-label {
  font-size: 9.5px; font-weight: 700; color: var(--sw-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 2px;
  font-family: 'Nunito', sans-serif;
}
.swah-popup-info-card .ic-value {
  font-size: 11.5px; font-weight: 700; color: var(--sw-text);
  line-height: 1.3;
  font-family: 'Nunito', sans-serif;
}
.swah-popup-info-card .ic-value a { color: var(--sw-green); text-decoration: none; }

.swah-popup-hours {
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 11.5px;
  font-family: 'Nunito', sans-serif;
}
.swah-popup-hours-title {
  font-weight: 800; color: var(--sw-text);
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
  font-size: 12px;
}
.swah-popup-hours-row {
  display: flex; justify-content: space-between;
  color: var(--sw-text); padding: 2px 0;
  border-bottom: 1px dashed var(--sw-border);
}
.swah-popup-hours-row:last-child { border-bottom: none; }
.swah-popup-hours-row .day { font-weight: 600; color: var(--sw-muted); }
.swah-popup-hours-row .time { font-weight: 700; color: var(--sw-green-dark); }
.swah-popup-hours-row.closed .time { color: #e05252; }

.swah-popup-cta {
  display: flex; gap: 8px;
}
.swah-btn-primary {
  flex: 1; background: var(--sw-accent);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 8px; font-size: 12.5px; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
}
.swah-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(196,30,30,0.3);
}
.swah-btn-secondary {
  flex: 1; background: transparent;
  color: var(--sw-green); border: 2px solid var(--sw-border);
  border-radius: 10px;
  padding: 10px 8px; font-size: 12.5px; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: all 0.15s;
}
.swah-btn-secondary:hover {
  border-color: var(--sw-green);
  background: var(--sw-green-light);
}

#swah-popup-close-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background 0.2s;
  z-index: 2;
}
#swah-popup-close-x:hover { background: rgba(255,255,255,0.32); }

.swah-chat-credit {
  text-align: center;
  font-size: 10px;
  color: var(--sw-muted);
  padding-bottom: 4px;
  letter-spacing: 0.02em;
  font-family: 'Nunito', sans-serif;
}

@media (max-width: 420px) {
  #swah-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 100px;
  }
  #swah-chat-bubble { bottom: 18px; right: 18px; }
  #swah-popup-overlay {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 100px;
  }
}
