/* ==================== MOBILE NAVBAR STYLES ==================== */
@media (max-width: 991.98px) {
    .navbar-theme {
        padding: 0.5rem 0.75rem;
        min-height: auto;
    }

    .navbar-brand img {
        height: 30px !important;
        width: auto !important;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
        font-size: 1.25rem;
    }

    .navbar-toggler:focus {
        box-shadow: none;
        outline: none;
    }

    /* Collapse content - stack vertically on mobile */
    .navbar-collapse {
        padding: 0.75rem 0 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    /* Override the desktop flex layout - stack everything vertically */
    .navbar-nav-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    /* Search row - full width */
    .navbar-search-wrapper {
        max-width: 100%;
        width: 100%;
        margin: 0 0 0.5rem 0;
    }

    .navbar-search-wrapper .d-flex {
        width: 100%;
    }

    .navbar-search {
        height: 42px;
        font-size: 0.95rem;
        flex: 1;
    }

    /* Right-actions container becomes a vertical stacked menu */
    .navbar-right-actions {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        margin: 0 !important;
        gap: 0;
    }

    /* Nav text links: full-width tap targets */
    .navbar-right-actions > .nav-link {
        margin: 0 !important;
        padding: 0.75rem !important;
        border-radius: 6px;
        font-size: 1rem;
        text-align: left;
        width: 100%;
        transition: background-color 0.15s ease;
    }

    .navbar-right-actions > .nav-link:hover,
    .navbar-right-actions > .nav-link:focus {
        background-color: rgba(0, 115, 230, 0.08);
    }

    /* Hide the vertical divider on mobile */
    .navbar-right-actions > span[style*="background-color: var(--color-border)"] {
        display: none !important;
    }

    /* Cart link - show inline label so users know what it is */
    .navbar-right-actions > a[href*="cart"].nav-link {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
    }

    .navbar-right-actions > a[href*="cart"].nav-link::after {
        content: "Cart";
        color: #000;
        font-weight: 500;
    }

    .navbar-right-actions > a[href*="cart"].nav-link .cart-badge {
        position: static !important;
        transform: none !important;
        margin-left: auto;
    }

    /* Profile dropdown becomes a full-width block */
    .navbar-right-actions > .dropdown {
        width: 100%;
    }

    .navbar-right-actions > .dropdown > .dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem !important;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #000 !important;
        font-weight: 500;
        border-radius: 6px;
    }

    .navbar-right-actions > .dropdown > .dropdown-toggle::after {
        margin-left: auto;
    }

    .navbar-right-actions > .dropdown > .dropdown-toggle::before {
        content: "Account";
    }

    /* Render dropdown in-flow rather than absolutely positioned (avoids off-screen menus) */
    .navbar-right-actions > .dropdown .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.25rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: none;
        transform: none !important;
        inset: auto !important;
    }

    .navbar-right-actions > .dropdown .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Login / Sign up buttons - full width, stacked */
    .navbar-right-actions > .btn {
        width: 100%;
        margin: 0.35rem 0 0 0 !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .navbar-theme {
        padding: 0.4rem 0.5rem;
    }

    .navbar-brand img {
        height: 26px !important;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-right-actions > .nav-link,
    .navbar-right-actions > .dropdown > .dropdown-toggle {
        font-size: 0.95rem;
    }

    .nav-link i {
        font-size: 1.25rem !important;
    }
}
