/* Mobile Menu Fixes and Enhancements */

/* Ensure proper mobile menu button positioning */
@media (max-width: 576px) {
  .navbar-toggler {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 24px;
    color: #09335b;
    z-index: 1000;
  }

  .navbar-toggler:focus {
    box-shadow: none;
    outline: none;
  }

  .navbar-toggler i {
    font-size: 28px;
    color: #09335b;
  }

  /* Logo positioning on mobile */
  .logo {
    margin: 0 auto;
    text-align: center;
  }

  .logo img {
    width: 140px;
    height: auto;
  }

  /* Offcanvas improvements */
  .offcanvas {
    width: 280px !important;
  }

  .offcanvas-header {
    background-color: #09335b;
    color: white;
    border-bottom: 1px solid #e58030;
  }

  .offcanvas-title {
    color: white !important;
    font-weight: 600;
    font-size: 18px;
  }

  .btn-close {
    filter: invert(1);
    opacity: 0.8;
  }

  .btn-close:hover {
    opacity: 1;
  }

  /* Mobile menu items styling */
  .offcanvas-body {
    padding: 20px;
  }

  .offcanvas-body .nav-link {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
  }

  .offcanvas-body .nav-link:hover {
    background-color: #e58030;
    color: white !important;
    transform: translateX(5px);
  }

  .offcanvas-body .nav-link.active {
    background-color: #09335b;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(9, 51, 91, 0.3);
  }

  .offcanvas-body .nav-link i {
    width: 20px;
    text-align: center;
  }

  /* Mobile call button in menu */
  .offcanvas-body .btn-signup {
    background-color: #e58030;
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .offcanvas-body .btn-signup:hover {
    background-color: #09335b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  /* Header positioning fixes */
  .navbarheader {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: none;
  }

  .mainmenu {
    padding: 8px 0;
  }

  /* Banner content mobile adjustments */
  .banner {
    padding-top: 80px;
  }

  .bannercontent {
    text-align: center;
    margin-top: 20px;
  }

  .bannercontent h1 {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .bannercontent h2 {
    font-size: 16px;
    margin: 15px 0;
  }

  .bannercontent h2 span {
    font-size: 16px;
  }

  .title_description,
  .title_description2 {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .btn_callback {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 14px;
  }

  /* Form improvements on mobile */
  .contactform {
    margin: 10px;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .contactform .customform {
    padding: 10px 0;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .contactform .callback_btn {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* Alert messages mobile styling */
  .alert {
    margin: 10px;
    border-radius: 8px;
    font-size: 14px;
  }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
  .navbar-toggler {
    display: none;
  }

  .logo img {
    width: 160px;
  }

  .bannercontent h1 {
    font-size: 36px;
  }

  .bannercontent h2 {
    font-size: 20px;
  }
}

/* Desktop navigation bar fixes - Keep both top bar and navbar visible */
@media (min-width: 577px) {
  .navbarheader {
    background-color: #ffffff !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    top: 45px !important; /* Always keep space for top bar */
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1020 !important;
  }

  .navbarheader.navbar-scroll {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    top: 45px !important; /* Keep below top bar even when scrolling */
  }

  /* Ensure top bar is always visible on desktop */
  .headernav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    background: var(--theme-secondry) !important;
    height: 45px !important;
  }

  /* Adjust body padding to account for both headers */
  body {
    padding-top: 90px !important; /* 45px top bar + 45px navbar */
  }

  .banner {
    padding-top: 120px !important; /* Extra space for banner */
  }
}

/* Mobile - hide top bar */
@media (max-width: 576px) {
  .headernav {
    display: none !important;
  }

  .navbarheader {
    top: 0 !important;
  }

  body {
    padding-top: 60px !important;
  }

  .banner {
    padding-top: 80px !important;
  }
}

/* Desktop active navigation styling */
.mainmenu .nav-link.active {
  background-color: #e58030 !important;
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(229, 128, 48, 0.3);
}

.mainmenu .nav-link.active:hover {
  background-color: #09335b !important;
  color: white !important;
}

/* Ensure active links always have white text */
.mainmenu .nav-link.active,
.mainmenu .nav-link.active:visited,
.mainmenu .nav-link.active:focus {
  color: white !important;
}

/* Override any JavaScript color changes for active links */
.mainmenu .nav-link.active[style*="color"] {
  color: white !important;
}

/* Logo size adjustments */
.logo img {
  width: 120px !important; /* Smaller logo size */
  height: auto;
}

@media (min-width: 577px) {
  .logo img {
    width: 130px !important; /* Slightly larger on desktop */
  }
}

/* Ensure smooth transitions */
* {
  -webkit-tap-highlight-color: transparent;
}

.nav-link,
.btn {
  transition: all 0.3s ease;
}

/* Contact page styling */
.contact-info {
  padding: 60px 0;
  background-color: #f8f9fa;
}

.contact-item {
  text-align: center;
  padding: 30px 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  transition: transform 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-5px);
}

.contact-icon {
  width: 60px;
  height: 60px;
  background-color: #e58030;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.contact-icon i {
  font-size: 24px;
  color: white;
}

.contact-item h4 {
  color: #09335b;
  font-weight: 600;
  margin-bottom: 15px;
}

.contact-item p {
  margin-bottom: 5px;
  color: #666;
}

.contact-item a {
  color: #e58030;
  font-weight: 500;
  text-decoration: none;
}

.contact-item a:hover {
  color: #09335b;
}

/* Fix scroll offset for anchor links */
#services {
  scroll-margin-top: 120px; /* Account for both top bar and navbar */
}

/* General scroll offset for all sections with IDs */
section[id] {
  scroll-margin-top: 120px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  .offcanvas {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
