/* The same navigation and account slots are used for every visitor. */
.custom-header-controls .va-header-account-slot {
    display: flex;
    align-items: center;
}

.custom-header-controls .va-header-account .va-header-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.custom-header-controls .va-header-account.logged-out .va-header-avatar img {
    display: block;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    margin: 0;
}

/* A legacy Customizer rule may still paint a second guest avatar on the label. */
.custom-header-controls .va-header-account.logged-out .text::before {
    content: none !important;
}

.column-profile-mobile-menu .va-header-account.logged-out .text {
    margin: 0 !important;
    padding-inline-start: 8px;
}

.column-profile-mobile-menu .va-header-account-slot.logged-out {
    margin-right: auto;
}

#masthead #logo > .va-section-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    align-self: center;
    margin: 0;
    border-radius: 7px;
    padding: 8px 12px;
    color: #474747;
    background: linear-gradient(45deg, #ffebe4, #fff6d1, #fff2f4, #ffcdcd);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.15;
    text-transform: none;
    white-space: nowrap;
}

#masthead #logo > .va-section-label--community {
    background: linear-gradient(45deg, #e9e4ff, #d1ffdb, #f2fbff, #d6cdff);
}

#masthead #logo > .va-section-label:hover {
    filter: brightness(0.96);
}

.user-question-post-page #masthead #logo > .va-section-label {
    display: none;
}

.custom-header-controls .notification-menu {
    min-width: min(360px, 100vw);
}

.custom-header-controls .va-notification-guest {
    padding-inline: 12px;
}

.custom-header-controls .va-notification-login {
    margin-inline-start: 0.35em;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.custom-header-controls .notification-menu .va-notification-guest-close {
    display: none;
}

@media (max-width: 849px) {
    #masthead #logo:has(> .va-section-label) {
        width: auto;
        gap: 7px;
    }

    #masthead #logo > .va-section-label {
        padding: 6px 8px;
        font-size: 12px;
    }

    .mfp-content .column-profile-mobile-menu:has(.va-header-guest .open) {
        z-index: 3;
    }

    .mfp-content .va-header-guest {
        position: relative;
        z-index: 2;
    }

    .mfp-content .va-header-guest > .custom-dropdown-wrapper {
        position: static;
    }

    .mfp-content .va-header-guest .notification-menu {
        position: absolute;
        inset: calc(100% + 6px) 0 auto auto;
        width: min(280px, calc(100vw - 24px));
        min-width: 0;
        height: auto;
        max-height: none;
        margin: 0;
        border-radius: 12px;
        transform: none !important;
        animation: none;
    }

    .custom-header-controls .notification-menu .va-notification-guest-close {
        display: block;
        min-height: 36px;
        margin: 0 auto 8px;
        padding: 0 12px;
        text-transform: none;
        line-height: 1.2;
    }

    .custom-header-controls .notification-menu .va-notification-guest-close::before {
        content: none;
    }
}

