/*
  Mobile Sticky CTA Bar (Service-Area Pages)
  - Shows on /service-areas/* only (scoped via body class and conditional markup).
  - Provides quick access to Call + Book (scrolls to the lead wizard section).
*/

.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(4,36,82,0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 2px solid rgba(212,175,55,0.4);
  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: #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);
}

.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%);
  color: #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: 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;
}

.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;
  }
}

@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;
  }
}
