/* Site-wide redesign of the 3 floating buttons (all has-site-chrome pages).
   All three: same size, one right-hand stack, bottom to top:
     1. go-top (bottom, nearest the corner)
     2. chatbot
     3. quick-fab "+" (top)
   The stack lifts clear of the footer (and, on loan-optimization.html, the
   mobile sticky CTA bar) only while those are actually in view — no
   permanent dead space. Only one pulsing ring instead of two competing ones. */

body.has-site-chrome {
  --fab-size: 2.75rem;
  --stack-gap: 0.7rem;
  --footer-avoid-lift: 0px;
  --sticky-cta-lift: 0px;
  --chatbot-launcher-size: var(--fab-size);
  --edge-x: max(var(--corner-inset, 1.25rem), env(safe-area-inset-right, 0px));
  --edge-y: max(var(--corner-inset, 1.25rem), env(safe-area-inset-bottom, 0px));
}

body.has-site-chrome.is-near-footer {
  --footer-avoid-lift: 3.5rem;
}

@media (max-width: 767px) {
  body.has-site-chrome.is-near-footer {
    --footer-avoid-lift: 9rem;
  }
}

/* Only ever toggled on loan-optimization.html when its mobile sticky CTA
   bar is visible; lifting the whole stack keeps all 3 buttons above it
   instead of just some of them. */
body.has-site-chrome.has-sticky-cta {
  --sticky-cta-lift: 4.85rem;
}

/* 1. go-top — bottom of the stack, right side */
body.has-site-chrome .go-top {
  left: auto;
  right: var(--edge-x);
  width: var(--fab-size);
  height: var(--fab-size);
  font-size: 1.2rem;
  bottom: calc(var(--edge-y) + var(--cookie-banner-offset, 0px) + var(--footer-avoid-lift) + var(--sticky-cta-lift));
}

/* 2. chatbot — middle of the stack */
body.has-site-chrome .site-chatbot {
  right: var(--edge-x);
  bottom: calc(var(--edge-y) + var(--fab-size) + var(--stack-gap) + var(--cookie-banner-offset, 0px) + var(--footer-avoid-lift) + var(--sticky-cta-lift));
}

body.has-site-chrome .site-chatbot__launcher-icon--bot i,
body.has-site-chrome .site-chatbot__launcher-icon--close i {
  font-size: 1.3rem;
}

/* 3. quick-fab "+" — top of the stack */
body.has-site-chrome .site-quick-fab {
  right: var(--edge-x);
  bottom: calc(var(--edge-y) + (var(--fab-size) * 2) + (var(--stack-gap) * 2) + var(--cookie-banner-offset, 0px) + var(--footer-avoid-lift) + var(--sticky-cta-lift));
}

body.has-site-chrome.chatbot-open .site-quick-fab {
  bottom: calc(var(--edge-y) + var(--chatbot-open-stack, 24rem) + var(--stack-gap) + var(--cookie-banner-offset, 0px) + var(--footer-avoid-lift) + var(--sticky-cta-lift));
}

body.has-site-chrome .site-quick-fab__toggle {
  width: var(--fab-size);
  height: var(--fab-size);
}

body.has-site-chrome .site-quick-fab__toggle .site-quick-fab__icon-main i {
  font-size: 1.3rem;
}

body.has-site-chrome .site-quick-fab__circle {
  width: calc(var(--fab-size) * 0.86);
  height: calc(var(--fab-size) * 0.86);
}

/* The closed menu was a normal flex item, so its full (invisible) height sat
   above the toggle and stole hover — moving the mouse over that empty gap
   opened the menu even though nothing was actually under the pointer. Taking
   it out of flow makes the toggle the only hoverable shape again. */
body.has-site-chrome .site-quick-fab__menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + var(--stack-gap));
  margin: 0;
}

/* Two independently blinking attention rings stacked on the same corner read
   as cluttered. Keep the pulse on the chatbot launcher only; the quick-fab
   "+" toggle stays calm until hovered/focused. */
body.has-site-chrome .site-quick-fab:not(.is-open) .site-quick-fab__toggle::after {
  animation: none;
  opacity: 0;
}

/* Mobile footer bar: force "Design & Developed by VedaVerse" to render last,
   regardless of the cookie-consent script appending its link after it. */
@media (max-width: 640px) {
  body.has-site-chrome .footer-bottom__credit {
    order: 2;
  }
}
