/* QRS-295: the cart page, in the same calm style as the checkout (QRS-293).
   Phones: one column, product rows, then the order summary card.
   768px and up: the rows and the summary card side by side.
   Every control a finger uses is at least 44x44px.
   The store CSS sets "* { font-family: inter, Courier New }" on every element, so the text
   elements here set their own fonts. */

body.woocommerce-cart {
	--qr-ink: #111;
	--qr-ink-soft: #3b3b3b;
	--qr-muted: #6f6f6f;
	--qr-line: #e4e1dc;
	--qr-line-strong: #cfcbc4;
	--qr-wash: #f6f5f2;
	--qr-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--qr-display: Raleway, "Helvetica Neue", Arial, sans-serif;
}

body.woocommerce-cart #content :is(h1, h2, p, span, a, label, td, th, div, input, button, strong, bdi, b) {
	font-family: var(--qr-sans);
}

/* The theme's top space grew with the screen width (63-103px). Keep it the same everywhere. */
body.woocommerce-cart #content {
	padding-top: 0;
}

body.woocommerce-cart #content .page-title {
	color: var(--qr-ink);
	font-size: 28px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 28px 0 20px;
}

body.woocommerce-cart .woocommerce {
	color: var(--qr-ink-soft);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* "Added to your cart" with a "View cart" button is old news on the cart page.
   Other messages (for example "removed... Undo?") stay. */
body.woocommerce-cart .woocommerce-message:has(a.wc-forward) {
	display: none;
}

body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error {
	background: var(--qr-wash);
	border: 1px solid var(--qr-line);
	border-radius: 12px;
	color: var(--qr-ink-soft);
	font-size: 14px;
	margin: 0 0 16px;
	padding: 14px 16px;
}

body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-cart .woocommerce-info::before {
	display: none;
}

body.woocommerce-cart .woocommerce-message a,
body.woocommerce-cart .woocommerce-info a:not(.button) {
	color: var(--qr-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Product rows ---------- */
/* Block layout, so each row (a grid) gets the full width at every screen size.
   ".woocommerce" is in the selector to beat the theme's "width: 66%" rule. */
body.woocommerce-cart .woocommerce table.shop_table.cart,
body.woocommerce-cart .woocommerce table.shop_table.cart tbody {
	border: 0;
	display: block;
	margin: 0;
	width: 100%;
}

body.woocommerce-cart table.shop_table.cart thead {
	display: none;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item {
	align-items: center;
	border-bottom: 1px solid var(--qr-line);
	column-gap: 14px;
	display: grid;
	grid-template-areas:
		"thumb name     subtotal"
		"thumb price    price"
		"thumb quantity remove";
	grid-template-columns: 80px minmax(0, 1fr) auto;
	padding: 18px 0;
	row-gap: 2px;
}

body.woocommerce-cart table.shop_table.cart tr.cart_item:first-child {
	border-top: 1px solid var(--qr-line);
}

body.woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td {
	background: transparent;
	border: 0;
	display: block;
	padding: 0;
	text-align: start !important;
}

/* The theme gives the cells widths and an auto margin (an id selector), which the grid does not need. */
body.woocommerce-cart #content table.cart tr.cart_item td {
	margin: 0;
	width: auto;
}

/* WooCommerce adds "Price:", "Quantity:" labels on phones; the layout makes them clear. */
body.woocommerce-cart table.shop_table_responsive tr.cart_item td::before {
	content: none;
	display: none;
}

body.woocommerce-cart tr.cart_item td.product-thumbnail {
	align-self: start;
	grid-area: thumb;
}

body.woocommerce-cart tr.cart_item td.product-thumbnail img {
	aspect-ratio: 1;
	background: #fff;
	border: 1px solid var(--qr-line);
	border-radius: 14px;
	display: block;
	height: auto;
	object-fit: cover;
	width: 80px;
}

body.woocommerce-cart tr.cart_item td.product-name {
	grid-area: name;
}

body.woocommerce-cart tr.cart_item td.product-name a {
	color: var(--qr-ink);
	display: inline-block;
	font-size: 16px;
	font-weight: 500;
	margin-block: -12px;
	padding-block: 12px;
	text-decoration: none;
}

body.woocommerce-cart tr.cart_item td.product-name dl.variation {
	color: var(--qr-muted);
	font-size: 13px;
	margin: 2px 0 0;
}

body.woocommerce-cart tr.cart_item td.product-price {
	color: var(--qr-muted);
	font-size: 14px;
	grid-area: price;
}

body.woocommerce-cart .woocommerce table.shop_table.cart tr.cart_item td.product-subtotal {
	color: var(--qr-ink);
	font-size: 16px;
	font-weight: 600;
	grid-area: subtotal;
	text-align: end !important;
	white-space: nowrap;
}

body.woocommerce-cart tr.cart_item td.product-quantity {
	grid-area: quantity;
	margin-top: 8px;
}

body.woocommerce-cart tr.cart_item td.product-remove {
	grid-area: remove;
	justify-self: end;
	margin-top: 8px;
}

/* Quantity control: one pill with a 44px "-" and "+" (the theme adds the buttons). */
body.woocommerce-cart tr.cart_item .quantity {
	align-items: center;
	border: 1px solid var(--qr-line-strong);
	border-radius: 999px;
	display: inline-flex;
	height: 44px;
	overflow: hidden;
}

body.woocommerce-cart tr.cart_item .quantity button.minus,
body.woocommerce-cart tr.cart_item .quantity button.plus {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--qr-ink);
	cursor: pointer;
	display: inline-flex;
	font-size: 18px;
	height: 44px;
	justify-content: center;
	margin: 0;
	min-width: 44px;
	padding: 0;
	width: 44px;
}

body.woocommerce-cart tr.cart_item .quantity button.minus:hover,
body.woocommerce-cart tr.cart_item .quantity button.plus:hover {
	background: var(--qr-wash);
}

body.woocommerce-cart tr.cart_item .quantity button:focus-visible {
	box-shadow: inset 0 0 0 2px var(--qr-ink);
	outline: none;
}

body.woocommerce-cart tr.cart_item .quantity input.qty {
	-moz-appearance: textfield;
	appearance: textfield;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--qr-ink);
	font-size: 16px;
	font-weight: 600;
	height: 44px;
	margin: 0;
	padding: 0;
	text-align: center;
	width: 36px;
}

body.woocommerce-cart tr.cart_item .quantity input.qty::-webkit-outer-spin-button,
body.woocommerce-cart tr.cart_item .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Remove: a 44px round button. The theme draws the "x" with two thin lines. */
body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove {
	background: transparent !important;
	border-radius: 50%;
	color: var(--qr-muted) !important;
	display: block;
	font-size: 0;
	height: 44px;
	position: relative;
	width: 44px;
}

body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove::before,
body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove::after {
	background: currentColor;
	border: 0;
	content: "";
	height: 1.5px;
	left: 50%;
	margin: 0;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 16px;
}

body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove:focus-visible {
	box-shadow: 0 0 0 2px var(--qr-ink);
	outline: none;
}

body.woocommerce-cart.woocommerce-page table.cart td.product-remove a.remove:hover {
	background: var(--qr-wash) !important;
	color: var(--qr-ink) !important;
}

/* ---------- Order summary card ---------- */
body.woocommerce-cart .cart-collaterals {
	margin-top: 24px;
}

body.woocommerce-cart .cart-collaterals .cart_totals.qr-cart-summary {
	background: var(--qr-wash);
	border: 0;
	border-radius: 18px;
	box-shadow: none;
	box-sizing: border-box;
	float: none;
	padding: 22px 20px 20px;
	text-align: start;
	width: 100%;
}

body.woocommerce-cart .qr-cart-summary__title {
	color: var(--qr-ink);
	font-family: var(--qr-display) !important;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.16em;
	margin: 0 0 12px;
	text-transform: uppercase;
}

body.woocommerce-cart .qr-cart-summary table.shop_table {
	border: 0;
	margin: 0;
	width: 100%;
}

body.woocommerce-cart .qr-cart-summary table.shop_table tr.cart-subtotal {
	align-items: baseline;
	display: flex;
	justify-content: space-between;
}

body.woocommerce-cart.woocommerce-page .qr-cart-summary table.shop_table tr.cart-subtotal th,
body.woocommerce-cart.woocommerce-page .qr-cart-summary table.shop_table tr.cart-subtotal td {
	background: transparent;
	border: 0;
	color: var(--qr-ink);
	display: block;
	font-size: 16px;
	font-weight: 600;
	padding: 0;
}

body.woocommerce-cart .qr-cart-summary table.shop_table tr.cart-subtotal th {
	flex: 1;
	text-align: start;
}

body.woocommerce-cart .qr-cart-summary table.shop_table tr.cart-subtotal td {
	font-size: 20px;
	text-align: end;
	white-space: nowrap;
}

body.woocommerce-cart .qr-cart-summary table.shop_table_responsive tr td::before {
	content: none;
	display: none;
}

body.woocommerce-cart .qr-cart-summary__note {
	color: var(--qr-muted);
	font-size: 13px;
	line-height: 1.45;
	margin: 8px 0 18px;
}

body.woocommerce-cart .wc-proceed-to-checkout {
	padding: 0;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	align-items: center;
	background: var(--qr-ink);
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	box-sizing: border-box;
	color: #fff;
	display: flex;
	font-size: 16px;
	font-weight: 600;
	justify-content: center;
	letter-spacing: 0.01em;
	margin: 0;
	min-height: 56px;
	padding: 0 28px;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.1s ease;
	width: 100%;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: #2a2a2a;
	color: #fff;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:active {
	transform: scale(0.99);
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:focus-visible {
	box-shadow: 0 0 0 3px var(--qr-wash), 0 0 0 5px var(--qr-ink);
	outline: none;
}

/* ---------- Empty cart ---------- */
body.woocommerce-cart .wc-empty-cart-message .cart-empty {
	background: var(--qr-wash);
	border: 0;
	border-radius: 18px;
	color: var(--qr-ink);
	font-size: 16px;
	padding: 32px 20px;
	text-align: center;
}

body.woocommerce-cart .return-to-shop {
	margin: 16px 0 0;
	text-align: center;
}

body.woocommerce-cart .return-to-shop a.button {
	align-items: center;
	background: var(--qr-ink);
	border: 0;
	border-radius: 999px;
	color: #fff;
	display: inline-flex;
	font-size: 16px;
	font-weight: 600;
	justify-content: center;
	min-height: 52px;
	padding: 0 32px;
	text-decoration: none;
}

body.woocommerce-cart .return-to-shop a.button:hover {
	background: #2a2a2a;
	color: #fff;
}

/* ---------- 768px and up: rows and summary side by side ---------- */
@media (min-width: 768px) {
	body.woocommerce-cart .woocommerce:has(.woocommerce-cart-form) {
		align-items: start;
		column-gap: 40px;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	}

	body.woocommerce-cart .woocommerce:has(.woocommerce-cart-form) > :not(.woocommerce-cart-form):not(.cart-collaterals) {
		grid-column: 1 / -1;
	}

	/* Not sticky: the theme makes <body> a scroll box, so "sticky" moved the card down. */
	body.woocommerce-cart .cart-collaterals {
		margin-top: 0;
	}
}

/* 1024px and up: the product rows are wide enough for one line each. */
@media (min-width: 1024px) {
	body.woocommerce-cart .woocommerce:has(.woocommerce-cart-form) {
		column-gap: 56px;
		grid-template-columns: minmax(0, 1fr) 360px;
	}

	body.woocommerce-cart table.shop_table.cart tr.cart_item {
		grid-template-areas:
			"thumb name  quantity subtotal remove"
			"thumb price quantity subtotal remove";
		grid-template-columns: 96px minmax(0, 1fr) auto 96px 44px;
	}

	body.woocommerce-cart tr.cart_item td.product-thumbnail img {
		width: 96px;
	}

	body.woocommerce-cart tr.cart_item td.product-quantity,
	body.woocommerce-cart tr.cart_item td.product-remove {
		align-self: center;
		margin-top: 0;
	}

	body.woocommerce-cart tr.cart_item td.product-subtotal {
		align-self: center;
	}
}
