/* Link from one storefront to the other for visitors who are not signed in. */
.portal-link {
    display: inline-flex;
    align-items: center;
    background: #77c34a;
    color: #fff !important;
    border-radius: 5px;
    padding: 7px 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}

.portal-link:hover {
    background: #68b13d;
}

.portal-link:focus-visible,
.portal-switch__item:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
}

/* Phones have no top bar, so the switch sits under the search field. */
.portal-switch {
    display: none;
}

@media (max-width: 767px) {
    /* Reserve the mobile header plus the switch's 56px height and 12px gap. */
    .wrapper.wrapper-with-portal-switch:has(.portal-switch) {
        padding-top: calc(33.33vw + 68px);
    }

    /* Hide the entire header, including the switch, regardless of its height. */
    .wrapper-with-portal-switch:has(.portal-switch) .header.scroll {
        top: 0;
        transform: translateY(-100%);
    }

    .header .header-bottom .header-bottom-actions {
        flex-wrap: wrap;
    }

    .portal-switch {
        display: flex;
        flex: 0 0 100%;
        order: 9;
        gap: 10px;
        width: 100%;
        margin-top: 12px;
        box-sizing: border-box;
    }

    .portal-switch__item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 9px;
        min-height: 56px;
        padding: 10px 12px;
        box-sizing: border-box;
        border-radius: 12px;
        border: 1.5px solid;
        line-height: 1.2;
        text-decoration: none;
    }

    .portal-switch__item svg {
        flex: none;
    }

    .portal-switch__item b {
        display: block;
        font-size: 15px;
        font-weight: 700;
    }

    .portal-switch__item small {
        display: block;
        margin-top: 2px;
        font-size: 11.5px;
        font-weight: 500;
    }

    .portal-switch__item.is-current {
        background: #eef0ed;
        border-color: #d3d8d0;
        color: #444;
    }

    .portal-switch__item.is-current small {
        color: #6a6f68;
    }

    .portal-switch__item.is-other {
        background: #fff;
        border-color: #4f9a2a;
        color: #2f6f12;
    }

    .portal-switch__item.is-other small {
        color: #4f7f3a;
    }
}
