/* p5-live-fixes-v1 — live-site review fixes (cookie banner, mobile sticky bar,
   contact service-area cards, interior hero height, reviews skeleton, name fields).
   Linked last in index.html by scripts/patches/public/patch-p5-live-review-fixes.mjs. */

/* ---- Cookie banner: compact card docked bottom-left on desktop ---- */
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) {
  inset: auto auto 0 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: 0 !important;
  width: min(100%, 420px) !important;
  padding: 0.75rem !important;
}
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-panel {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.6rem !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.85rem 1rem !important;
  border-radius: 14px !important;
}
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-title {
  font-size: 0.92rem !important;
  margin: 0 0 0.15rem !important;
}
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-copy {
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.4rem !important;
}
html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-actions .btn {
  flex: 1 1 auto !important;
  min-height: 2.25rem !important;
  padding: 0.45rem 0.7rem !important;
  font-size: 0.78rem !important;
}

/* ---- Mobile (sticky call/request bar visible below 1024px) ---- */
@media (max-width: 1023px) {
  /* Keep page + form content clear of the fixed sticky bar */
  html body:not(:has(.admin)):has(.sticky-call) {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body.nav-open:not(:has(.admin)):has(.sticky-call) {
    padding-bottom: 0 !important;
  }
  html body:not(:has(.admin)) .contact-form,
  html body:not(:has(.admin)) #service-request {
    scroll-margin-bottom: 96px;
  }
  /* Cookie banner: full-width compact strip that sits ABOVE the sticky bar */
  html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) {
    width: 100% !important;
    padding: 0.5rem !important;
  }
  html body:not(:has(.admin)):has(.sticky-call) .cookie-consent:not(.cookie-consent--prefs) {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-panel {
    padding: 0.65rem 0.8rem !important;
    gap: 0.45rem !important;
  }
  html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-title {
    display: none !important;
  }
  html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-copy {
    font-size: 0.76rem !important;
  }
  html body:not(:has(.admin)) .cookie-consent:not(.cookie-consent--prefs) .cookie-consent-actions .btn {
    min-height: 2.1rem !important;
    padding: 0.4rem 0.55rem !important;
  }
}

/* ---- Contact: service-area cards — one column on small phones, no mid-word breaks ---- */
html body:not(:has(.admin)) .contact-service-areas-grid .btn {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}
@media (max-width: 480px) {
  html body:not(:has(.admin)) .contact-hub-card .contact-service-areas-grid,
  html body:not(:has(.admin)) .contact-service-areas-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Shorter interior heroes (home .hero untouched) so intro/CTA is above the fold ---- */
html body:not(:has(.admin)) .page-hero,
html body:not(:has(.admin)) .service-area-hero {
  min-height: auto !important;
  padding-top: clamp(1.5rem, 4vw, 2.75rem) !important;
  padding-bottom: clamp(1.5rem, 4vw, 2.75rem) !important;
}
html body:not(:has(.admin)) .page-hero .container,
html body:not(:has(.admin)) .page-hero-legal .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
html body:not(:has(.admin)) .service-hero {
  padding-top: clamp(1.25rem, 3.5vw, 2.25rem) !important;
  padding-bottom: clamp(1.25rem, 3.5vw, 2rem) !important;
}
@media (max-width: 640px) {
  html body:not(:has(.admin)) .page-hero h1,
  html body:not(:has(.admin)) .service-hero h1,
  html body:not(:has(.admin)) .service-area-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2.05rem) !important;
    line-height: 1.15 !important;
  }
  html body:not(:has(.admin)) .page-hero p,
  html body:not(:has(.admin)) .service-hero-lead {
    font-size: 0.95rem !important;
  }
}

/* ---- Request form: first + last name side by side (middle name removed) ---- */
.person-name-fields .person-name-field:first-child {
  grid-column: auto !important;
}
@media (max-width: 480px) {
  .person-name-fields { grid-template-columns: 1fr !important; }
}

/* ---- Reviews summary skeleton (replaces the 0.0★ count-up flash) ---- */
.stats-section--skeleton .aap-skel-line {
  display: inline-block;
  width: 3.75rem;
  height: 1.6rem;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
  background-size: 200% 100%;
  animation: aap-p5-skel 1.2s linear infinite;
  vertical-align: middle;
}
@keyframes aap-p5-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .stats-section--skeleton .aap-skel-line { animation: none; }
}
