/* Independent mobile nav — Elementor hamburger is off-screen / untappable */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.nh-mobile-nav {
  display: none;
}

@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

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

  .elementor-heading-title,
  .elementor-cta__title,
  .elementor-cta__description {
    overflow-wrap: anywhere;
  }

  /* Keep content from overflowing without blowing up the header */
  .elementor-element.elementor-element-e7dc3ef,
  .elementor-element.elementor-element-69a847e,
  .elementor-element.elementor-element-ed79dc7 {
    width: 100% !important;
    max-width: 100% !important;
    --width: 100% !important;
    --container-widget-width: 100% !important;
  }

  .elementor-button,
  .elementor-cta__button {
    min-height: 48px;
    max-width: 100%;
  }

  .elementor-field-group.elementor-col-50,
  .elementor-field-group.elementor-col-33,
  .elementor-field-group.elementor-col-25 {
    width: 100% !important;
  }

  .elementor-field-textual,
  .elementor-field-group input,
  .elementor-field-group select,
  .elementor-field-group textarea {
    font-size: 16px !important;
    min-height: 48px;
    width: 100% !important;
  }

  /* Original Elementor burger is unreliable — hide it */
  .elementor-menu-toggle,
  .elementor-nav-menu--dropdown {
    display: none !important;
    pointer-events: none !important;
  }

  .nh-mobile-nav {
    display: block;
  }

  .nh-fab-menu {
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 0px));
    right: 10px;
    z-index: 2147483000;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: #1c244b;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(28, 36, 75, 0.28);
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
  }

  .nh-fab-menu span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nh-mobile-nav.is-open .nh-fab-menu span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nh-mobile-nav.is-open .nh-fab-menu span:nth-child(2) {
    opacity: 0;
  }

  .nh-mobile-nav.is-open .nh-fab-menu span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nh-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2147482990;
    width: min(320px, 88vw);
    padding: 72px 0 24px;
    background: #f3f5f8;
    box-shadow: -12px 0 40px rgba(28, 36, 75, 0.2);
    transform: translateX(110%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
  }

  .nh-mobile-nav.is-open .nh-nav-panel {
    transform: translateX(0);
  }

  .nh-nav-panel a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 1.25rem;
    color: #1c244b;
    text-decoration: none;
    font-size: 1.125rem;
    font-family: Montserrat, sans-serif;
    border-bottom: 1px solid rgba(28, 36, 75, 0.08);
  }

  .nh-nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147482980;
    background: rgba(10, 16, 28, 0.45);
  }

  .nh-mobile-nav.is-open .nh-nav-scrim {
    display: block;
  }

  body.nh-nav-open {
    overflow: hidden;
  }

  /* Contact bar: only the icons capture taps, never a 90vw sheet */
  .e-contact-buttons {
    width: auto !important;
    height: auto !important;
    inset: auto 12px 12px auto !important;
    top: auto !important;
    left: auto !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    pointer-events: none !important;
    z-index: 90 !important;
  }

  .e-contact-buttons a {
    pointer-events: auto !important;
  }

  .site-main,
  .page-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .nh-mobile-nav {
    display: none !important;
  }
}
