.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.navbar__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar__brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.navbar__links {
    display: flex;
    gap: 28px;
    margin: 0 auto 0 0;
}

.navbar__links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color var(--transition);
}

.navbar__links a:hover, .navbar__links a.active {
    color: var(--color-primary);
}

.navbar__cart {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.navbar__cart:hover {
    color: var(--color-accent);
}

.navbar__cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--color-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transition: transform var(--transition);
}

.navbar__cart-badge--hidden {
    display: none;
}

@keyframes badgePop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

.navbar__cart-badge.badge-pulse {
    animation: badgePop 0.35s ease-out;
}

.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.navbar__toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

@media (max-width: 640px) {
    .navbar__toggle {
        display: flex;
    }

    .navbar__links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 16px 24px 20px;
        border-bottom: 1px solid var(--color-border);
        gap: 16px;
        box-shadow: var(--shadow-md);
    }

    .navbar__links.open {
        display: flex;
    }
}

.navbar__profile {
    position: relative;
    display: flex;
    align-items: center;
}

.navbar__profile-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
    padding: 4px 8px;
    border-radius: 9999px;
    transition: background 0.2s ease;
}

.navbar__profile-link:hover {
    background: #f5f5f4;
}

.navbar__profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e7e5e4;
}

.navbar__profile-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-primary, #1c1917);
}

.navbar__profile-chevron {
    font-size: 0.7rem;
    color: var(--color-text-muted, #78716c);
    transition: transform 0.2s ease;
}

.navbar__profile.active .navbar__profile-chevron,
.navbar__profile-link[aria-expanded="true"] .navbar__profile-chevron {
    transform: rotate(180deg);
}

.navbar__profile-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 230px;
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    overflow: hidden;
    animation: popupFadeIn 0.15s ease-out;
}

.navbar__profile-popup.hidden {
    display: none;
}

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

.navbar__profile-popup-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #fafaf9;
    border-bottom: 1px solid #f0eeeb;
}

.navbar__profile-popup-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e7e5e4;
}

.navbar__profile-popup-info {
    min-width: 0;
    flex: 1;
}

.navbar__profile-popup-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1c1917;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar__profile-popup-role {
    font-size: 0.75rem;
    color: #78716c;
    margin: 2px 0 0 0;
    font-weight: 500;
}

.navbar__profile-popup-links {
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.navbar__profile-popup-links :is(a, button) {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: #44403c;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar__profile-popup-links :is(a, button) i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: #78716c;
}

.navbar__profile-popup-links :is(a, button):hover {
    background: #f5f5f4;
    color: #0c0a09;
}

.navbar__profile-popup-links :is(a, button):hover i {
    color: #0c0a09;
}

.navbar__profile-popup-divider {
    height: 1px;
    background: #f0eeeb;
    margin: 4px 6px;
}

.navbar__profile-popup-links :is(a, button).navbar__profile-logout {
    color: #dc2626;
}

.navbar__profile-popup-links :is(a, button).navbar__profile-logout i {
    color: #dc2626;
}

.navbar__profile-popup-links :is(a, button).navbar__profile-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.navbar__profile-popup-links :is(a, button).navbar__profile-logout:hover i {
    color: #b91c1c;
}
.navbar__profile-popup-links button { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }

.navbar__profile-popup-header { position: relative; padding-right: 44px; }
.navbar__profile-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; font-size: 24px; cursor: pointer; color: #57534e; }
.navbar__profile-close:hover { background: #f5f5f4; }
.navbar__profile-close:focus-visible { outline: 2px solid currentColor; }
