/* One cart product list. Rows below 768px, wrapping cards from 768px up. */
.cart-items {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.85rem 0.75rem;
    min-width: 0;
    padding: 1rem 0;
    border-bottom: 1px solid #e6e6e6;
    background: transparent;
}

.cart-item:last-child {
    border-bottom: 0;
}

.cart-item__media {
    display: flex;
    flex: 0 0 96px;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border-radius: 8px;
    background: #fafafa;
}

.cart-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-item__info {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 0.1rem;
}

.cart-item__name {
    display: block;
    color: #111;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cart-item__name:hover {
    color: #CC2121;
}

.cart-item__price,
.cart-item__line {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.cart-item__price {
    margin-top: 0.3rem;
    color: #555;
    font-size: 0.95rem;
}

.cart-item__break {
    flex-basis: 100%;
    height: 0;
}

.cart-item__qty {
    position: relative;
    flex: 0 1 auto;
    align-self: center;
}

.cart-item__error[hidden] {
    display: none !important;
}

.cart-item__pending {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    visibility: hidden;
}

.cart-item__spinner {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid #e3e3e3;
    border-top-color: #CC2121;
    border-radius: 50%;
    animation: cart-qty-spin 0.7s linear infinite;
}

.cart-item__error {
    flex: 1 1 100%;
    min-width: 0;
    margin: 0;
    color: #CC2121;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cart-item__line {
    position: relative;
    display: inline-flex;
    flex: 1 1 6rem;
    align-items: center;
    align-self: center;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-left: auto;
    color: #111;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: right;
}

.cart-item__pending.is-active {
    visibility: visible;
}

.cart-item__remove {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: #333;
    font-size: 1.15rem;
}

.cart-item__remove:hover {
    color: #CC2121;
}

.cart-item__qty.pro-qty {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    height: auto;
    float: none;
    padding: 0;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: #fff;
}

.cart-item__qty .qtybtn {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    float: none;
    color: #333;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.cart-item__qty .qtybtn.is-disabled {
    color: #bdbdbd;
    cursor: default;
}

.cart-item__qty input {
    width: 2.5rem;
    min-width: 0;
    height: 44px;
    float: none;
    border: 0;
    border-right: 1px solid #eee;
    border-left: 1px solid #eee;
    background: transparent;
    color: #111;
    font-size: 1rem;
    line-height: 44px;
    text-align: center;
}

.cart-item__name:focus-visible,
.cart-item__media:focus-visible,
.cart-item__qty .qtybtn:focus-visible,
.cart-item__qty input:focus-visible,
.cart-item__remove:focus-visible {
    outline: 2px solid #CC2121;
    outline-offset: 2px;
}

.cart-item__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes cart-qty-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-item__spinner {
        animation: none;
        border-color: #CC2121;
    }
}

@media (min-width: 768px) {
    .cart-items {
        gap: 1rem;
    }

    .cart-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem 1.25rem;
        padding: 1.05rem 1.15rem;
        border: 1px solid #e6e6e6;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(17, 17, 17, 0.05);
    }

    .cart-item__break {
        display: none;
    }

    .cart-item__info {
        flex: 1 1 12rem;
        order: 0;
        min-width: min(100%, 10rem);
        padding-top: 0;
    }

    .cart-item__qty {
        flex: 0 0 auto;
        order: 1;
    }

    .cart-item__line {
        flex: 0 1 auto;
        order: 2;
        align-self: center;
    }

    .cart-item__remove {
        flex: 0 0 44px;
        order: 3;
    }

    .cart-item__error {
        order: 4;
    }
}

.cart-layout__products,
.cart-summary {
    min-width: 0;
}

.cart-summary {
    margin-top: 1.5rem;
    padding: 1.35rem 1.4rem;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.05);
}

.cart-summary__title {
    margin: 0;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #eee;
    color: #111;
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.cart-summary__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #eee;
}

.cart-summary__label,
.cart-summary__value {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.cart-summary__label {
    flex: 1 1 6rem;
    color: #333;
}

.cart-summary__value {
    flex: 0 1 auto;
    color: #111;
    font-weight: 600;
    text-align: right;
}

.cart-summary__row--total .cart-summary__label,
.cart-summary__row--total .cart-summary__value {
    font-size: 1.15rem;
    font-weight: 700;
}

.cart-summary__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 44px;
    margin-top: 1.15rem;
    padding: 0.7rem 1.05rem;
    border-radius: 10px;
    background: #CC2121;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.cart-summary__checkout:hover,
.cart-summary__checkout:active {
    color: #fff;
    background: #111;
    text-decoration: none;
}

.cart-summary__checkout:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
    color: #fff;
}

.cart-summary__checkout .cart-checkout-icon,
.cart-checkout-bar__checkout .cart-checkout-icon {
    flex: 0 0 auto;
    display: block;
    width: 1.05rem;
    height: 1.05rem;
}

.cart-summary .checkout-disabled-notice {
    margin: 1.15rem 0 0;
}

@media (min-width: 992px) {
    .cart-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.86fr) minmax(16rem, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .cart-summary {
        position: sticky;
        top: calc(180px + 1rem);
        max-height: calc(100vh - 180px - 2rem);
        margin-top: 0;
        overflow: auto;
    }
}

/* Mobile checkout bar. Hidden from 768px up and when the cart is empty. */
.cart-checkout-bar {
    display: none;
}

@media (max-width: 767.98px) {
    .cart-checkout-bar {
        position: fixed;
        right: 0;
        bottom: var(--mobile-bottom-nav-height, calc(4.25rem + env(safe-area-inset-bottom, 0px)));
        left: 0;
        z-index: 1025;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem 1rem;
        padding: 0.875rem 1rem;
        background: #fff;
        box-shadow: 0 -6px 16px rgba(17, 17, 17, 0.08);
    }

    .cart-checkout-bar[hidden] {
        display: none !important;
    }

    body:has(.cart-checkout-bar:not([hidden])) {
        padding-bottom: calc(var(--mobile-bottom-nav-height, calc(4.25rem + env(safe-area-inset-bottom, 0px))) + var(--cart-checkout-bar-height, 4.75rem));
    }

    .cart-checkout-bar__subtotal {
        display: flex;
        flex: 1 1 8rem;
        flex-direction: column;
        min-width: 0;
    }

    .cart-checkout-bar__label {
        color: #666;
        font-size: 0.75rem;
        font-weight: 500;
        line-height: 1.2;
    }

    .cart-checkout-bar__amount {
        color: #111;
        font-size: 1.15rem;
        font-weight: 700;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .cart-checkout-bar__checkout {
        display: inline-flex;
        flex: 0 1 auto;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        min-width: 0;
        max-width: 100%;
        min-height: 44px;
        margin-left: auto;
        padding: 0.55rem 1.05rem;
        border-radius: 10px;
        background: #CC2121;
        color: #fff;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
    }

    .cart-checkout-bar__checkout:hover {
        color: #fff;
        background: #111;
        text-decoration: none;
    }

    .cart-checkout-bar__checkout:focus-visible {
        outline: 2px solid #111;
        outline-offset: 2px;
    }

    .cart-checkout-bar__checkout .cart-checkout-icon {
        flex: 0 0 auto;
        display: block;
        width: 1.05rem;
        height: 1.05rem;
    }
}
