/* Astoria mobile CTA fix — 12.11.2026
   Local-only package. Desktop (>=1024px) is unchanged.

   Cleanest option: on property pages, while the sticky bottom bar is
   visible, hide both floating pills.

   Why not the compact 56px portrait: the reported fail is a full-width
   H1 sitting in the lower viewport (Oxford Homes uses a whole marketing
   sentence as H1). A 56px icon fixed above the bar would still cover
   the right (LTR) or left (RTL) edge of that title at the same scroll
   position. The success rule is "no floating element overlaps H1 or
   text", so the icon cannot stay.

   The bar already offers Call, WhatsApp and Enquire, so the green
   WhatsApp pill is a duplicate. Enquire on the bar scrolls to the
   listing-agent form; the magenta float would open the bot inquiry
   form instead. Bot inquiry remains available via the in-page bot
   cards, so hiding the float on mobile does not remove the action,
   it only removes the overlapping shortcut.

   Breakpoint is 1023px, matching the existing .mobile-agent-bar
   media query (not only 767px), so tablets that already show the
   bar are covered too.
*/

@media (max-width: 1023px) {
  /* Hide floating WhatsApp when the sticky bar already has WhatsApp. */
  body.page-detail:has(.mobile-agent-bar a[href*="wa.me"]) .wa-float {
    display: none !important;
  }

  /* Hide the inquiry float when the sticky bar already has Enquire. */
  body.page-detail:has(.mobile-agent-bar #mobileEnquireBtn) .chat-float {
    display: none !important;
  }

  /* Last content must be scrollable clear of the bar.
     Zero the older follow-up spacer so padding is not doubled. */
  body.page-detail:has(.mobile-agent-bar) #astoriaFloatingSpaceV1 {
    height: 0 !important;
  }

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

  /* Cookie banner on property mobile is pinned to the top (<=720px);
     keep the same bottom padding reserved for the bar. */
  body.page-detail:has(.mobile-agent-bar):has(.cookie-banner:not(.hidden)) main,
  body.page-detail:has(.mobile-agent-bar):has(#cookieBanner:not(.hidden)) main,
  body.page-detail:has(.mobile-agent-bar):has(#astoriaCookieBanner:not(.hidden)) main {
    padding-bottom: calc(72px + 20px + env(safe-area-inset-bottom, 0px));
  }

  /* 12.11.2026 follow-up: hide back-to-top on mobile while the bar is
     visible, so it cannot cover content or sit on Enquire. */
  body.page-detail: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;
}
