/* Navigation Styles */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    position: relative;
}

.nav__brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav__brand img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.nav-center {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Icon buttons and badges */
.icon-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0.5rem;
    color: inherit;
    cursor: pointer;
}

.nav-item-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e94444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 0 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 2;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: inherit;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        padding: 0.5rem 1rem;
    }

    .mobile-menu-btn {
        display: flex;
        order: 1;
    }

    .nav__brand {
        order: 2;
        flex: 1;
        margin-top: 15px;
        justify-content: center;
    }

    .nav__brand img {
        height: 80px;
    }

    .nav-center {
        display: none;
    }

    .nav-actions {
        order: 3;
        margin-left: 0;
        gap: 0.5rem;
    }

    .icon-btn {
        padding: 0.5rem;
    }

    /* Mobile drawer styles */
    .drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .drawer[data-open="true"] {
        opacity: 1;
        visibility: visible;
    }

    .drawer-panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 360px;
        height: 100%;
        background: #ffffff;
        transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        overflow-y: auto;
        box-shadow: 2px 0 16px rgba(0,0,0,0.15);
        transform: translateX(-100%);
    }

    /* When open, show main panel */
    .drawer[data-open="true"] .drawer-panel {
        transform: translateX(0);
    }

    /* Main panel header */
    .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
        margin-bottom: 1rem;
    }

    .drawer-brand img {
        height: 40px;
        width: auto;
        object-fit: contain;
    }

    .drawer-close {
        background: none;
        border: none;
        font-size: 1.75rem;
        line-height: 1;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
    }

    /* Links and nav */
    .drawer-nav {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .drawer-nav-item {
        border-bottom: 1px solid #eee;
    }

    .drawer-nav-link {
        color: inherit;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.875rem 0.25rem;
    }

    .drawer-nav-link.has-submenu {
        cursor: pointer;
        user-select: none;
    }

    .drawer-nav-link .ml-auto {
        margin-left: auto;
        transition: transform 0.2s ease;
    }

    /* Rotate chevron when expanded */
    .drawer-nav-link[aria-expanded="true"] .ml-auto {
        transform: rotate(90deg);
    }

    /* Simple inline accordion submenu */
    .drawer-submenu {
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        padding-left: 0.5rem;
    }
    .drawer-submenu a {
        display: block;
        padding: 0.6rem 0.25rem;
        text-decoration: none;
        color: inherit;
    }
    .drawer-submenu.active {
        max-height: 70vh;
    }

    /* Utilities at the bottom */
    .drawer-utilities {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid #eee;
        background: #fff;
        margin-top: 1rem;
    }

    .util-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        justify-content: center;
        padding: 0.75rem;
        border: 1px solid #eee;
        background: #fafafa;
        border-radius: 8px;
        color: inherit;
    }

    /* Focus styles */
    .drawer a:focus,
    .drawer button:focus,
    .drawer .util-btn:focus {
        outline: 2px solid #222;
        outline-offset: 2px;
        border-radius: 6px;
    }

    /* Reduced motion */
    @media (prefers-reduced-motion: reduce) {
        .drawer,
        .drawer-panel {
            transition: none !important;
        }
        .drawer-submenu {
            transition: none !important;
        }
    }
}

/* Dropdown styles (desktop) */
.dropdown {
    position: relative;
}

.dropbtn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1;
}

.dropdown-content a {
    color: inherit;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.dropdown:hover .dropdown-content {
    display: block;
}