/* ==========================================
   ENHANCED NAVIGATION - Ideal Weight
   Modern, Responsive, Blue/Green Theme
   ========================================== */

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, #3B9DD5 -15%, #90b060 83%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Brand Logo - Enhanced Visibility */
.navbar-brand {
    font-size: 1.75rem;
    font-weight: 900;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    background: rgb(144 176 96);
    
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.navbar-brand:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.4);
    text-shadow: -2px 2px 0px rgb(255 252 252);
}

.navbar-brand i {
    font-size: 2.25rem;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.15); }
    20%, 40% { transform: scale(1); }
}

/* Navigation Links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    padding: 0.75rem 1.25rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

 
.navbar-nav .nav-link i {
    font-size: 1.1rem;
}

/* Dropdown Menus */
.navbar-nav .dropdown-menu {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    margin-top: 0.5rem;
    min-width: 250px;
}

.dropdown-item {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #E3F2FD, #F1F8E9);
    color: #1976D2;
    transform: translateX(5px);
}

.dropdown-item.active {
    background: linear-gradient(135deg, #3B9DD5, #7BC043);
    color: white;
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e0e0e0;
}

/* Language Switcher Dropdown */
#languageDropdown {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

#languageDropdown:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Shopping Cart Badge */
.nav-link .badge {
    background: #FF5252;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Notification Bell */
.notification-bell-container {
    position: relative;
}

.notification-bell {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF5252;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mobile Hamburger */
.navbar-toggler {
    border: 2px solid white;
    padding: 0.5rem;
    border-radius: 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* ===========================================
   NAVBAR TOGGLER ICON STATES
   Default: Hamburger (3 lines)
   Open: X icon
   =========================================== */

/* Base/Default State: Always show hamburger icon */
.navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    transition: background-image 0.3s ease;
    background-size: 1em !important;
}

/* Explicitly show hamburger when collapsed (default/closed state) */
.navbar-toggler.collapsed .navbar-toggler-icon,
.navbar-toggler[aria-expanded='false'] .navbar-toggler-icon,
.navbar-toggler.collapsed[aria-expanded='false'] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    background-size: 1em !important;
}

/* X icon ONLY when menu is open - requires BOTH: not collapsed AND aria-expanded='true' */
.navbar-toggler:not(.collapsed)[aria-expanded='true'] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") !important;
    background-size: 1.5em !important;
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .navbar {
        position: relative;
        flex-wrap: wrap;
    }
    
    .navbar .container-fluid {
        padding: 0.75rem 1rem !important;
        display: flex;
        flex-wrap: wrap !important;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    
    /* Toggle and brand together on left */
    .navbar-toggler {
        order: 1 !important;
        margin-left: 0 !important;
        margin-right: 0.75rem !important;
        position: relative !important;
        z-index: 1050;
        flex-shrink: 0;
        display: block !important;
    }
    
    /* Hide toggler if it somehow gets inside collapse */
    .navbar-collapse .navbar-toggler {
        display: none !important;
    }
    
    .navbar-brand {
        order: 2 !important;
        flex: 1;
        min-width: 0;
        font-size: 1.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-left: 0 !important;
        margin-right: auto;
        padding: 0.5rem 0 !important;
    }
    
    .navbar-brand img {
        max-height: 35px !important;
    }
    
    .navbar-collapse {
        order: 3 !important;
        width: 100% !important;
        flex-basis: 100% !important;
        flex-grow: 1 !important;
        background: linear-gradient(135deg, #1976D2, #558B2F);
        margin-top: 0.75rem;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    /* Default: Always show hamburger unless explicitly open */
    .navbar-toggler .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }
    
    /* Ensure hamburger when collapsed (default state) */
    .navbar-toggler.collapsed .navbar-toggler-icon,
    .navbar-toggler[aria-expanded='false'] .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
        background-size: 1em;
    }
    
    /* X icon ONLY when menu is explicitly open (BOTH conditions must be true) */
    .navbar-toggler:not(.collapsed)[aria-expanded='true'] .navbar-toggler-icon,
    .navbar-toggler[aria-expanded='true']:not(.collapsed) .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") !important;
        background-size: 1.5em;
    }
    
    .navbar-nav {
        gap: 0.5rem;
        width: 100%;
        flex-direction: column;
    }
    
    .navbar-nav .nav-link {
        padding: 1rem !important;
        margin: 0.25rem 0;
        border-radius: 8px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .dropdown-menu {
        background: rgba(255, 255, 255, 0.95);
        margin-top: 0.5rem;
        margin-left: 0;
        width: 100%;
        position: relative !important;
        transform: none !important;
        border: none;
        box-shadow: none;
    }
}

/* Small Mobile Navigation */
@media (max-width: 576px) {
    .navbar .container-fluid {
        padding: 0.5rem 0.75rem !important;
        flex-wrap: wrap !important;
    }
    
    .navbar-toggler {
        padding: 0.375rem 0.5rem;
        font-size: 1rem;
        order: 1 !important;
        margin-left: 0 !important;
        margin-right: 0.5rem !important;
        flex-shrink: 0;
        display: block !important;
    }
    
    .navbar-brand {
        font-size: 1rem;
        padding: 0.5rem 10% !important;
        margin-left: 0 !important;
        margin-right: auto;
        order: 2 !important;
    }
    
    .navbar-brand img {
        max-height: 30px !important;
    }
    
    /* Ensure toggler never appears in collapse */
    .navbar-collapse .navbar-toggler {
        display: none !important;
    }
    
    .navbar-collapse {
        order: 3 !important;
        margin-top: 0.75rem;
        padding: 0.875rem;
    }
}
    
    .navbar-nav .nav-link {
        padding: 0.875rem 0.75rem !important;
        font-size: 0.95rem;
    }
    
    .navbar .container-fluid {
        padding: 0.5rem 0.75rem !important;
    }
    
    .dropdown-item {
        padding: 0.625rem 0.75rem !important;
        font-size: 0.9rem;
    }
}

/* Tablet Navigation */
@media (min-width: 577px) and (max-width: 991px) {
    .navbar-nav .nav-link {
        padding: 0.625rem 1rem !important;
    }
    
    .navbar-brand {
        font-size: 1.35rem;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1.5rem !important;
    }
}

/* Smooth Transitions */
.navbar-collapse.collapsing {
    transition: height 0.35s ease;
}

.navbar-collapse.show,
.navbar-collapse.collapsing {
    transition: all 0.35s ease;
}

/* RTL Support - Desktop */
[dir="rtl"] .navbar-nav {
    text-align: right;
}

[dir="rtl"] .dropdown-item:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .navbar-brand {
    flex-direction: row-reverse;
}

/* RTL Support - Mobile Responsive */
@media (max-width: 991px) {
    [dir="rtl"] .navbar-nav {
        text-align: right;
        flex-direction: column;
    }
    
    [dir="rtl"] .navbar-nav .nav-link {
        text-align: right;
        justify-content: flex-start;
    }
    
    [dir="rtl"] .dropdown-item:hover {
        transform: translateX(5px);
    }
    
    [dir="rtl"] .dropdown-menu {
        position: relative !important;
        width: 100%;
        margin-right: 0;
        margin-left: 0;
    }
    
    [dir="rtl"] .navbar-toggler {
        order: 2;
        margin-left: 0;
        margin-right: auto;
    }
}

/* Active State */
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Search in Nav (Future) */
.nav-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
}

.nav-search input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 200px;
}

.nav-search input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Accessibility */
 

/* Loading State */
.navbar.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Dropdown Arrow Animation */
.dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Badge Animations */
.badge {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Menu Animation */
@media (max-width: 991px) {
    .navbar-nav .nav-item {
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInLeft 0.3s ease forwards;
    }
    
    .navbar-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
    .navbar-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
    .navbar-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
    .navbar-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
    .navbar-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }
    
    @keyframes slideInLeft {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* Sticky Navigation Shadow */
.navbar.sticky-top {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

