/* Cart page (/cart) – loaded only when is_cart(). Colours match the checkout review. */

.woocommerce-cart .woocommerce {
	--cart-bg: #f9f6f1;
	--cart-gold: #b78e51;
	--cart-gold-dark: #9c7741;
	--cart-text: #000;
	--cart-muted: #6f6f6f;
	--cart-border: #e6dfd3;
	padding-bottom: 60px;
}

/* Two columns: items + totals card. Only when the cart has items (empty cart keeps its own layout). */
.woocommerce-cart .woocommerce:has(.woocommerce-cart-form) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 40px;
	align-items: start;
}

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

/* ---------- Items table ---------- */

.woocommerce-cart .woocommerce-cart-form {
	margin: 0;
}

.woocommerce-cart table.shop_table.cart {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 12px;
	margin: -12px 0 0;
}

.woocommerce-cart table.shop_table.cart thead th {
	padding: 0 16px 4px;
	font-size: 15px;
	font-weight: 600;
	color: var(--cart-muted);
	text-align: right;
	border: 0;
}

.woocommerce-cart table.shop_table.cart thead th.product-subtotal,
.woocommerce-cart table.shop_table.cart thead th.product-quantity,
.woocommerce-cart table.shop_table.cart thead th.product-price {
	text-align: center;
}

.woocommerce-cart table.shop_table.cart tbody td {
	background: var(--cart-bg);
	padding: 16px;
	vertical-align: middle;
	border: 0;
	font-size: 16px;
	color: var(--cart-text);
}

.woocommerce-cart table.shop_table.cart td.product-price,
.woocommerce-cart table.shop_table.cart td.product-quantity,
.woocommerce-cart table.shop_table.cart td.product-subtotal {
	text-align: center;
	white-space: nowrap;
}

.woocommerce-cart table.shop_table.cart td.product-subtotal {
	font-weight: 600;
}

.woocommerce-cart .product-info-wrap {
	display: flex;
	align-items: center;
	gap: 16px;
}

.woocommerce-cart .product-info-wrap .img-wrap {
	flex: 0 0 90px;
	width: 90px;
}

.woocommerce-cart .product-info-wrap .img-wrap img {
	display: block;
	width: 90px;
	height: 90px;
	object-fit: cover;
}

.woocommerce-cart .product-info-wrap .product-name {
	font-size: 16px;
	line-height: 1.4;
}

.woocommerce-cart .product-info-wrap .product-name a {
	color: var(--cart-text);
	text-decoration: none;
	font-weight: 600;
}

.woocommerce-cart .product-info-wrap .product-name a:hover {
	color: var(--cart-gold);
}

/* Grind option and other item meta */
.woocommerce-cart .product-name dl.variation {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--cart-muted);
}

.woocommerce-cart .product-name dl.variation dt,
.woocommerce-cart .product-name dl.variation dd,
.woocommerce-cart .product-name dl.variation dd p {
	display: inline;
	margin: 0;
	font-weight: 400;
}

.woocommerce-cart .product-name .grind-option {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	color: var(--cart-muted);
}

.woocommerce-cart .product-name .backorder_notification {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--cart-muted);
}

.woocommerce-cart td.product-quantity .quantity {
	display: inline-block;
}

.woocommerce-cart td.product-remove a.remove {
	color: var(--cart-muted);
	font-size: 14px;
	text-decoration: underline;
}

.woocommerce-cart td.product-remove a.remove:hover {
	color: var(--cart-text);
}

/* WooCommerce blocks the form while it refreshes */
.woocommerce-cart .blockUI.blockOverlay {
	background: rgba(255, 255, 255, 0.6) !important;
}

/* ---------- Totals card ---------- */

.woocommerce-cart .cart-collaterals {
	position: sticky;
	top: 140px;
}

.woocommerce-cart .cart-collaterals .cart_totals {
	background: var(--cart-bg);
	padding: 24px;
	width: 100%;
	float: none;
}

.woocommerce-cart .cart_totals h2 {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 16px;
}

.woocommerce-cart .cart_totals table.shop_table,
.woocommerce-cart .cart_totals table.shop_table tbody {
	display: block;
	width: 100%;
	border: 0;
	margin: 0;
}

.woocommerce-cart .cart_totals table.shop_table {
	margin-bottom: 20px;
}

.woocommerce-cart .cart_totals table.shop_table tr {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cart-border);
}

.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
	display: block;
	padding: 0;
	border: 0;
	font-size: 16px;
}

.woocommerce-cart .cart_totals table.shop_table th {
	text-align: right;
	font-weight: 600;
}

.woocommerce-cart .cart_totals table.shop_table td {
	text-align: left;
}

