/* Astoria site-wide mobile CTA bar — 12.11.2026
   Local-only package. The bar itself stays hidden on desktop (>=1024px).
   Phone/e-mail LTR-isolate rules also apply on desktop (RTL number order).

   On viewports where the compact sticky bar is visible (max-width 1023px,
   matching the existing .mobile-agent-bar rule in styles.css), hide the
   floating WhatsApp and “Send an inquiry” pills and the back-to-top button
   so they cannot cover content. The bar already offers Call, WhatsApp and
   Enquire. Cookie banner styles are not touched.

   Property pages already get a bar from property.js plus this morning’s
   hide-pills CSS. These rules also apply there if this file is loaded;
   padding uses the same 92px value so it is not doubled.
*/

@media (max-width: 1023px) {
  body:has(.mobile-agent-bar) .wa-float,
  body.has-mobile-agent-bar .wa-float,
  body:has(.mobile-agent-bar) .chat-float,
  body.has-mobile-agent-bar .chat-float {
    display: none !important;
  }

  /* Zero the older follow-up spacer so padding is not doubled. */
  body:has(.mobile-agent-bar) #astoriaFloatingSpaceV1,
  body.has-mobile-agent-bar #astoriaFloatingSpaceV1 {
    height: 0 !important;
  }

  /* So scrollIntoView / in-page anchors stop above the bar. */
  html:has(.mobile-agent-bar),
  body:has(.mobile-agent-bar),
  html:has(body.has-mobile-agent-bar),
  body.has-mobile-agent-bar {
    scroll-padding-bottom: calc(72px + 20px + env(safe-area-inset-bottom, 0px));
  }

  /* Last content must be scrollable clear of the bar. */
  body:has(.mobile-agent-bar) main,
  body.has-mobile-agent-bar main,
  body:has(.mobile-agent-bar) #propertyRoot,
  body.has-mobile-agent-bar #propertyRoot {
    padding-bottom: calc(72px + 20px + env(safe-area-inset-bottom, 0px));
  }

  body:not(:has(main)):has(.mobile-agent-bar),
  body:not(:has(main)).has-mobile-agent-bar {
    padding-bottom: calc(72px + 20px + env(safe-area-inset-bottom, 0px));
  }

  /* Footer sits after main; pad it so the last line can scroll above the bar. */
  body:has(.mobile-agent-bar) .site-footer,
  body.has-mobile-agent-bar .site-footer,
  body:has(.mobile-agent-bar) > footer,
  body.has-mobile-agent-bar > footer {
    padding-bottom: calc(72px + 20px + env(safe-area-inset-bottom, 0px));
  }

  /* Hide back-to-top on mobile while the bar is present so it cannot
     cover content or sit on top of Enquire. */
  body:has(.mobile-agent-bar) .back-to-top,
  body.has-mobile-agent-bar .back-to-top {
    display: none !important;
  }
}


/* 12.11.2026 follow-up: keep phone numbers and e-mail addresses in
   logical LTR order inside RTL (and any) layout. Without this, a number
   such as +254 771 599 830 is painted as "830 599 771 254+".
   Applies on every viewport, including desktop. */
a[href^="tel:"],
a[href^="TEL:"],
a[href*="wa.me"],
a[href^="mailto:"],
a[href^="MAILTO:"],
input[type="tel"],
input[type="email"],
input[autocomplete="tel"],
input[autocomplete="email"],
bdi.astoria-ltr-isolate {
  direction: ltr;
  unicode-bidi: isolate;
}
