/* Cart photos keep the file's own ratio and are never scaled up. */
img.cart-thumb {
    aspect-ratio: auto;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

img.cart-thumb-cart {
    max-width: 8rem;
    max-height: 9rem;
}

img.cart-thumb-popup {
    max-width: 7rem;
    max-height: 7rem;
}

img.cart-thumb-mini,
img.cart-thumb-summary {
    max-width: 100px;
    max-height: 100px;
}

@media (min-width: 640px) {
    img.cart-thumb-popup {
        max-width: 9rem;
        max-height: 9rem;
    }
}

@media (min-width: 768px) {
    img.cart-thumb-cart {
        max-width: 220px;
        max-height: 220px;
    }
}

/* Match the previous cart: 22px name and price on desktop. */
.checkout-cart-index .product-item-name,
.checkout-cart-index .price-box {
    font-size: 1rem;
    line-height: 1.25;
}

@media (min-width: 768px) {
    .checkout-cart-index .product-item-name,
    .checkout-cart-index .price-box {
        font-size: 22px;
    }
}

.checkout-cart-index .page-title {
    margin-bottom: 0;
}

/* Cart phone line matches the old Glencara cart: centered, uppercase, no bar. */
.checkout-cart-index .checkout-description {
    float: none;
    width: 100%;
    margin: 0;
    padding: 6px 10px 10px;
    background: none;
    color: #414042;
    font-size: 15px;
    line-height: 21px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: uppercase;
    text-align: center;
}

/* Mobile cart: payment buttons sit under the items and pin while they are off screen. */
@media (max-width: 1023px) {
    .checkout-cart-index .page-main {
        margin-block: 0;
    }

    .checkout-cart-index .columns,
    .checkout-cart-index .cart-layout {
        gap: 8px;
    }

    .checkout-cart-index .page-title {
        margin-bottom: 0;
        padding: 2px 10px;
    }

    .checkout-cart-index .checkout-description {
        padding: 4px 10px 8px;
        font-size: 12px;
        line-height: 16px;
    }

    .checkout-cart-index .columns {
        padding-left: 8px;
        padding-right: 8px;
    }

    .checkout-cart-index .cart_items_extra_container_mocon {
        margin-bottom: 6px;
    }

    .checkout-cart-index .cart-summary-card {
        padding: 8px 10px;
        border-radius: 0;
        border-inline: 0;
    }

    .checkout-cart-index .cart-summary-card > h2 {
        margin: 0 0 4px;
        font-size: 16px;
    }

    .checkout-cart-index .product-item-photo {
        width: 72px;
    }

    .checkout-cart-index img.cart-thumb-cart {
        max-width: 72px;
        max-height: 72px;
    }

    .checkout-cart-index article.cart.item {
        gap: 8px;
    }

    .checkout-cart-index article.cart.item .mt-2,
    .checkout-cart-index article.cart.item .mt-4 {
        margin-top: 4px;
    }

    .checkout-cart-index #shopping-cart-table > ul > li {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .checkout-cart-index .cart_items_extra_container {
        padding: 8px;
    }

    .checkout-cart-index .cart-pay-methods.is-fixed {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        background: #fff;
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -1px 6px rgb(0 0 0 / 12%);
    }

    .checkout-cart-index .checkout-methods-items {
        margin: 0;
    }

    .checkout-cart-index .cart-pay-methods .checkout-methods-items > :not([hidden]) ~ :not([hidden]) {
        margin-top: 4px;
    }
}
