/* CIIC mobile stability fixes - loaded after all project styles. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  position: relative;
}

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

main,
.enhanced-ui main,
.inner-v4,
.inner-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Keep intentional horizontal scrollers contained inside their own width. */
.process-line,
.table-responsive,
.swiper,
.swiper-container {
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .main-navbar .container-xxl {
    width: 100%;
    max-width: 100%;
  }

  #mobileNavToggle {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    touch-action: manipulation;
  }

  #mobileNavToggle:focus-visible {
    outline: 3px solid rgba(13, 107, 67, .24);
    outline-offset: 2px;
  }

  .site-header .navbar-brand {
    min-width: 0;
    max-width: calc(100% - 58px);
  }

  .site-header .brand-copy {
    min-width: 0;
  }

  .site-header .brand-copy strong,
  .site-header .brand-copy small {
    overflow-wrap: anywhere;
  }

  .mobile-nav-v2 {
    width: min(90vw, 390px) !important;
    max-width: 390px !important;
    overflow-x: hidden;
  }

  /* Reliable touch scrolling inside the mobile drawer. */
  .mobile-nav-v2 {
    height: 100dvh;
    max-height: 100dvh;
    z-index: 1055;
  }

  .mobile-nav-v2 .offcanvas-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .mobile-nav-v2 a,
  .mobile-nav-v2 button {
    touch-action: manipulation;
  }

  .mobile-nav-v2 .offcanvas-header,
  .mobile-nav-v2 .offcanvas-body,
  .mobile-nav-v2 .mobile-menu-section,
  .mobile-nav-v2 .mobile-primary-menu,
  .mobile-nav-v2 .mobile-services-menu {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .mobile-nav-v2 .mobile-primary-menu > a,
  .mobile-nav-v2 .mobile-services-menu > a {
    min-width: 0;
  }

  .mobile-nav-v2 .mobile-services-menu > a {
    grid-template-columns: 43px minmax(0, 1fr) 20px;
  }

  .mobile-nav-v2 .mobile-services-menu > a > span:nth-child(2) {
    min-width: 0;
  }

  .mobile-nav-v2 .mobile-services-menu strong,
  .mobile-nav-v2 .mobile-services-menu small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* AOS transforms must not create page-level horizontal drag on phones. */
  [data-aos] {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .main-navbar .container-xxl {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .site-header .navbar-brand.brand-lockup {
    width: auto !important;
    max-width: calc(100% - 54px) !important;
    gap: 8px !important;
  }

  .site-header .brand-lockup img {
    flex: 0 0 auto;
  }

  .site-header .brand-copy strong {
    font-size: .65rem !important;
    line-height: 1.08 !important;
  }

  .site-header .brand-copy small {
    font-size: .55rem !important;
  }

  .mobile-nav-v2 {
    width: min(92vw, 360px) !important;
  }

  .mobile-nav-v2 .offcanvas-header {
    padding: 13px 14px !important;
  }

  .mobile-nav-v2 .offcanvas-body {
    padding: 14px 14px 22px !important;
  }
}

/* Fallback state used only if Bootstrap's Offcanvas API is unavailable. */
.mobile-nav.ciic-offcanvas-fallback-show {
  visibility: visible !important;
  transform: none !important;
  display: block !important;
}

.ciic-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, .5);
}

/* Complete positioning for the local-JS fallback drawer. */
.mobile-nav.ciic-offcanvas-fallback-show {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 1045 !important;
  height: 100dvh !important;
  overflow-y: auto !important;
  background: #fff !important;
}

/* =========================================================
   MOBILE MENU - INDEPENDENT DRAWER
   Does not depend on Bootstrap Offcanvas.
========================================================= */
.ciic-mobile-drawer {
  display: none;
}

