/* ============================================================
   99-chat-widget — LeadConnector chat widget (sections/99-chat-widget.html).
   The widget paints its bubble bottom-right from inside its shadow root.
   - Hidden while the mobile menu is open so it can't cover menu items or
     the menu's phone / booking buttons.
   - The Back to Top button (23-totop) shares that corner: once the chat loads
     (html.has-lc-chat) it moves bottom-left on desktop and stacks above the bubble on phones.
   ============================================================ */
body.sec-01-nav-lock chat-widget {
  display: none !important;
}

/* Desktop: the widget's "Hi there! Have a question?" greeting opens on its own and
   sat on top of the button (it couldn't be clicked; 2026-10-15 QA), so the button
   moves to the empty bottom-left corner once the chat loads. */
html.has-lc-chat .sec-23-totop {
  right: auto;
  left: clamp(16px, 2.5vw, 28px);
}

@media (max-width: 820px) {
  /* Bubble sits 16px above the 56px Call | Book bar (lifted in the widget's
     shadow root), so the button clears both. */
  html.has-lc-chat .sec-23-totop,
  html.has-lc-chat body:has(.sec-17-mobilebar.is-hidden) .sec-23-totop {
    left: auto;
    right: 14px;
    bottom: calc(56px + 16px + 72px + env(safe-area-inset-bottom));
  }
  /* At the very end of the page the bubble and Back to Top button covered the
     footer's last lines (accessibility note, copyright; 2026-10-15 QA). Reserve
     room for the bar + bubble + button stack. */
  html.has-lc-chat .sec-14-footer {
    padding-bottom: calc(56px + 16px + 72px + 44px + 16px + env(safe-area-inset-bottom));
  }
}
