/* WooCommerce switches table rows to blocks at its tablet breakpoint. */
.woocommerce .woocommerce-cart-form table.shop_table tr.omg-mobile-cart-summary[hidden] { display: none; }

@media (max-width: 767px) {
	/* The original WooCommerce fields stay in the form for updates and validation. */
	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item {
		display: grid;
		grid-template-columns: 54px minmax(0, 1fr) auto 26px;
		grid-template-areas:
			"image name name remove"
			"image qty subtotal subtotal"
			"image unit unit unit";
		align-items: center;
		gap: 3px 8px;
		padding: 8px 12px;
		background: #fff;
		border: 1px solid #dedede;
		border-bottom: 0;
	}

	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item:first-child {
		border-radius: 6px 6px 0 0;
	}

	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item > td,
	.woocommerce .woocommerce-cart-form table.shop_table tr.omg-mobile-cart-summary > td {
		display: block;
		height: auto;
		min-height: 0;
		min-width: 0;
		padding: 0;
		border: 0;
		background: transparent;
		text-align: start !important;
		font-size: 15px;
		line-height: 1.35;
	}

	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item > td::before,
	.woocommerce .woocommerce-cart-form table.shop_table tr.omg-mobile-cart-summary > td::before {
		display: none;
	}

	.woocommerce-cart .cart_item .product-thumbnail { grid-area: image; }
	.woocommerce-cart .cart_item .product-name { grid-area: name; overflow-wrap: anywhere; }
	.woocommerce-cart .cart_item .product-remove { grid-area: remove; align-self: start; }
	.woocommerce-cart .cart_item .product-quantity { grid-area: qty; }
	.woocommerce-cart .cart_item .product-subtotal { grid-area: subtotal; justify-self: end; font-weight: 600; }
	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item > .product-price { grid-area: unit; font-size: 13px; }
	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item > .product-price::before {
		display: inline;
		float: none;
		content: attr(data-title) " ";
	}
	.woocommerce .woocommerce-cart-form table.shop_table tr.cart_item > .omg-duplicate-unit-price { display: none; }

	.woocommerce-cart .cart_item .product-thumbnail img {
		display: block;
		width: 54px;
		height: 70px;
		object-fit: contain;
	}
	.woocommerce-cart .cart_item .product-name a { font-weight: 600; }
	.woocommerce .woocommerce-cart-form .cart_item .quantity { margin: 0; }
	.woocommerce .woocommerce-cart-form .cart_item .quantity :is(.minus, .plus, .qty) {
		box-sizing: border-box;
		min-width: 0;
		width: 30px;
		height: 36px;
		min-height: 36px;
		padding: 0;
	}

	.woocommerce .woocommerce-cart-form table.shop_table tr.omg-mobile-cart-summary:not([hidden]) {
		display: block;
		padding: 10px 12px 13px;
		border: 1px solid #dedede;
		border-radius: 0 0 6px 6px;
		background: #fff;
	}

	.omg-cart-rates { font-size: 14px; }

	.omg-cart-rate {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 10px;
	}
	.omg-cart-rate strong { white-space: nowrap; }
	.woocommerce .woocommerce-cart-form a.omg-cart-change-shipping { font-size: .9em; text-decoration: underline; }
	.woocommerce .omg-cart-quick-checkout {
		display: flex;
		justify-content: center;
		align-items: center;
		min-height: 48px;
		margin-top: 8px;
		padding: 6px 12px;
		border-radius: 4px;
		background: #00774f;
		color: #fff;
		font-size: 18px;
		font-weight: 700;
		text-align: center;
		text-decoration: none;
	}
	.woocommerce .omg-cart-quick-checkout:is(:hover, :focus) { background: #006340; color: #fff; }
}