.woocommerce-cart .cart_totals tr.order-total {
	border-bottom: 0;
	padding-top: 16px;
}

.woocommerce-cart .cart_totals tr.order-total th,
.woocommerce-cart .cart_totals tr.order-total td {
	font-size: 20px;
	font-weight: 700;
}

.woocommerce-cart .cart_totals tr.order-total td small {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: var(--cart-muted);
}

/* Shipping: label above the options so the long Hebrew labels get the full card width */
.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals {
	flex-direction: column;
	gap: 8px;
}

.woocommerce-cart .cart_totals tr.woocommerce-shipping-totals td {
	width: 100%;
	text-align: right;
}

.woocommerce-cart .cart_totals ul#shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
}

.woocommerce-cart .cart_totals ul#shipping_method li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 10px;
	padding: 0;
	font-size: 15px;
	line-height: 1.4;
}

.woocommerce-cart .cart_totals ul#shipping_method li:last-child {
	margin-bottom: 0;
}

.woocommerce-cart .cart_totals ul#shipping_method li::before {
	display: none;
}

.woocommerce-cart .cart_totals ul#shipping_method input[type="radio"] {
	flex: 0 0 auto;
	margin: 3px 0 0;
	accent-color: var(--cart-gold);
}

.woocommerce-cart .cart_totals ul#shipping_method label {
	margin: 0;
	font-weight: 400;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-destination {
	margin: 10px 0 4px;
	font-size: 14px;
	color: var(--cart-muted);
	text-align: right;
}

.woocommerce-cart .cart_totals .woocommerce-shipping-calculator {
	text-align: right;
	margin: 0;
}

.woocommerce-cart .cart_totals .shipping-calculator-button {
	font-size: 14px;
	color: var(--cart-gold);
	text-decoration: underline;
}

.woocommerce-cart .cart_totals .shipping-calculator-form {
	margin-top: 10px;
}

.woocommerce-cart .cart_totals .shipping-calculator-form p {
	margin: 0 0 8px;
}

.woocommerce-cart .cart_totals .shipping-calculator-form input.input-text,
.woocommerce-cart .cart_totals .shipping-calculator-form select {
	width: 100%;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--cart-border);
	background: #fff;
}

.woocommerce-cart .cart_totals .shipping-calculator-form button {
	background: var(--cart-gold);
	color: #fff;
	border: 0;
	padding: 8px 20px;
}

/* Proceed to checkout */
.woocommerce-cart .wc-proceed-to-checkout {
	padding: 0;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 16px;
	background: var(--cart-gold);
	border: 0;
	border-radius: 0;
	color: #fff;
	font-size: 18px;
	font-weight: 400;
	text-decoration: none;
	transition: background-color 0.2s;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--cart-gold-dark);
	color: #fff;
}

/* Cross-sells, if any are set */
.woocommerce-cart .cart-collaterals .cross-sells {
	margin-bottom: 24px;
}

/* ---------- Tablet / mobile ---------- */

@media (max-width: 991px) {
	.woocommerce-cart .woocommerce:has(.woocommerce-cart-form) {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	.woocommerce-cart .cart-collaterals {
		position: static;
	}
}

@media (max-width: 767px) {
	.woocommerce-cart table.shop_table.cart,
	.woocommerce-cart table.shop_table.cart tbody {
		display: block;
		margin: 0;
	}

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

	.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
		display: grid;
		grid-template-columns: 1fr auto;
		background: var(--cart-bg);
		padding: 14px;
		margin-bottom: 12px;
	}

	.woocommerce-cart table.shop_table.cart tbody td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 6px 0;
		background: transparent;
		text-align: right;
	}

	.woocommerce-cart table.shop_table.cart td.product-thumbnail-name {
		grid-column: 1 / -1;
		padding-bottom: 10px;
	}

	.woocommerce-cart table.shop_table.cart td.product-price,
	.woocommerce-cart table.shop_table.cart td.product-quantity,
	.woocommerce-cart table.shop_table.cart td.product-subtotal {
		grid-column: 1 / -1;
		text-align: left;
	}

	.woocommerce-cart table.shop_table.cart td[data-title]::before {
		content: attr(data-title);
		font-weight: 600;
		color: var(--cart-muted);
		font-size: 14px;
	}

	.woocommerce-cart table.shop_table.cart td.product-remove {
		grid-column: 1 / -1;
		justify-content: flex-end;
		padding-top: 4px;
	}

	.woocommerce-cart .product-info-wrap .img-wrap,
	.woocommerce-cart .product-info-wrap .img-wrap img {
		flex-basis: 70px;
		width: 70px;
		height: 70px;
	}

	.woocommerce-cart .cart-collaterals .cart_totals {
		padding: 18px;
	}
}
