/**
 * CCC Pools — mobile overflow + alignment patch
 * Prevents horizontal scroll in Messenger / mobile browsers without changing desktop layout.
 */

/* ——— Global overflow protection ——— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.ccc-northstar-layout,
body.ccc-has-mobile-bar {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.ccc-northstar-layout #page,
body.ccc-northstar-layout #page.site,
body.ccc-northstar-layout .site-main,
body.ccc-northstar-layout .mmp-story-page,
body.ccc-northstar-layout .mmp-story,
body.ccc-northstar-layout #wrapper-navbar,
body.ccc-northstar-layout #wrapper-footer {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Debug-safe flex/grid shrink */
body.ccc-northstar-layout .site-main *,
body.ccc-northstar-layout .mmp-story-page * {
  min-width: 0;
}

img,
video,
svg,
iframe {
  max-width: 100%;
  height: auto;
}

/* ——— Mobile (<768px) ——— */
@media (max-width: 767.98px) {
  :root {
    --ccc-shell-pad: clamp(16px, 5vw, 24px);
  }

  /* Neutralize Bootstrap .row negative gutters inside CCC layout */
  body.ccc-northstar-layout .site-main .row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  body.ccc-northstar-layout .site-main .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }

  /* Shell + containers */
  .ccc-site-shell,
  body.ccc-northstar-layout .container,
  .ccc-request-cta .container {
    width: 100%;
    max-width: 100%;
    padding-inline: clamp(16px, 5vw, 24px);
    margin-inline: auto;
  }

  /* ——— Header / logo ——— */
  .ccc-site-header__bar {
    min-height: 4rem;
  }

  .ccc-site-header__inner {
    gap: 0.75rem;
  }

  .ccc-brand-logo--header {
    max-width: calc(100% - 3.5rem);
  }

  .ccc-brand-logo--header .ccc-brand-logo__waves {
    width: 2.25rem;
  }

  .ccc-brand-logo--header .ccc-brand-logo__name {
    font-size: clamp(0.68rem, 3.1vw, 0.82rem);
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
  }

  .ccc-brand-logo--header .ccc-brand-logo__tagline {
    font-size: clamp(0.52rem, 2.4vw, 0.62rem);
    overflow-wrap: anywhere;
  }

  /* ——— Hero / video ——— */
  .ccc-hero--video {
    min-height: auto;
    overflow: hidden;
  }

  .ccc-hero__content {
    width: 100%;
    max-width: 100%;
    padding-inline: clamp(16px, 5vw, 24px);
  }

  .ccc-hero__panel {
    max-width: 100%;
  }

  .ccc-hero__title,
  .mmp-story-hero__title {
    font-size: clamp(1.65rem, 7vw, 2.35rem);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .ccc-hero__subhead {
    font-size: clamp(0.95rem, 4vw, 1.05rem);
    overflow-wrap: anywhere;
  }

  .ccc-hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .ccc-hero__actions .ccc-btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .ccc-hero__trust-list {
    gap: 0.5rem;
  }

  .ccc-hero__trust-list li {
    font-size: 0.75rem;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* ——— Trust bar ——— */
  .ccc-trust-bar__list {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .ccc-trust-bar__title,
  .ccc-trust-bar__subtitle {
    overflow-wrap: anywhere;
  }

  /* ——— Pricing cards (Core Pool Care / Priority Care) ——— */
  .ccc-pricing__grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    width: 100%;
    margin-inline: auto;
  }

  .ccc-pricing-card {
    width: 100%;
    max-width: 100%;
  }

  .ccc-pricing-card__name,
  .ccc-pricing-card__features li {
    overflow-wrap: anywhere;
  }

  .ccc-pricing-card__cta,
  .ccc-pricing-card__footer .ccc-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* ——— Service areas hub ——— */
  .ccc-section__title,
  .ccc-service-areas .ccc-section__title {
    font-size: clamp(1.45rem, 6vw, 1.85rem);
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .ccc-section__lead {
    overflow-wrap: anywhere;
  }

  .ccc-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .ccc-hub-card__label {
    font-size: 0.75rem;
    overflow-wrap: anywhere;
  }

  /* ——— Value band / stats ——— */
  .ccc-value-band {
    overflow: hidden;
    padding-inline: clamp(16px, 5vw, 24px);
  }

  .ccc-value-band__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ccc-value-band__title {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
    overflow-wrap: anywhere;
  }

  /* ——— Service cards grid ——— */
  .ccc-services-section .ccc-services-grid.row {
    width: 100%;
    max-width: 100%;
  }

  .ccc-service-card {
    width: 100%;
    max-width: 100%;
  }

  /* ——— Request-service CTA ——— */
  .ccc-request-cta {
    overflow: hidden;
  }

  .ccc-request-cta__inner {
    width: 100%;
    max-width: 100%;
  }

  .ccc-request-cta__panel {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    padding: 1.35rem;
    border-radius: 22px;
  }

  .ccc-request-cta__title {
    font-size: clamp(1.55rem, 6.5vw, 2rem);
    overflow-wrap: anywhere;
  }

  .ccc-request-cta__text,
  .ccc-request-cta__note {
    overflow-wrap: anywhere;
  }

  .ccc-request-cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ccc-request-cta__actions .ccc-btn {
    width: 100%;
    max-width: 100%;
  }

  .ccc-request-cta__video {
    transform: none;
  }

  /* ——— Sticky mobile bar ——— */
  .ccc-mobile-bar {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    padding: 0.65rem clamp(12px, 4vw, 16px);
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    gap: 0.65rem;
    box-sizing: border-box;
  }

  .ccc-mobile-bar .ccc-btn {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(50% - 0.35rem);
    min-height: 44px;
    padding-inline: 0.5rem;
    font-size: clamp(0.78rem, 3.4vw, 0.875rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
  }

  body.ccc-has-mobile-bar {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  /* ——— Buttons global ——— */
  .ccc-btn {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ——— Grids stack ——— */
  .ccc-card-grid,
  .ccc-challenge__grid,
  .ccc-process__grid,
  .ccc-education__grid,
  .ccc-regions-grid {
    grid-template-columns: 1fr;
  }

  .ccc-blog-preview__row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ccc-hero__video,
  .ccc-request-cta__video {
    transform: none;
  }
}
