/* ===== MOBILE NAVBAR - EXACT DESIGN MATCH ===== */

@media (max-width: 991.98px) {
  /* Body padding for fixed navbar + search bar */
  body {
    padding-top: 125px !important;
    transition: padding-top 0.3s ease !important;
  }
  
  /* Adjust padding when search bar is hidden */
  body.search-hidden {
    padding-top: 60px !important;
  }
  
  /* Fixed Navbar Container */
  .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
    background-color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    padding: 0.5rem 1rem !important;
    height: 60px !important;
  }
  
  /* Navbar content layout - 3 columns */
  .navbar .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    height: 100% !important;
  }
  
  /* Logo - Left side - Make it smaller */
  .navbar-brand {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #2d3748 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
  }
  
  /* Logo image - smaller size */
  .navbar-brand img {
    height: 35px !important;
    width: auto !important;
    max-height: 35px !important;
  }
  
  /* Mobile cart container - Center */
  .navbar .d-lg-none {
    order: 2 !important;
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  
  /* Cart Icon - Center */
  .navbar .nav-link[href*="cart"] {
    position: relative !important;
    font-size: 1.75rem !important;
    color: #2d3748 !important;
    padding: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Cart Badge */
  .navbar .badge {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    background-color: #ef4444 !important;
    color: white !important;
    font-size: 0.65rem !important;
    padding: 0.2rem 0.35rem !important;
    border-radius: 50% !important;
    min-width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }
  
  /* Hamburger Menu - Right side */
  .navbar-toggler {
    border: none !important;
    padding: 0.5rem !important;
    font-size: 1.5rem !important;
    color: #2d3748 !important;
    flex: 0 0 auto !important;
    background: transparent !important;
    order: 3 !important;
    margin: 0 !important;
  }
  
  .navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
  }
  
  .navbar-toggler-icon {
    background-image: none !important;
    width: 30px !important;
    height: 22px !important;
    position: relative !important;
    display: block !important;
  }
  
  /* Hamburger icon - 3 lines */
  .navbar-toggler-icon::before,
  .navbar-toggler-icon::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background-color: #2d3748 !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
  }
  
  .navbar-toggler-icon::before {
    top: 0 !important;
  }
  
  .navbar-toggler-icon::after {
    bottom: 0 !important;
  }
  
  /* Middle line */
  .navbar-toggler-icon {
    background: #2d3748 !important;
    height: 3px !important;
    border-radius: 2px !important;
    position: relative !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  
  /* Logo order */
  .navbar-brand {
    order: 1 !important;
  }
  
  /* Hide default navbar items on mobile */
  .navbar-collapse {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    padding: 1rem !important;
    max-height: calc(100vh - 125px) !important;
    overflow-y: auto !important;
  }
  
  .navbar-nav {
    flex-direction: column !important;
  }
  
  .navbar-nav .nav-item {
    margin: 0.5rem 0 !important;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    color: #2d3748 !important;
    border-radius: 8px !important;
  }
  
  .navbar-nav .nav-link:hover {
    background-color: #f8f9fa !important;
  }
  
  /* Fixed Search Bar - Hides on scroll */
  .mobile-search-bar {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1040 !important;
    background-color: white !important;
    border-bottom: 1px solid #e9ecef !important;
    padding: 0.75rem 1rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
    height: 65px !important;
    transform: translateY(0) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform !important;
  }
  
  /* Search Container */
  .mobile-search-container {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
  }
  
  /* Search Input */
  .mobile-search-input {
    width: 100% !important;
    height: 48px !important;
    padding: 0.75rem 3.5rem 0.75rem 1.25rem !important;
    font-size: 0.95rem !important;
    color: #6c757d !important;
    background-color: white !important;
    border: 2px solid #1baaae !important;
    border-radius: 50px !important;
    outline: none !important;
    transition: all 0.3s ease !important;
  }
  
  .mobile-search-input::placeholder {
    color: #adb5bd !important;
    font-weight: 400 !important;
  }
  
  .mobile-search-input:focus {
    border-color: #1baaae !important;
    box-shadow: 0 0 0 3px rgba(27, 170, 174, 0.1) !important;
    color: #2d3748 !important;
  }
  
  /* Search Icon Button */
  .mobile-search-icon {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(135deg, #1baaae 0%, #16a085 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 1.1rem !important;
    cursor: pointer !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(27, 170, 174, 0.3) !important;
    transition: all 0.3s ease !important;
  }
  
  .mobile-search-icon:hover {
    background: linear-gradient(135deg, #16a085 0%, #1baaae 100%) !important;
    transform: translateY(-50%) scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(27, 170, 174, 0.4) !important;
  }
  
  .mobile-search-icon:active {
    transform: translateY(-50%) scale(0.95) !important;
  }
  
  /* Hide search bar when scrolling - FORCE HIDE */
  .mobile-search-bar.hidden {
    transform: translateY(-100%) !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  /* Show search button when hidden */
  .mobile-show-search {
    position: fixed !important;
    top: 70px !important;
    right: 1rem !important;
    z-index: 1030 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
  }
  
  .mobile-show-search.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
}

/* Extra small devices */
@media (max-width: 575.98px) {
  .navbar-brand {
    font-size: 1.1rem !important;
  }
  
  .mobile-search-input {
    font-size: 0.9rem !important;
    padding: 0.75rem 3rem 0.75rem 1rem !important;
  }
}
