/*
 * Cart styles: Elementor side cart and the WooCommerce cart page.
 */

/* ---- Side cart ---- */
.elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
    width: 420px;
}

.elementor-menu-cart__main .elementor-menu-cart__product {
    grid-template-columns: 140px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 16px;
    padding-inline-end: 0;
}

.elementor-menu-cart__main .elementor-menu-cart__product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.elementor-menu-cart__main .elementor-menu-cart__product-name,
.elementor-menu-cart__main .elementor-menu-cart__product-price {
    padding-inline-start: 0;
}

.elementor-menu-cart__main .elementor-menu-cart__product-name {
    /* Keep long names clear of the remove button. */
    padding-inline-end: 34px;
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.elementor-menu-cart__main .elementor-menu-cart__product-price {
    align-self: end;
    padding-top: 8px;
    font-size: 15px;
}

.elementor-menu-cart__main .elementor-menu-cart__product-price .amount {
    font-weight: 600;
}

/* Remove button: top right, level with the product name. */
.elementor-menu-cart__main .elementor-menu-cart__products .elementor-menu-cart__product .elementor-menu-cart__product-remove {
    top: 0;
    bottom: auto;
    transform: none;
}

.elementor-menu-cart__main .elementor-menu-cart__products .elementor-menu-cart__product:not(:first-of-type) .elementor-menu-cart__product-remove {
    top: var(--product-divider-gap, 20px);
}

@media (max-width: 480px) {
    .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
        width: 100%;
    }

    .elementor-menu-cart__main .elementor-menu-cart__product {
        grid-template-columns: 110px minmax(0, 1fr);
        column-gap: 12px;
    }
}

/* ---- Cart page ---- */

/* WooCommerce core limits these images to 32px. */
.woocommerce-cart table.cart td.product-thumbnail img {
    display: block;
    width: 160px;
    max-width: none;
}

.woocommerce-cart table.cart .product-thumbnail {
    min-width: 160px;
}

.woocommerce-cart table.cart td.product-price,
.woocommerce-cart table.cart td.product-subtotal {
    white-space: nowrap;
}

/* The theme's 1rem side padding leaves no room for the number next to the
   browser's spin buttons. */
.woocommerce-cart table.cart td.product-quantity .quantity input.qty {
    width: 72px;
    padding: 8px;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .woocommerce-cart table.shop_table.cart th,
    .woocommerce-cart table.shop_table.cart td {
        padding-inline: 8px;
    }

    .woocommerce-cart table.cart td.product-thumbnail img {
        width: 90px;
    }

    .woocommerce-cart table.cart .product-thumbnail {
        min-width: 90px;
    }
}
