/* Compact menu top bar shared by classic / focus / grid layouts */

.top-bar.menu-top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 2px 4px;
    border-bottom: none;
    direction: ltr;
}

.menu-top-bar .menu-header-logo {
    flex: 0 1 auto;
    min-width: 0;
    height: 40px;
    max-height: 40px;
    width: auto;
    max-width: min(40%, 120px);
    object-fit: contain;
    object-position: left center;
}

.menu-top-bar .company-name-sm {
    position: static;
    transform: none;
    font-size: 1.2rem;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-top-bar .top-bar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-inline-start: auto;
    flex-shrink: 0;
}

.menu-top-bar .top-bar-btn {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--primary);
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.menu-top-bar .top-bar-btn[aria-expanded="true"] {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

@media (hover: hover) {
    .menu-top-bar .top-bar-btn:hover {
        background: color-mix(in srgb, var(--primary) 10%, transparent);
    }
}

.menu-top-bar .top-bar-btn:active {
    background: color-mix(in srgb, var(--primary) 16%, transparent);
}

.menu-top-bar .top-bar-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.menu-top-bar .top-bar-badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

@media (max-width: 340px) {
    .menu-top-bar .top-bar-btn {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
}

/* Search field opens under the top bar from the search icon */
.menu-search-panel {
    display: none;
    padding: 2px 2px 6px;
}

body.menu-search-open .menu-search-panel {
    display: block;
}
