/*--------------------------------------------------------------
  Mobile Navigation System - Enhanced Responsive Menu
----------------------------------------------------------------*/

/* Mobile Navigation Toggler (Hamburger) */
.cs_nav_toggler {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: all 0.3s ease;
}

.cs_nav_toggler span {
  width: 100%;
  height: 3px;
  background: var(--heading-color);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Show on mobile */
@media (max-width: 1199px) {
  .cs_nav_toggler {
    display: flex;
  }
}

/* Active state animation */
.cs_nav_toggler.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.cs_nav_toggler.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.cs_nav_toggler.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.cs_mobile_menu_overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: all 0.3s ease;
}

.cs_mobile_menu_overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Container */
.cs_mobile_menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.cs_mobile_menu.active {
  right: 0;
}

/* Mobile Menu Header */
.cs_mobile_menu_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid #e8ebee;
  background: var(--accent-color);
}

.cs_mobile_menu_logo img {
  max-height: 40px;
  filter: brightness(0) invert(1);
}

.cs_mobile_menu_close {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.cs_mobile_menu_close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Mobile Menu Content */
.cs_mobile_menu_content {
  padding: 0;
}

/* Mobile Navigation List */
.cs_mobile_nav_list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs_mobile_nav_list li {
  border-bottom: 1px solid #e8ebee;
}

/* Main menu items */
.cs_mobile_nav_list > li {
  position: relative;
}

/* Menu items with children */
.cs_mobile_nav_list .menu-item-has-children {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cs_mobile_nav_list .menu-item-has-children:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.cs_mobile_nav_list .menu-item-has-children.active {
  background: linear-gradient(135deg, rgba(29, 111, 131, 0.05) 0%, rgba(29, 111, 131, 0.02) 100%);
}

.cs_mobile_nav_list .menu-item-has-children > a {
  padding-right: 60px; /* Make space for dropdown toggle */
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.cs_mobile_nav_list .menu-item-has-children > a::after {
  content: '';
  position: absolute;
  right: 55px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: rgba(102, 102, 102, 0.15);
  transition: all 0.3s ease;
}

.cs_mobile_nav_list .menu-item-has-children.active > a::after {
  background: var(--accent-color);
  opacity: 0.3;
}

.cs_mobile_nav_list a {
  display: flex;
  align-items: center;
  padding: 18px 25px;
  color: var(--heading-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
  position: relative;
}

.cs_mobile_nav_list a:hover,
.cs_mobile_nav_list a.active {
  background: var(--gray-color);
  color: var(--accent-color);
  transform: translateX(5px);
}

.cs_mobile_nav_list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--accent-color);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.cs_mobile_nav_list a:hover::before,
.cs_mobile_nav_list a.active::before {
  transform: scaleY(1);
}

/* Dropdown Toggle Button */
.cs_mobile_dropdown_toggle {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(102, 102, 102, 0.15);
  border-radius: 8px;
  color: var(--body-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 12px;
  z-index: 10;
  backdrop-filter: blur(5px);
  pointer-events: all;
  touch-action: manipulation;
}

.cs_mobile_dropdown_toggle:hover,
.cs_mobile_dropdown_toggle:focus {
  background: rgba(29, 111, 131, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 2px 10px rgba(29, 111, 131, 0.2);
}

.cs_mobile_dropdown_toggle.active {
  background: linear-gradient(135deg, var(--accent-color) 0%, #2980b9 100%);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(29, 111, 131, 0.4);
  transform: translateY(-50%) scale(1.1);
}

/* Make dropdown toggles more clickable on touch devices */
@media (hover: none) and (pointer: coarse) {
  .cs_mobile_dropdown_toggle {
    width: 40px;
    height: 40px;
    background: rgba(29, 111, 131, 0.1);
    border: 1px solid rgba(29, 111, 131, 0.2);
    color: var(--accent-color);
  }
  
  .cs_mobile_dropdown_toggle:active {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-50%) scale(0.95);
  }
}

.cs_mobile_dropdown_toggle i {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs_mobile_dropdown_toggle.active i {
  transform: rotate(180deg);
}

/* Submenu Styles */
.cs_mobile_submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  box-shadow: inset 0 0 0 rgba(29, 111, 131, 0);
  opacity: 0;
}

.cs_mobile_submenu.active {
  max-height: 400px;
  border-left-color: var(--accent-color);
  box-shadow: inset 0 2px 8px rgba(29, 111, 131, 0.1);
  opacity: 1;
}

.cs_mobile_submenu li {
  border-bottom: 1px solid rgba(232, 235, 238, 0.3);
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.3s ease;
}

.cs_mobile_submenu.active li {
  transform: translateY(0);
  opacity: 1;
}

.cs_mobile_submenu li:last-child {
  border-bottom: none;
}

.cs_mobile_submenu a {
  padding: 16px 25px 16px 45px;
  font-size: 14px;
  font-weight: 400;
  color: var(--body-color);
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs_mobile_submenu a::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 0 2px rgba(29, 111, 131, 0);
}

.cs_mobile_submenu a:hover::before,
.cs_mobile_submenu a:focus::before {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(29, 111, 131, 0.2);
}

.cs_mobile_submenu a:hover,
.cs_mobile_submenu a:focus {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  color: var(--accent-color);
  transform: translateX(8px);
  padding-left: 52px;
  box-shadow: 0 2px 10px rgba(29, 111, 131, 0.1);
}

/* Animation for submenu items */
.cs_mobile_submenu li {
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs_mobile_submenu.active li {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cs_mobile_submenu.active li:nth-child(1) { transition-delay: 0.1s; }
.cs_mobile_submenu.active li:nth-child(2) { transition-delay: 0.15s; }
.cs_mobile_submenu.active li:nth-child(3) { transition-delay: 0.2s; }
.cs_mobile_submenu.active li:nth-child(4) { transition-delay: 0.25s; }
.cs_mobile_submenu.active li:nth-child(5) { transition-delay: 0.3s; }

/* Loading state animation */
@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(29, 111, 131, 0.7);
  }
  50% { 
    box-shadow: 0 0 0 10px rgba(29, 111, 131, 0);
  }
}

/* Active menu item pulse */
.cs_mobile_nav_list a.active {
  animation: pulseGlow 2s infinite;
}

/* Smooth focus styles */
.cs_mobile_nav_list a:focus,
.cs_mobile_dropdown_toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 111, 131, 0.3);
}

/* Touch feedback */
.cs_mobile_nav_list a:active,
.cs_mobile_dropdown_toggle:active {
  transform: scale(0.98);
}

/* Mobile Menu Actions */
.cs_mobile_menu_actions {
  padding: 25px;
  border-top: 1px solid #e8ebee;
  background: #f8f9fa;
}

.cs_mobile_cta_btn {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #2980b9 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.cs_mobile_cta_btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(29, 111, 131, 0.3);
  color: #fff;
}

/* Mobile Contact Info */
.cs_mobile_contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs_mobile_contact_item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--body-color);
  text-decoration: none;
  font-size: 14px;
}

.cs_mobile_contact_item i {
  width: 20px;
  color: var(--accent-color);
  font-size: 16px;
}

.cs_mobile_contact_item:hover {
  color: var(--accent-color);
}

/* Mobile Social Links */
.cs_mobile_social {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e8ebee;
}

.cs_mobile_social_links {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.cs_mobile_social_btn {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 16px;
}

.cs_mobile_social_btn:hover {
  background: var(--heading-color);
  transform: translateY(-3px);
  color: #fff;
}

/* Animation for menu items */
.cs_mobile_menu.active .cs_mobile_nav_list li {
  animation: slideInFromRight 0.4s ease forwards;
  opacity: 0;
  transform: translateX(30px);
}

.cs_mobile_menu.active .cs_mobile_nav_list li:nth-child(1) { animation-delay: 0.1s; }
.cs_mobile_menu.active .cs_mobile_nav_list li:nth-child(2) { animation-delay: 0.15s; }
.cs_mobile_menu.active .cs_mobile_nav_list li:nth-child(3) { animation-delay: 0.2s; }
.cs_mobile_menu.active .cs_mobile_nav_list li:nth-child(4) { animation-delay: 0.25s; }
.cs_mobile_menu.active .cs_mobile_nav_list li:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInFromRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hide desktop navigation on mobile */
@media (max-width: 1199px) {
  .cs_nav_list_wrap {
    display: none;
  }
  
  .cs_main_header_right .d-none.d-lg-flex {
    display: none !important;
  }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .cs_mobile_menu {
    width: 100%;
    max-width: 100%;
  }
  
  .cs_mobile_menu_header {
    padding: 15px 20px;
  }
  
  .cs_mobile_nav_list a {
    padding: 15px 20px;
    font-size: 15px;
  }
  
  .cs_mobile_menu_actions {
    padding: 20px;
  }
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
  overflow: hidden;
  height: 100vh;
}

/* Smooth transitions for better UX */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Focus styles for accessibility */
.cs_nav_toggler:focus,
.cs_mobile_menu_close:focus,
.cs_mobile_nav_list a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cs_mobile_menu {
    border: 2px solid var(--heading-color);
  }
  
  .cs_mobile_nav_list a {
    border-bottom: 2px solid var(--border-color);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cs_nav_toggler span,
  .cs_mobile_menu,
  .cs_mobile_menu_overlay,
  .cs_mobile_nav_list a {
    transition: none;
  }
  
  .cs_mobile_menu.active .cs_mobile_nav_list li {
    animation: none;
    opacity: 1;
    transform: none;
  }
}