/* Modern Navbar Styles */
.modern-navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 0.75rem;
}

/* Logo Styles */
.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-brand .logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1002;
    position: relative;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation Menu */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: space-between;
    margin-left: 2rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-icon {
    opacity: 0.8;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1001;
    pointer-events: none;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #667eea;
    padding-left: 1.5rem;
}

.dropdown-icon {
    opacity: 0.7;
    flex-shrink: 0;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    flex-shrink: 0;
}

.logout-item {
    color: #ef4444;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.logout-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.logout-item:active {
    background: #fee2e2;
}

/* User Dropdown */
.user-dropdown .dropdown-menu {
    right: 0;
    left: auto;
}

.user-link {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0.5rem 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-name {
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
}

.user-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.user-details strong {
    display: block;
    color: #111827;
    font-size: 0.9rem;
}

.user-details small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Search */
.search-container {
    position: relative;
}

.search-form {
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    z-index: 2;
    pointer-events: none;
}

.search-input {
    width: 300px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid transparent;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    width: 350px;
    z-index: 3;
}

@media (max-width: 768px) {
    .search-input:focus {
        width: 100%;
    }
}

/* Cart */
.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 500;
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-cart-link {
    display: none;
}

.mobile-cart-link .cart-text {
    display: none;
}

.cart-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.cart-icon-container {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .search-input {
        width: 250px;
    }
    
    .search-input:focus {
        width: 280px;
    }
    
    .navbar-brand .logo {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .mobile-cart-link {
        display: flex;
        margin-left: auto;
    }

    .desktop-cart-link {
        display: none;
    }
    
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 1rem;
        margin: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1001;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 70px);
        pointer-events: none;
    }
    
    .navbar-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        height: 100vh;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .navbar-actions {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 1rem;
    }
    
    .search-input {
        width: 100%;
    }
    
    .search-input:focus {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
        pointer-events: auto;
        display: none;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 8px;
        z-index: 1002;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
        pointer-events: auto;
    }
    
    .dropdown-item {
        color: white;
        position: relative;
        z-index: 1003;
        pointer-events: auto;
    }
    
    .dropdown-item:hover,
    .dropdown-item:active {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.2);
        outline: 2px solid rgba(255, 255, 255, 0.5);
        outline-offset: -2px;
    }
    
    .user-info {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .user-details strong {
        color: white;
    }
    
    .cart-text {
        display: block;
    }
    
    .nav-link {
        position: relative;
        z-index: 1;
    }
    
    .dropdown-toggle {
        position: relative;
        z-index: 1;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0 0.5rem;
        min-height: 60px;
    }
    
    .navbar-brand .logo {
        font-size: 1.1rem !important;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .logo-icon {
        font-size: 1.3rem !important;
    }
    
    .navbar-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
    
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}