/* ============================================================
   whatsapp.css — floating WhatsApp chat launcher, global.
   A round button bottom-right opens a WhatsApp-style chat panel.
   Typing a message and sending opens WhatsApp (app or web) with the
   message prefilled to the venue's number, so the conversation
   continues in WhatsApp itself. Nothing is sent from the site.

   Positioning: the site has a global sticky book bar fixed to the
   bottom (.book-bar, height --cta-h). This launcher floats ABOVE it
   and drops down to the screen edge when the bar hides, so the two
   never overlap. Sits below the sticky-cta layer so the book bar and
   booking modal always win.
   ============================================================ */

:root {
  --wa-green: #25d366;
  --wa-green-dark: #1da851;
  --wa-header: #075e54;
  --wa-chat-bg: #e5ddd5;
  --wa-bubble-in: #ffffff;
  --wa-ink: #111b21;
  --wa-ink-soft: #667781;
  --wa-gap: 18px;
}

/* ---- Launch button ---------------------------------------- */
.wa-fab {
  position: fixed;
  right: var(--wa-gap);
  bottom: calc(var(--cta-h, 72px) + var(--wa-gap) + env(safe-area-inset-bottom));
  z-index: 30;                 /* below --z-sticky-cta (40): book bar + modal win */
  width: 58px; height: 58px;
  border: none; border-radius: 50%;
  background: var(--wa-green);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  transition: transform 200ms ease, bottom 320ms cubic-bezier(.4,0,.2,1), background 160ms ease;
}
.wa-fab:hover { background: var(--wa-green-dark); transform: scale(1.06); }
.wa-fab:active { transform: scale(0.97); }
.wa-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.wa-fab svg { width: 32px; height: 32px; }

/* When the book bar has scrolled away, drop the button to the edge. */
.wa-fab.wa-bar-hidden {
  bottom: calc(var(--wa-gap) + env(safe-area-inset-bottom));
}

/* Gentle one-off attention pulse, respects reduced motion. */
.wa-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37,211,102,0.5);
  animation: wa-pulse 2.4s ease-out 3;   /* three pulses then stops */
}
@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.45); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.wa-fab.wa-open::after { animation: none; }   /* stop pulsing once used */

/* ---- Chat panel ------------------------------------------- */
.wa-panel {
  position: fixed;
  right: var(--wa-gap);
  bottom: calc(var(--cta-h, 72px) + var(--wa-gap) + 70px + env(safe-area-inset-bottom));
  z-index: 31;
  width: 340px; max-width: calc(100vw - (var(--wa-gap) * 2));
  border-radius: 14px; overflow: hidden;
  background: var(--wa-chat-bg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.32);
  font-family: "Manrope", system-ui, sans-serif;
  transform: translateY(12px) scale(0.98); opacity: 0; visibility: hidden;
  transform-origin: bottom right;
  transition: transform 220ms cubic-bezier(.4,0,.2,1), opacity 220ms ease, visibility 220ms, bottom 320ms cubic-bezier(.4,0,.2,1);
}
.wa-panel.wa-bar-hidden {
  bottom: calc(var(--wa-gap) + 70px + env(safe-area-inset-bottom));
}
.wa-panel.wa-show { transform: translateY(0) scale(1); opacity: 1; visibility: visible; }

/* Header */
.wa-head {
  background: var(--wa-header);
  color: #fff;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.wa-head-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: #fff; object-fit: cover;
}
.wa-head-meta { min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.wa-head-name { font-weight: 700; font-size: 15px; }
.wa-head-status { font-size: 12px; color: rgba(255,255,255,0.75); }
.wa-head-close {
  background: none; border: none; color: #fff; cursor: pointer;
  padding: 4px; border-radius: 6px; display: grid; place-items: center;
  flex: 0 0 auto;
}
.wa-head-close:hover { background: rgba(255,255,255,0.15); }
.wa-head-close svg { width: 20px; height: 20px; }

/* Chat body */
.wa-body {
  padding: 18px 14px 10px;
  min-height: 150px;
  background-image: linear-gradient(rgba(229,221,213,0.9), rgba(229,221,213,0.9));
}
.wa-bubble {
  background: var(--wa-bubble-in);
  color: var(--wa-ink);
  padding: 8px 11px 9px;
  border-radius: 8px;
  border-top-left-radius: 0;
  max-width: 85%;
  font-size: 14px; line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
  position: relative;
}
.wa-bubble + .wa-bubble { margin-top: 8px; }
.wa-bubble .wa-time {
  display: block; text-align: right;
  font-size: 10px; color: var(--wa-ink-soft); margin-top: 3px;
}

/* Input row */
.wa-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px; background: #f0f0f0;
}
.wa-input {
  flex: 1 1 auto; min-width: 0;
  border: none; border-radius: 20px;
  padding: 10px 14px; font-size: 14px;
  font-family: inherit; resize: none;
  max-height: 90px; line-height: 1.35;
  background: #fff; color: var(--wa-ink);
}
.wa-input:focus { outline: none; }
.wa-send {
  flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  border: none; background: var(--wa-green); color: #fff;
  cursor: pointer; display: grid; place-items: center;
  transition: background 160ms ease, transform 120ms ease;
}
.wa-send:hover { background: var(--wa-green-dark); }
.wa-send:active { transform: scale(0.94); }
.wa-send:disabled { opacity: 0.45; cursor: default; }
.wa-send svg { width: 20px; height: 20px; }

/* ---- Mobile ----------------------------------------------- */
@media (max-width: 480px) {
  .wa-fab { width: 52px; height: 52px; }
  .wa-fab svg { width: 28px; height: 28px; }
  .wa-panel { width: calc(100vw - (var(--wa-gap) * 2)); }
}

@media (prefers-reduced-motion: reduce) {
  .wa-fab, .wa-panel { transition: opacity 160ms ease, visibility 160ms; }
  .wa-fab::after { animation: none; }
  .wa-fab:hover { transform: none; }
}
