/*
  Mobile Sticky CTA Bar — sitewide on mobile (≤1024px).
  Phase 3 PR 5: this is now the ONLY sticky mobile CTA. The duplicate
  hales_sticky_mobile_cta() wp_footer hook in frontend.php was removed
  in this PR (it rendered a second bar that conflicted with this one and
  used an off-brand Tailwind orange #f97316).
*/

.hales-sticky-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2500;
  display: none;
  gap: 10px;

  /* Allow the trust pill to take a full row above the CTA buttons. */
  flex-wrap: wrap;

  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(1, 22, 53, 0.97) 0%, rgba(11, 27, 63, 0.98) 100%);
  background: linear-gradient(180deg, oklch(0.18 0.06 264 / 0.97) 0%, oklch(0.24 0.06 264 / 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 2px solid var(--gold, rgba(212, 175, 55, 0.6));
  box-shadow:
    0 -20px 40px rgba(1, 22, 53, 0.25),
    0 -8px 20px rgba(1, 22, 53, 0.15);
}

.hales-sticky-cta-bar__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 14px 14px;
  border-radius: 8px;

  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.25s ease;
}

.hales-sticky-cta-bar__btn i {
  font-size: 18px;
}

.hales-sticky-cta-bar__btn--call {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark, #fff);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hales-sticky-cta-bar__btn--call:hover,
.hales-sticky-cta-bar__btn--call:active {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* PR 5: --text variant retained for backward compat in case any template
   still references it; the canonical sticky CTA in footer.php no longer
   renders the Text button (Phase 2 §7.10 — drop Text until SMS staffing
   at 2 AM is confirmed). */
.hales-sticky-cta-bar__btn--text {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hales-sticky-cta-bar__btn--text:hover,
.hales-sticky-cta-bar__btn--text:active {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.hales-sticky-cta-bar__btn--schedule {
  background: linear-gradient(135deg, #d4af37 0%, #f6e27f 50%, #d4af37 100%);
  background: var(--gold, linear-gradient(135deg, #d4af37 0%, #f6e27f 50%, #d4af37 100%));
  color: var(--text-on-gold, #011635);
  border: none;
  box-shadow:
    0 8px 20px -4px rgba(212, 175, 55, 0.4),
    0 4px 10px -2px rgba(212, 175, 55, 0.25);
}

.hales-sticky-cta-bar__btn--schedule:hover,
.hales-sticky-cta-bar__btn--schedule:active {
  background: var(--gold-deep, linear-gradient(135deg, #c5a030 0%, #e8d470 50%, #c5a030 100%));
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px -4px rgba(212, 175, 55, 0.5),
    0 6px 14px -2px rgba(212, 175, 55, 0.35);
}

.hales-sticky-cta-bar__trust {
  width: 100%;
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,0.2);
  background: rgba(212,175,55,0.08);
  font-weight: 800;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
}

.header-trust-pill {
  width: auto;
  padding: 6px 10px;
  gap: 6px;
}

.hales-sticky-cta-bar__trust-stars {
  color: #d4af37;
  letter-spacing: 0.08em;
}

.hales-sticky-cta-bar__trust-rating {
  font-size: 14px;
}

.hales-sticky-cta-bar__trust-count {
  opacity: 0.9;
}

.hales-sticky-cta-bar__trust-link {
  color: #d4af37;
  text-decoration: none;
  white-space: nowrap;
  /* HAC-025: enforce 44px tap-target height on the sticky CTA trust link.
     Was rendering at ~46×20 px on mobile — visible "Reviews" link inside
     the always-on sticky bar, easy to mis-tap into the adjacent Call/
     Book buttons without sufficient height. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
}

.hales-sticky-cta-bar__trust-link:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  body.hales-has-sticky-cta {
    /* Reserve room so page content isn't hidden behind the fixed sticky bar. */
    padding-bottom: calc(130px + env(safe-area-inset-bottom));
  }

  body.hales-has-sticky-cta #hales-service-area-lead {
    /* Ensure anchor jumps don't land under the header/nav. */
    scroll-margin-top: 160px;
  }

  body.menu-is-active .hales-sticky-cta-bar {
    display: none !important;
  }

  .hales-sticky-cta-bar {
    display: flex;
  }

  /*
    Simplify the mobile header on service-area pages:
    - CTAs move to the sticky CTA bar
    - keep only the hamburger/menu toggle in the top-right
  */
  body.hales-has-sticky-cta .page-header .header-right .header-phone.mobile-phone,
  body.hales-has-sticky-cta .page-header .header-right .js-search-toggle {
    display: none;
  }
}

/*
  PR 5: HAC-012 narrow-phone hide rule was reversed — the duplicate
  #hales-sticky-mobile-cta wp_footer hook in frontend.php is gone, so
  this single canonical bar should now render on ALL mobile widths.
  The existing 769-1024px display:flex rule above is sufficient; no
  extra hiding rule is needed here.

  Body bottom padding stays at calc(130px + safe-area) for the entire
  ≤1024px range to reserve room for the trust-pill row + button row.
*/
@media (max-width: 768px) {
  /*
    Compact-phone trust pill row may wrap; let the trust-pill row size
    naturally and the buttons take their own row underneath.
  */
  .hales-sticky-cta-bar {
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
  }
}

@media (max-width: 360px) {
  /*
    Very small screens (e.g., iPhone SE): keep the CTA row to a single line.
    If Call/Text/Schedule wrap into multiple rows, the sticky bar becomes tall
    enough to overlap the footer even with reserved bottom padding.
  */
  .hales-sticky-cta-bar__btn--call,
  .hales-sticky-cta-bar__btn--text {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 14px 0;
    gap: 0;
    font-size: 0;
  }

  .hales-sticky-cta-bar__btn--schedule {
    min-width: 0;
  }
}
