/* ==========================================================================
   MERCEA — GLOBAL NAVIGATION
   ========================================================================== */

.global-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;

    height: var(--header-height);
    padding: 0 20px;

    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);

    position: relative;
    z-index: 100;
}


/* ==========================================================================
   MERCEA WORDMARK
   ========================================================================== */

.brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;

    font-family: var(--font-brand);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: 3.2px;
    line-height: 1;

    color: var(--brand-ivory);

    text-decoration: none;
    white-space: nowrap;
}


/* ==========================================================================
   PRIMARY NAVIGATION
   ========================================================================== */

.global-navigation {
    display: flex;
    align-items: center;
    gap: 3px;

    padding: 4px;
    min-width: 0;

    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;

    overflow-x: auto;
    scrollbar-width: none;
}

.global-navigation::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 6px 16px;
    border-radius: 4px;

    font-size: 12px;
    font-weight: 500;

    color: var(--text-secondary);
    white-space: nowrap;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.nav-link:hover:not(.disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);

    box-shadow:
        inset 0 0 0 1px var(--border-secondary);
}

.nav-link.disabled {
    opacity: 0.4;
    cursor: default;
}


/* ==========================================================================
   HEADER ACTIONS
   ========================================================================== */

.header-actions {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
}


/* ==========================================================================
   HAMBURGER BUTTON
   ========================================================================== */

.account-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    padding: 0;

    background: transparent;
    border: none;
    border-radius: 5px;

    color: var(--text-secondary);
    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.account-menu-toggle:hover,
.account-menu-toggle.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.account-menu-toggle svg {
    display: block;
    flex-shrink: 0;
}


/* ==========================================================================
   ACCOUNT DROPDOWN
   ========================================================================== */

.account-menu {
    position: absolute;

    top: calc(100% + 12px);
    right: 0;

    width: 240px;
    max-width: calc(100vw - 24px);

    padding: 6px;

    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 6px;

    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);

    z-index: 1000;
}

.account-menu[hidden] {
    display: none;
}

.account-menu-heading {
    padding: 10px 12px;

    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.9px;
    text-transform: uppercase;

    color: var(--text-muted);
}

.account-menu-item {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 38px;

    padding: 9px 12px;

    background: transparent;
    border: none;
    border-radius: 4px;

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease;
}

.account-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.account-menu-divider {
    height: 1px;
    margin: 5px 6px;

    background: var(--border-primary);
}


/* ==========================================================================
   AUTHENTICATED ACCOUNT IDENTITY
   ========================================================================== */

.account-menu-identity {
    display: flex;
    flex-direction: column;

    gap: 5px;
    padding: 12px;
}

.account-menu-name {
    font-size: 13px;
    font-weight: 600;

    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.account-menu-email {
    font-size: 11px;

    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.account-menu-verification {
    margin-top: 5px;

    font-size: 10px;
    color: #d4a76a;
}

.account-menu-verification.verified {
    color: var(--positive);
}


/* ==========================================================================
   SIGN OUT
   ========================================================================== */

.signout-button {
    color: var(--negative);
}

.signout-button:hover {
    background: rgba(229, 115, 120, 0.08);
    color: var(--negative);
}

.signout-button:disabled {
    opacity: 0.5;
    cursor: wait;
}


/* ==========================================================================
   RESPONSIVE NAVIGATION
   ========================================================================== */

@media (max-width: 1100px) {

    .global-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 12px;
    }

    .global-navigation {
        justify-self: center;
        max-width: 100%;
    }

    .nav-link {
        padding: 6px 10px;
    }

}


@media (max-width: 768px) {

    .global-header {
        grid-template-columns: auto minmax(0, 1fr) auto;

        padding: 0 12px;
        gap: 10px;
    }

    .brand {
        font-size: 21px;
        letter-spacing: 2px;
    }

    .global-navigation {
        justify-self: stretch;
    }

    .account-menu-toggle {
        width: 32px;
        height: 32px;
    }

    .account-menu {
        top: calc(100% + 10px);
    }

}