* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

.avatar {
    width: 30px;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Modern Navigation Styles */
.modern-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .modern-navbar.scrolled {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow-md);
    }

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

    .navbar-brand:hover {
        transform: translateY(-1px);
        filter: brightness(1.1);
    }

/* Enhanced Navigation Links */
.nav-link {
    font-weight: 500;
    color: var(--secondary-color) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    margin: 0 0.25rem;
}

    .nav-link:hover {
        color: var(--primary-color) !important;
        background: rgba(37, 99, 235, 0.1);
        transform: translateY(-1px);
    }

    .nav-link.active {
        color: var(--primary-color) !important;
        background: rgba(37, 99, 235, 0.15);
    }

        .nav-link.active::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 2px;
            background: var(--primary-color);
            border-radius: 1px;
        }

/* Modern Cart Button */
.cart-btn {
    background: var(--bg-gradient);
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

    .cart-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
        color: white;
    }

    .cart-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
        transition: left 0.5s;
    }

    .cart-btn:hover::before {
        left: 100%;
    }

.cart-badge {
    background: var(--accent-color) !important;
    color: white !important;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Mobile Improvements */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .navbar-toggler:hover {
        background: rgba(37, 99, 235, 0.1);
    }

    .navbar-toggler:focus {
        box-shadow: none;
    }

.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%2837, 99, 235, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Menu Styling */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        box-shadow: var(--shadow-md);
        backdrop-filter: blur(20px);
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.25rem 0;
        border-radius: 8px;
    }

    .cart-btn {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }

    .login-section {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* Enhanced Footer */
.modern-footer {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    margin-top: auto;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Loading Animation */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--bg-gradient);
    transition: width 0.3s ease;
    z-index: 9999;
}

/* Search Enhancement */
.search-container {
    position: relative;
    max-width: 300px;
}

.search-input {
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    background: rgba(248, 250, 252, 0.8);
    transition: all 0.3s ease;
}

    .search-input:focus {
        border-color: var(--primary-color);
        background: white;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

/* Smooth Animations */
* {
    scroll-behavior: smooth;
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Modern Dropdown Styles */
.dropdown-menu-modern {
    min-width: 280px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-top: 0.5rem !important;
    animation: dropdownFadeIn 0.3s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.75rem 1rem;
    margin: 0.25rem;
    border-radius: 8px;
    color: var(--secondary-color);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

    .dropdown-item:hover {
        background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
        color: var(--primary-color);
        transform: translateX(5px);
    }

    .dropdown-item:active {
        transform: scale(0.98);
    }

    /* Category Icon */
    .dropdown-item .category-icon {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 12px;
        transition: all 0.3s ease;
    }

    .dropdown-item:hover .category-icon {
        background: var(--bg-gradient);
        color: white;
    }

/* Category Badge */
.category-badge {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

/* All Categories Link */
.dropdown-item-all {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
}

    .dropdown-item-all:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        filter: brightness(1.1);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        color: white !important;
    }

/* Dropdown Header */
.dropdown-header-modern {
    padding: 0.75rem 1rem;
    color: var(--secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 0.5rem;
}

/* Loading State */
.dropdown-loading {
    padding: 2rem;
    text-align: center;
}

/* Empty State */
.dropdown-empty {
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
}

    .dropdown-empty i {
        font-size: 2rem;
        opacity: 0.5;
        margin-bottom: 0.5rem;
    }

/* Error State */
.dropdown-error {
    padding: 1rem;
    text-align: center;
    color: #dc2626;
}

/* Search in Dropdown */
.dropdown-search {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 0.5rem;
}

    .dropdown-search input {
        width: 100%;
        padding: 0.5rem 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        font-size: 0.875rem;
        transition: all 0.2s ease;
    }

        .dropdown-search input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

/* Scrollbar for long lists */
.dropdown-menu-scroll {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: clip;
}

    .dropdown-menu-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .dropdown-menu-scroll::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }

    .dropdown-menu-scroll::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

        .dropdown-menu-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 0, 0, 0.3);
        }