@media (max-width: 991.98px) {
  html.ciic-mobile-menu-open,
  body.ciic-mobile-menu-open {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .ciic-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: block;
    visibility: hidden;
    pointer-events: none;
  }

  .ciic-mobile-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  .ciic-mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(92vw, 390px);
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translate3d(100%, 0, 0);
    transition: transform .28s cubic-bezier(.22,.61,.36,1);
    box-shadow: -18px 0 52px rgba(2, 27, 17, .22);
    overflow: hidden;
    z-index: 2;
    will-change: transform;
  }

  .ciic-mobile-drawer.is-open .ciic-mobile-drawer-panel {
    transform: translate3d(0, 0, 0);
  }

  .ciic-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(5, 20, 14, .58);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 1;
    cursor: default;
  }

  .ciic-mobile-drawer.is-open .ciic-mobile-drawer-backdrop {
    opacity: 1;
  }

  .ciic-mobile-drawer-header {
    flex: 0 0 auto;
    min-height: 72px;
    padding: 12px 14px;
    background: #075b3a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }

  .ciic-mobile-drawer-header .brand-lockup {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }

  .ciic-mobile-drawer-header .brand-lockup img {
    width: 54px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
  }

  .ciic-mobile-drawer-header .brand-copy {
    display: grid;
    line-height: 1.1;
  }

  .ciic-mobile-drawer-header .brand-copy strong {
    color: #fff !important;
    font-size: .9rem !important;
  }

  .ciic-mobile-drawer-header .brand-copy small {
    color: rgba(255,255,255,.72) !important;
    font-size: .62rem !important;
  }

  .ciic-mobile-drawer-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.28rem;
    cursor: pointer;
    touch-action: manipulation;
  }

  .ciic-mobile-drawer-close:focus-visible,
  #mobileNavToggle:focus-visible {
    outline: 3px solid rgba(255,255,255,.7);
    outline-offset: 2px;
  }

  .ciic-mobile-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 16px 14px calc(26px + env(safe-area-inset-bottom));
    background: #f8fbf9;
  }

  .ciic-mobile-drawer .mobile-menu-section + .mobile-menu-section {
    margin-top: 18px;
  }

  .ciic-mobile-drawer .mobile-menu-label {
    display: block;
    margin: 0 0 9px;
    padding: 0 2px;
    color: #6c746f;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  .ciic-mobile-drawer .mobile-primary-menu,
  .ciic-mobile-drawer .mobile-services-menu {
    display: grid;
    gap: 8px;
    width: 100%;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a,
  .ciic-mobile-drawer .mobile-services-menu > a {
    width: 100%;
    min-width: 0;
    color: #092d20;
    text-decoration: none;
    background: #fff;
    border: 1px solid #d9e5df;
    border-radius: 14px;
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
    touch-action: manipulation;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a:active,
  .ciic-mobile-drawer .mobile-services-menu > a:active {
    transform: scale(.985);
  }

  .ciic-mobile-drawer .mobile-primary-menu > a.active,
  .ciic-mobile-drawer .mobile-services-menu > a.active {
    background: #eef8f3;
    border-color: #b9d8c9;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a {
    min-height: 48px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: .86rem;
    font-weight: 700;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a > span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a > span i {
    color: #0b7a4e;
  }

  .ciic-mobile-drawer .mobile-primary-menu > a > i,
  .ciic-mobile-drawer .mobile-services-menu > a > i {
    color: #16865a;
    font-size: .8rem;
    flex: 0 0 auto;
  }

  .ciic-mobile-drawer .mobile-services-menu > a {
    min-height: 66px;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
  }

  .ciic-mobile-drawer .mobile-service-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff8f3;
    color: #08754a;
    font-size: 1rem;
  }

  .ciic-mobile-drawer .mobile-services-menu > a > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .ciic-mobile-drawer .mobile-services-menu strong,
  .ciic-mobile-drawer .mobile-services-menu small {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ciic-mobile-drawer .mobile-services-menu strong {
    color: #082b1e;
    font-size: .84rem;
    line-height: 1.2;
    font-weight: 800;
  }

  .ciic-mobile-drawer .mobile-services-menu small {
    color: #7b837e;
    font-size: .66rem;
    line-height: 1.25;
  }

  .ciic-mobile-drawer .mobile-consultation-btn {
    margin-top: 18px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  #mobileNavToggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 50;
  }
}

@media (min-width: 992px) {
  .ciic-mobile-drawer {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  /* Neutralize legacy .mobile-nav-v2 / Bootstrap drawer sizing on the new wrapper. */
  .ciic-mobile-drawer.mobile-nav-v2 {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
    transform: none !important;
  }
}
