/* ==========================================================================
   Cart pills: Fast ② · Scheduled ① · Spot · Pickup ①, one cart per delivery type
   (markup: storefront/partials/cart-switcher.blade.php, behaviour: js/storefront/cart.js).
   Used in the site header and on the cart page.
   ========================================================================== */

/* All pills share one row equally, so none is ever hidden off the edge of the screen */
.cart-switcher {
    display: grid;
    grid-template-columns: repeat(var(--cart-switcher-count, 4), minmax(0, 1fr));
    gap: 6px;
}

.cart-switcher--2 { --cart-switcher-count: 2; }
.cart-switcher--3 { --cart-switcher-count: 3; }
.cart-switcher--4 { --cart-switcher-count: 4; }

.cart-switcher__pill {
    position: relative;
    min-width: 0;
    height: 36px;
    padding: 0 6px;
    border: 1px solid #E2DCEB;
    border-radius: 18px;
    background: #FFFFFF;
    color: #2A1052;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    cursor: pointer;
}

.cart-switcher__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-switcher__pill:hover {
    border-color: #C9BDDB;
}

.cart-switcher__pill:focus-visible {
    outline: 3px solid #D91E5B;
    outline-offset: 2px;
}

.cart-switcher__pill[aria-selected="true"] {
    border-color: #2A1052;
    background: #2A1052;
    color: #FFFFFF;
}

.cart-switcher__icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke-width: 2.2;
}

/* A type that cannot be ordered right now: still opens, so its items can be seen or moved */
.cart-switcher__pill.is-off:not([aria-selected="true"]) {
    color: #9A90AE;
    border-style: dashed;
}

/* Item count as a small round badge on the pill's top-right corner (takes no width) */
.cart-switcher__count {
    position: absolute;
    top: -6px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border: 2px solid #FFFFFF;
    border-radius: 9px;
    background: #D91E5B;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-switcher__pill[aria-selected="true"] .cart-switcher__count {
    background: #D91E5B;
    color: #FFFFFF;
}

.cart-switcher__count[hidden] {
    display: none;
}

/* In the headers of the category, brand, offers and search pages: lined up with the filter chips */
.cart-switcher--list {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 4px;
}

/* In the "Which cart?" popup on the product page: pills wrap onto more rows */
.cart-switcher--sheet {
    gap: 8px;
}

.cart-switcher--sheet .cart-switcher__pill {
    height: 42px;
    border-radius: 21px;
    font-size: 14px;
}

/* Narrow phones with four types: hide the small icons so every name fits */
@media (max-width: 420px) {
    .cart-switcher--4 .cart-switcher__icon {
        display: none;
    }

    .cart-switcher--4 .cart-switcher__pill {
        font-size: 12px;
    }
}

/* Room for the corner badges above the row */
.cart-switcher__pill {
    margin-top: 6px;
}
