/**
 * Dimple Whisky — WooCommerce cart and checkout.
 *
 * Only matches is_cart() || is_checkout() — which includes the checkout
 * endpoints, so the order-confirmation view keeps these rules. The width
 * containment, the phone layout of the cart line items, and the checkout
 * inputs and checkboxes (the mandatory 18+ confirmation among them).
 *
 * The notice banners and the block buttons these views also use are in
 * woocommerce.css, because the Mini Cart drawer renders them on every page.
 */

/* ------------------------------------------------- cart / checkout ------ */

/*
 * Defensive width containment: the cart page used to overflow its viewport by
 * 8px at 390px wide. Nothing inside the store may be wider than the screen.
 */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout,
.wc-block-components-sidebar-layout,
.wc-block-cart,
.wc-block-checkout {
	max-width: 100%;
}


/*
 * Cart line items on a phone. WooCommerce lays each row out as a CSS grid
 * whose template (80px 132px 32px 72px) is wider than a 360px screen can
 * hold, and the product cell — min-width: auto, so it refuses to shrink below
 * its content — overflowed its track and pushed the page into horizontal
 * scroll. Three explicit tracks and a shrinkable product cell fix it; the
 * thumbnail keeps a fixed width so the rows stay aligned.
 */
@media (max-width: 599px) {
	.wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row.wc-block-cart-items__row {
		grid-template-columns: 64px minmax(0, 1fr) auto;
		column-gap: 12px;
	}

	.wc-block-cart table.wc-block-cart-items .wc-block-cart-item__image.wc-block-cart-item__image {
		grid-column: 1 / 2;
		width: 64px;
		padding-right: 0;
	}

	.wc-block-cart table.wc-block-cart-items .wc-block-cart-item__image.wc-block-cart-item__image img {
		width: 100%;
	}

	.wc-block-cart table.wc-block-cart-items .wc-block-cart-item__product.wc-block-cart-item__product {
		grid-column: 2 / 3;
		min-width: 0;
	}

	.wc-block-cart table.wc-block-cart-items .wc-block-cart-item__total.wc-block-cart-item__total {
		grid-column: 3 / 4;
		width: auto;
		min-width: 0;
	}
}

.wc-block-components-text-input.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input.wc-block-components-text-input input[type="number"] {
	min-height: 44px;
}

/* The 18+ confirmation and the other checkout checkboxes: label on one line
   with its box, and a target big enough to hit on a phone. */
.wc-block-components-checkbox__label.wc-block-components-checkbox__label {
	line-height: 1.4;
}

.wc-block-components-checkbox.wc-block-components-checkbox {
	display: block;
}

@media (max-width: 767px) {
	.wc-block-components-checkbox.wc-block-components-checkbox label {
		display: flex;
		align-items: flex-start;
		gap: 0.5em;
		min-height: 44px;
		padding-block: 0.25em;
	}
}
