/* Mobile Navigation - Hidden by default */
.nav_mobile-menu,
.nav_mobile-overlay {
  display: none;
}

/* Center footer logo and its glow on mobile */
@media screen and (max-width: 767px) {

  /* Re-enable sticky scroll for Services cards on mobile */
  #services {
    overflow: visible !important;
  }

  #services .features-section {
    overflow: visible !important;
    transform: none !important;
  }

  #services .container {
    overflow: visible !important;
    transform: none !important;
  }

  #services .content-container {
    overflow: visible !important;
    transform: none !important;
  }

  #services .features-grid {
    overflow: visible !important;
    transform: none !important;
  }

  #services .light-purple-container {
    position: -webkit-sticky !important;
    /* iOS Safari */
    position: sticky !important;
    top: 96px !important;
    /* tuned for mobile navbar height */
    z-index: 2 !important;
    will-change: position, top;
    margin-bottom: 100px !important;
    /* ensure overlap spacing feels like desktop */
  }

  /* Slightly taller image wrapper on mobile to give each card more scroll height */
  #services .features-grid-image-wrapper {
    height: 260px !important;
  }

  /* Ensure the entire footer logo block is centered */
  .footer .logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer .nav_logo-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    overflow: visible !important;
    /* ensure glow/logo not clipped */
    width: 140px;
    /* explicit size so image has a box */
    min-width: 140px;
  }

  .footer .nav_logo-icon img {
    /* Remove offsets so glow is centered around the logo */
    margin: 0 !important;
    transform: translateY(10px) scale(1.02) !important;
    /* move slightly down while keeping original scale */
    /* Symmetric glow for centered appearance */
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 18px rgba(255, 255, 255, 0.6)) !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 3;
    width: auto !important;
    /* keep original logo size */
    height: auto !important;
    margin-top: 0 !important;
    /* rely on transform for consistent shift */
  }

  /* Footer social icons: center align with limited spacing on mobile */
  .footer .footer_icon-group {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    /* limited space between icons */
    margin: 10px auto 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .footer .footer_icon-group li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .footer .footer_icon-link {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Mobile Navigation Overrides */
@media screen and (max-width: 991px) {

  /* Hide the desktop mega dropdowns in mobile */
  .mega-nav_dropdown-list {
    display: none !important;
  }

  /* Hide the default Webflow mobile menu */
  .w-nav-menu[data-nav-menu-open] {
    display: none !important;
  }

  /* Mobile menu overlay */
  .nav_mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .nav_mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile menu container */
  .nav_mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    overflow-y: auto;
    padding: 60px 20px 20px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    text-align: left;
    /* Ensure text is left-aligned */
  }

  /* Ensure all text and content in mobile menu is left-aligned */
  .nav_mobile-menu * {
    text-align: left !important;
  }

  /* Ensure menu items are properly aligned */
  .nav_mobile-menu .nav_mobile-menu-item,
  .nav_mobile-menu .nav_mobile-menu-item a {
    text-align: left;
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 0;
  }

  /* Ensure dropdown arrows are properly positioned */
  .nav_mobile-menu .dropdown-arrow {
    margin-left: auto;
  }

  .nav_mobile-menu.active {
    right: 0;
  }

  /* Mobile close button */
  .mobile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    /* Positioned 60px from the right edge */
    font-size: 20px;
    /* Slightly smaller icon */
    line-height: 1;
    color: white;
    /* White icon for better contrast */
    cursor: pointer;
    z-index: 1001;
    width: 36px;
    /* Slightly smaller button */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d3fb, #06057d);
    /* Exact match with Talk to Us button */
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .mobile-close-btn:hover {
    background: linear-gradient(135deg, #00b8e6, #05046a);
    /* Slightly darker on hover */
    transform: scale(1.05);
  }

  /* Mobile nav header styles */
  .mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-nav-header i {
    transition: transform 0.3s ease;
    margin-left: 10px;
    color: #666;
  }

  .mobile-nav-header.active i {
    transform: rotate(180deg);
  }

  /* Submenu styles */
  .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #f9f9f9;
  }

  .mobile-submenu.active {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
  }

  .mobile-submenu-item {
    display: block;
    padding: 12px 30px;
    color: #555;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #eee;
  }

  .mobile-submenu-item:hover {
    background: #f0f0f0;
  }

  /* Talk to Us button */
  .mobile-menu-cta {
    display: flex;
    justify-content: center;
    padding: 20px;
    margin-top: 15px;
    border-top: 1px solid #eee;
  }

  .mobile-menu-cta .button-3 {
    width: 100%;
    max-width: 200px;
    text-align: center;
    justify-content: center;
  }

  .mobile-nav-item {
    border-bottom: 1px solid #eee;
    width: 100%;
  }

  .mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    font-size: 16px;
  }

  .mobile-nav-header i {
    transition: transform 0.3s ease;
  }

  .mobile-nav-header.active i {
    transform: rotate(180deg);
  }

  .mobile-submenu {
    display: none;
    padding: 0 0 10px 15px;
    width: 100%;
  }

  .mobile-submenu.active {
    display: block;
    animation: fadeIn 0.3s ease;
  }

  .mobile-submenu-item {
    display: block;
    padding: 12px 0 12px 15px;
    color: #555;
    font-size: 14px;
    border-left: 2px solid #0288d1;
    margin: 5px 0;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
  }

  .mobile-submenu-item:hover {
    color: #0288d1;
    transform: translateX(5px);
  }

  .mobile-submenu-category {
    font-weight: 600;
    color: #0288d1;
    margin: 15px 0 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-submenu-category:first-child {
    margin-top: 0;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Hide desktop navigation in mobile */
  .nav_center {
    display: none;
  }

  /* Show mobile menu button */
  .nav_mobile-menu-button {
    display: flex !important;
  }

  /* Slightly shift navbar logo to the left on mobile only */
  .nav_left img.logo,
  .nav_left img.pkg-logo {
    transform: translate(-55px, 6px) !important;
    /* Move even more left, keep slight down on mobile */
  }
}