/* ===== NAVBAR AND DROPDOWN STYLES ===== */

/* Header Styles */
header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1050 !important;
  background: linear-gradient(to right, #2e2b2b, #f3f4f6) !important;
  /* border-bottom: 1px solid #e9ecef !important; */
  /* box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important; */
  padding: 12px 0 !important;
}

/* Main Navigation */
.navbar {
  position: relative !important;
  top: 0 !important;
  z-index: 1040 !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid #e9ecef !important;
  /* box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important; */
  margin-top: 0 !important;
}

.navbar.navbar-expand-lg {
  position: relative !important;
  margin-top: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* Ensure navbar expands properly on larger screens */
@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
  
  .navbar-expand-lg .navbar-toggler {
    display: none;
  }
}

/* Navbar toggler styling */
.navbar-toggler {
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.navbar-toggler:hover {
  text-decoration: none;
  background-color: #f8f9fa;
  border-color: #0d6efd;
}

.navbar-toggler:focus {
  text-decoration: none;
  outline: 0;
  /* box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); */
  background-color: #f8f9fa;
  border-color: #0d6efd;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;
}

/* Navigation Links */
.navbar-nav .nav-link {
  color: #212529 !important;
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: #0d6efd !important;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: #0d6efd;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* ===== CUSTOM CATEGORIES DROPDOWN ===== */

/* Dropdown Trigger */
.custom-dropdown-trigger {
  position: relative;
}

.custom-dropdown-trigger .nav-link {
  cursor: pointer;
}

.custom-dropdown-trigger:hover .nav-link {
  color: #0d6efd !important;
}

/* Dropdown Arrow */
.custom-dropdown-arrow {
  font-size: 12px;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

.custom-dropdown-trigger:hover .custom-dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Wrapper - Full viewport width */
.custom-categories-dropdown-wrapper {
  position: fixed;
  top: 140px; /* Adjust based on header + navbar height */
  left: 0;
  right: 0;
  width: 100vw;
  z-index: 1050;
  
  /* COMPLETELY HIDDEN BY DEFAULT */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
  
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dropdown Container */
.custom-categories-dropdown {
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-top: 3px solid #0d6efd;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  pointer-events: auto;
}

/* Show dropdown on hover - CSS only approach */
.custom-dropdown-trigger:hover .custom-categories-dropdown-wrapper,
.custom-categories-dropdown-wrapper:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Show dropdown with JavaScript show class */
.custom-categories-dropdown-wrapper.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Categories Grid Layout */
.custom-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Category Items */
.custom-category-item {
  display: flex;
  align-items: center;
  padding: 16px;
  text-decoration: none;
  color: #374151;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.3s ease;
  min-height: 70px;
}

.custom-category-item:hover {
  color: #0d6efd;
  background: #f8faff;
  border-color: #0d6efd;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.15);
  text-decoration: none;
}

/* Category Icons */
.custom-category-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.custom-category-item:hover .custom-category-icon {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: scale(1.1);
}

.custom-category-icon img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 50%;
}

.custom-category-icon i {
  font-size: 18px;
  color: #0d6efd;
}

/* Category Text */
.custom-category-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  flex-grow: 1;
}

.custom-category-text small {
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

/* Search Container Styles */
.search-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input {
  border-radius: 25px !important;
  padding: 12px 55px 12px 20px !important;
  border: 2px solid #e9ecef !important;
  background: #f8f9fa;
  transition: all 0.3s ease;
  font-size: 14px;
  height: 48px;
  line-height: 1.5;
  width: 100%;
  flex: 1;
}

.search-input:focus {
  border-color: #0d6efd !important;
  background: #fff;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15) !important;
  transform: translateY(-1px);
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none !important;
  background: #0d6efd;
  color: white;
  border-radius: 50% !important;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  cursor: pointer;
}

.search-btn:hover {
  background: #0b5ed7;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.search-btn i {
  font-size: 14px;
}

/* ===== MOBILE NAVBAR STYLES ===== */

/* Ensure mobile navbar is hidden on desktop */
.mobile-navbar {
  display: none;
}

/* Force hide mobile menu overlay by default */
.mobile-menu-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 1060 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: all 0.3s ease !important;
}

/* Mobile Header */
.mobile-header {
  z-index: 1050;
  background: linear-gradient(to right, #ffffff, #f8f9fa);
  border-bottom: 2px solid #e9ecef;
}

.mobile-logo h3 {
  color: #0d6efd;
}

.mobile-actions .btn-link {
  color: #495057;
  border: none;
  background: none;
}

.mobile-actions .btn-link:hover {
  color: #0d6efd;
}

.mobile-menu-toggle {
  background: #0d6efd !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  color: white !important;
  font-size: 16px !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  z-index: 1070 !important;
  position: relative !important;
}

.mobile-menu-toggle:hover {
  background: #0b5ed7;
  transform: scale(1.05);
}

/* Mobile Search Bar */
.mobile-search-bar {
  animation: slideDown 0.3s ease;
}

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



/* Show state - must override all hidden states */
.mobile-menu-overlay.show,
.mobile-menu-overlay[style*="display: block"],
body .mobile-menu-overlay.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: white;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu-overlay.show .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.mobile-menu-header h5 {
  color: #495057;
  font-weight: 600;
}

.mobile-menu-header .btn-link {
  color: #6c757d;
}

.mobile-menu-header .btn-link:hover {
  color: #495057;
}

/* Mobile Menu Items */
.mobile-menu-items {
  padding: 0;
}

/* Smooth transitions for mobile menu elements */
.mobile-menu-item .fa-chevron-right {
  transition: transform 0.3s ease;
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-submenu[style*="block"] {
  max-height: 500px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #495057;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 16px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f8f9fa;
}

.mobile-menu-item:hover {
  background: #f8f9fa;
  color: #0d6efd;
  text-decoration: none;
}

.mobile-menu-item i {
  width: 20px;
  text-align: center;
}

.mobile-menu-item .ms-auto {
  margin-left: auto;
}

/* Mobile Menu Sections */
.mobile-menu-section {
  border-bottom: 1px solid #e9ecef;
}

/* Mobile Submenu */
.mobile-submenu {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.mobile-submenu-item {
  display: flex;
  align-items: center;
  padding: 12px 40px;
  color: #6c757d;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f3f4;
}

.mobile-submenu-item:hover {
  background: #e9ecef;
  color: #495057;
  text-decoration: none;
}

.mobile-submenu-item:last-child {
  border-bottom: none;
}

/* Mobile User Info */
.mobile-user-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
  margin: 0 15px;
}

/* Mobile specific responsive styles */
@media (max-width: 768px) {
  /* Hide desktop navbar */
  .desktop-navbar {
    display: none !important;
  }
  
  /* Show mobile navbar */
  .mobile-navbar {
    display: block !important;
  }
  
  /* Adjust mobile menu for smaller screens */
  .mobile-menu-content {
    width: 280px;
  }
  
  .mobile-menu-item {
    padding: 12px 15px;
    font-size: 15px;
  }
  
  .mobile-submenu-item {
    padding: 10px 30px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .mobile-menu-content {
    width: 100vw;
    max-width: 100vw;
  }
  
  .mobile-logo h3 {
    display: none !important;
  }
}

/* Desktop specific styles */
@media (min-width: 769px) {
  /* Hide mobile navbar */
  .mobile-navbar {
    display: none !important;
  }
  
  /* Show desktop navbar */
  .desktop-navbar {
    display: block ;
  }
  
  /* Ensure mobile menu is hidden on desktop */
  .mobile-menu-overlay {
    display: none ;
  }
}

/* Mobile specific styles - ensure proper visibility */
@media (max-width: 768px) {
  /* Hide desktop navbar completely */
  .desktop-navbar {
    display: none ;
  }
  
  /* Show mobile navbar */
  .mobile-navbar {
    display: block !important;
  }
}

@media (max-width: 1200px) {
  .custom-categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    padding: 20px 24px;
  }
}

@media (max-width: 992px) {
  .custom-categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .custom-category-text {
    font-size: 14px;
  }
}

/* Force hide any conflicting Bootstrap dropdowns */
.nav-item.dropdown .dropdown-menu {
  display: none ;
}

.nav-item.dropdown .dropdown-menu.show {
  display: none ;
}

/* Ensure proper z-index stacking */
.custom-categories-dropdown {
  z-index: 1050;
}
/* F
ORCE SHOW MOBILE MENU - HIGHEST PRIORITY */
html body .mobile-navbar .mobile-menu-overlay.show,
html body div#mobileMenuOverlay.show,
html body div#mobileMenuOverlay[style*="display: block"] {
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.5) !important;
}

/* FORCE SHOW MOBILE MENU CONTENT */
html body .mobile-navbar .mobile-menu-overlay.show .mobile-menu-content,
html body div#mobileMenuOverlay.show .mobile-menu-content {
  transform: translateX(0) !important;
  display: block;
  visibility: visible !important;
}