/*
 * BMG Mobile CTA Fix 1.0.0
 * Scoped to the existing contact bar. No new buttons, URL changes or global resets.
 * Both selectors support the usual BMG body class and legacy markup without it.
 * Layout-only !important rules override the legacy two-column CSS regardless
 * of stylesheet concatenation order; hidden/menu/form states stay authoritative.
 */
html body nav.bmg-mobile-contact,
html body.bmg-pccc-site nav.bmg-mobile-contact {
  display: none !important;
}

@media screen and (max-width: 767px) {
  html body nav.bmg-mobile-contact,
  html body.bmg-pccc-site nav.bmg-mobile-contact {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 980 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    grid-auto-flow: row !important;
    gap: 6px !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px !important;
    padding-top: 8px !important;
    padding-right: max(8px, env(safe-area-inset-right, 0px)) !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
    padding-left: max(8px, env(safe-area-inset-left, 0px)) !important;
  }

  /* A legacy clearfix must never consume a grid cell. */
  html body nav.bmg-mobile-contact::before,
  html body nav.bmg-mobile-contact::after,
  html body.bmg-pccc-site nav.bmg-mobile-contact::before,
  html body.bmg-pccc-site nav.bmg-mobile-contact::after {
    content: none !important;
    display: none !important;
  }

  html body nav.bmg-mobile-contact > a,
  html body.bmg-pccc-site nav.bmg-mobile-contact > a {
    grid-column: auto !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    float: none !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    text-align: center !important;
    text-decoration: none !important;
  }

  html body nav.bmg-mobile-contact > a > span,
  html body.bmg-pccc-site nav.bmg-mobile-contact > a > span {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  html body nav.bmg-mobile-contact > a > svg,
  html body.bmg-pccc-site nav.bmg-mobile-contact > a > svg {
    display: block !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    max-width: none !important;
    margin: 0 !important;
  }
}

@media screen and (max-width: 359px) {
  html body nav.bmg-mobile-contact > a,
  html body.bmg-pccc-site nav.bmg-mobile-contact > a {
    font-size: 12px !important;
  }
}

/* Respect all existing interaction states, including the editorial focus hook. */
html body.bmg-menu-open nav.bmg-mobile-contact,
html body.bmg-photo-open nav.bmg-mobile-contact,
html body.bmg-form-editing nav.bmg-mobile-contact,
html body.bmg-input-focused nav.bmg-mobile-contact,
html body.bmg-pccc-site.bmg-menu-open nav.bmg-mobile-contact,
html body.bmg-pccc-site.bmg-photo-open nav.bmg-mobile-contact,
html body.bmg-pccc-site.bmg-form-editing nav.bmg-mobile-contact,
html body.bmg-pccc-site.bmg-input-focused nav.bmg-mobile-contact,
html body nav.bmg-mobile-contact[hidden],
html body nav.bmg-mobile-contact[aria-hidden="true"],
html body.bmg-pccc-site nav.bmg-mobile-contact[hidden],
html body.bmg-pccc-site nav.bmg-mobile-contact[aria-hidden="true"] {
  display: none !important;
}

@media print {
  html body nav.bmg-mobile-contact,
  html body.bmg-pccc-site nav.bmg-mobile-contact {
    display: none !important;
  }
}
