/* ==========================================================================
   SPRINT-01: Mobile Sticky Conversion Bar
   Call + WhatsApp + Quote Request - mobile/tablet only (< 992px, matches the
   theme's existing Bootstrap lg breakpoint used for nav switching).
   Reversible: delete this file + its enqueue call + the template part
   include in footer.php to fully remove.
   ========================================================================== */

.alrahma-mobile-bar {
  direction: rtl;
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050; /* above footer-contact-btns (z-index 99) and Bootstrap offcanvas (1045) */
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  /* Respect the home-indicator / gesture-bar area on notched phones. */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Hidden on desktop - the existing floating Call/WhatsApp buttons
   (template-parts/footer/footer-contact-btns.php) remain visible there
   instead, so the two mechanisms never show at the same time. */
@media (min-width: 992px) {
  .alrahma-mobile-bar {
    display: none !important;
  }
}

/* Hide the pre-existing floating Call/WhatsApp buttons
   (template-parts/footer/footer-contact-btns.php, styled in css/custom.css)
   on the same mobile/tablet range this bar covers, so the two mechanisms
   never show at the same time. This duplicates a rule also added to
   css/custom.css directly (kept here too since this stylesheet is new this
   Sprint and guaranteed not to be served from a stale cached copy). */
@media (max-width: 991.98px) {
  .footer-contact-btns {
    display: none !important;
  }
}

.alrahma-mobile-bar__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px; /* comfortable touch target, exceeds the 44px minimum */
  padding: 6px 4px;
  color: #02435b;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Fustat', sans-serif;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.alrahma-mobile-bar__item:first-child {
  border-left: none;
}

.alrahma-mobile-bar__item:hover,
.alrahma-mobile-bar__item:active {
  background: rgba(2, 67, 91, 0.06);
  color: #02435b;
  text-decoration: none;
}

/* Visible, high-contrast focus state for keyboard navigation. */
.alrahma-mobile-bar__item:focus-visible {
  outline: 3px solid #02435b;
  outline-offset: -3px;
  background: rgba(2, 67, 91, 0.08);
}

.alrahma-mobile-bar__item i {
  font-size: 1.15rem;
  line-height: 1;
}

.alrahma-mobile-bar__item--whatsapp {
  color: #128c37;
}

.alrahma-mobile-bar__item--whatsapp:hover,
.alrahma-mobile-bar__item--whatsapp:focus-visible {
  background: rgba(37, 211, 102, 0.1);
  color: #128c37;
}

.alrahma-mobile-bar__item--quote {
  background: #ff2714;
  color: #ffffff;
}

.alrahma-mobile-bar__item--quote:hover,
.alrahma-mobile-bar__item--quote:focus-visible {
  background: #e0200f;
  color: #ffffff;
}

.alrahma-mobile-bar__item--quote:focus-visible {
  outline-color: #ffffff;
}

/* Push page content up so the bar never overlaps the last section, footer
   CTA buttons, or (when present) a form's submit/consent controls. Scoped to
   the same <992px range the bar itself is visible in, so desktop layout is
   never affected. */
@media (max-width: 991.98px) {
  body:has(.alrahma-mobile-bar) {
    padding-bottom: 64px;
  }
}

/* Fallback for browsers without :has() support (verified in this Sprint's
   test matrix - see sprint01_responsive_smoke_tests.csv): apply the same
   padding unconditionally on mobile widths, since the bar renders on every
   page that has a phone or WhatsApp number configured (effectively all of
   them via the shared alrahma_info() default). */
@media (max-width: 991.98px) {
  body {
    padding-bottom: 64px;
  }
}

/* No motion/animation on the bar itself, and it never auto-opens or
   auto-scrolls anything - purely a static, always-present tap target. */
@media (prefers-reduced-motion: reduce) {
  .alrahma-mobile-bar__item {
    transition: none;
  }
}
