/* Persistent shortcut for saved external-brand items. It stays hidden until
   the authenticated visitor has at least one item in their Shopping Bag. */
.external-shopping-bag-bar [hidden] {
    display: none !important;
}

.external-shopping-bag-bar {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.38rem 0.55rem 0.38rem 0.42rem;
    color: #171717;
    background: #fff;
    border: 1px solid #d9dce1;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transform: translateX(-50%);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.external-shopping-bag-bar:hover,
.external-shopping-bag-bar:focus-visible {
    color: #171717;
    background: #f8f8f8;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
    outline: none;
    transform: translateX(-50%) translateY(-2px);
}

.external-shopping-bag-bar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
    color: #fff;
    background: #171717;
    border-radius: 50%;
}

.external-shopping-bag-bar__label {
    white-space: nowrap;
}

.external-shopping-bag-bar__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.3rem;
    color: #fff;
    background: #171717;
    border-radius: 999px;
    font-size: 0.64rem;
}

.external-shopping-bag-bar__prices {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.05rem;
    padding-left: 0.35rem;
    border-left: 1px solid #d9dce1;
    font-size: 0.64rem;
    white-space: nowrap;
}

.external-shopping-bag-bar__total-current {
    color: #171717;
    font-weight: 700;
}

.external-shopping-bag-bar__total-current.is-discounted {
    color: #c92a3a;
}

.external-shopping-bag-bar__total-original {
    color: #171717;
    font-weight: 500;
}

.external-shopping-bag-bar__total-savings {
    color: #208746;
    font-weight: 700;
}

.external-shopping-bag-bar__unavailable {
    color: #9a6700;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.64rem;
    font-weight: 700;
    white-space: nowrap;
}

.external-shopping-bag-bar__arrow {
    font-size: 0.64rem;
}

[dir="rtl"] .external-shopping-bag-bar {
    right: auto;
    left: 50%;
}

[dir="rtl"] .external-shopping-bag-bar__arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .external-shopping-bag-bar__prices {
    margin-right: 0.05rem;
    margin-left: 0;
    padding-right: 0.35rem;
    padding-left: 0;
    border-right: 1px solid #d9dce1;
    border-left: 0;
}

@media (max-width: 767.98px) {
    .external-shopping-bag-bar {
        right: 0.75rem;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        left: 0.75rem;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        grid-template-areas:
            "icon label count arrow"
            "prices prices unavailable arrow";
        column-gap: 0.45rem;
        row-gap: 0.3rem;
        min-height: 58px;
        padding: 0.48rem 0.6rem;
        border-radius: 12px;
        transform: none;
    }

    .external-shopping-bag-bar__icon { grid-area: icon; }
    .external-shopping-bag-bar__label { grid-area: label; }
    .external-shopping-bag-bar__count { grid-area: count; }
    .external-shopping-bag-bar__prices {
        grid-area: prices;
        justify-self: start;
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
    .external-shopping-bag-bar__unavailable { grid-area: unavailable; }
    .external-shopping-bag-bar__arrow { grid-area: arrow; align-self: center; }

    [dir="rtl"] .external-shopping-bag-bar {
        right: 0.75rem;
        left: 0.75rem;
    }

    [dir="rtl"] .external-shopping-bag-bar__prices {
        margin-right: 0;
        padding-right: 0;
        border-right: 0;
    }

    .external-shopping-bag-bar:hover,
    .external-shopping-bag-bar:focus-visible {
        transform: translateY(-2px);
    }

    body.has-external-shopping-bag-bar {
        padding-bottom: 4.75rem;
    }

    /* The footer's floating back-to-top control otherwise occupies the
       same lower-right space as the two-line bag bar. */
    body.has-external-shopping-bag-bar .back-to-top-fab {
        bottom: max(5.75rem, calc(5rem + env(safe-area-inset-bottom)));
    }
}