@media (min-width: 850px) {
    #header:not(.transparent) > .header-wrapper:not(.stuck):has(> #masthead #logo > .va-section-label--tour) {
        padding-top: 0;
    }

    #masthead > .header-inner {
        --va-header-gap: clamp(12px, 1.25vw, 18px);
        --va-nav-gap: clamp(10px, 1.1vw, 16px);
        --va-menu-separation: clamp(20px, 2vw, 30px);
        --va-icon-gap: 10px;
        --va-account-width: 92px;
        --va-control-size: 36px;
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr) max-content;
        column-gap: var(--va-header-gap);
        align-items: center;
    }

    #masthead > .header-inner::before,
    #masthead > .header-inner::after {
        content: none;
    }

    #masthead > .header-inner:lang(vi),
    #masthead > .header-inner:lang(de),
    #masthead > .header-inner:lang(es),
    #masthead > .header-inner:lang(ja),
    #masthead > .header-inner:lang(th) {
        --va-account-width: 122px;
    }

    #masthead .header-inner > #logo {
        --va-logo-width: clamp(102px, calc(13vw - 19px), 182px);
        align-items: center;
        gap: clamp(6px, 0.7vw, 10px);
        width: auto;
        margin: 0;
    }

    #masthead #logo > a:first-child {
        flex: 0 0 var(--va-logo-width);
        width: var(--va-logo-width);
        margin: 0;
    }

    #masthead #logo > a:first-child img {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }

    #masthead .header-inner > .hide-for-medium.flex-left {
        min-width: 0;
        width: 100%;
        margin: 0;
    }

    #masthead .header-inner > .hide-for-medium.flex-left > .header-nav,
    #masthead .header-inner > .hide-for-medium.flex-left .header-search-form {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    #masthead .header-inner > .hide-for-medium.flex-right {
        display: flex;
        align-items: center;
        margin: 0;
        padding-block: 0;
        padding-inline-start: calc(var(--va-menu-separation) - var(--va-header-gap));
    }

    #masthead .hide-for-medium.flex-left .search-field {
        /* The global Flatsome form skin sets an important top margin. */
        margin-top: 0 !important;
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        margin: 0;
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li {
        flex: none;
        margin: 0;
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li + li {
        margin-inline-start: var(--va-nav-gap);
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li.pll-parent-menu-item {
        margin-inline-start: var(--va-menu-separation);
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li.html_topbar_right {
        margin-inline-start: var(--va-icon-gap);
    }

    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li > a {
        display: flex;
        align-items: center;
        margin: 0;
        height: 44px;
        padding-block: 0;
        line-height: 1.2;
        white-space: nowrap;
    }

    #masthead .pll-parent-menu-item > .nav-top-link img {
        width: 35px;
        height: 35px;
        margin: 0;
    }

    #masthead .custom-header-controls {
        gap: var(--va-icon-gap);
        margin: 0;
    }

    #masthead .custom-header-controls > .custom-dropdown-wrapper {
        padding: 0;
        margin: 0;
        order: 0;
    }

    #masthead .va-header-account-slot {
        justify-content: flex-start;
        flex: 0 0 var(--va-account-width);
        width: var(--va-account-width);
    }

    #masthead .va-header-bell,
    #masthead .va-header-account.logged-in {
        display: inline-flex;
        justify-content: center;
        width: var(--va-control-size);
        height: var(--va-control-size);
        padding: 0;
        margin: 0;
    }

    #masthead .va-header-bell::after,
    #masthead .va-header-account::after {
        content: '';
        position: absolute;
        inset: -4px;
    }

    #masthead .va-header-account.logged-in .va-header-avatar img {
        display: block;
        width: var(--va-control-size);
        height: var(--va-control-size);
        margin: 0;
    }

    #masthead .va-header-account.logged-in .va-header-avatar::before {
        content: '';
        position: absolute;
        right: -1px;
        bottom: -1px;
        width: 12px;
        height: 12px;
        padding: 0;
        border: 2px solid white;
        border-radius: 50%;
        background: #d3d3d3;
    }

    #masthead .va-header-account.logged-in .va-header-avatar::after {
        content: '';
        position: absolute;
        right: 3px;
        bottom: 4px;
        width: 4px;
        height: 4px;
        border: solid #333;
        border-width: 0 1px 1px 0;
        transform: rotate(45deg);
    }

    #masthead .va-header-account.logged-out {
        display: flex;
        align-items: center;
        gap: 5px;
        max-width: 100%;
        height: var(--va-control-size);
        padding: 0 8px 0 4px;
        margin: 0 !important;
        white-space: nowrap;
    }

    #masthead .va-header-account.logged-out .text {
        display: block;
        min-width: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: transparent;
        text-overflow: ellipsis;
        font-weight: 500;
    }

    #masthead .va-header-account.logged-in .text {
        display: none;
    }

    #masthead .va-header-bell:focus-visible,
    #masthead .va-header-account:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
}

@media (min-width: 1025px) {
    #masthead {
        height: 60px;
        padding-bottom: 0;
    }
}

@media (min-width: 850px) and (max-width: 1099px) {
    #masthead .header-inner > .hide-for-medium.flex-right > .header-nav > li > a {
        font-size: 13px;
    }

    #masthead .custom-header-controls .va-header-account-slot {
        flex-basis: var(--va-control-size);
        width: var(--va-control-size);
    }

    #masthead .va-header-account.logged-out {
        justify-content: center;
        width: var(--va-control-size);
        padding: 0;
    }

    #masthead .va-header-account.logged-out .text {
        display: none;
    }
}
