/**
 * RHT Order Confirmation Tidy — Cart, Checkout & Mini-cart polish
 * Scoped to cart/checkout/mini-cart so it cannot leak elsewhere.
 * Matches the visual language of the Thank You / View Order page.
 */

/* =========================================================================
   Shared product meta formatting
   Used in cart, checkout, mini-cart and order review contexts.

   WooCommerce cart / checkout renders variation meta as a definition list:
     <dl class="variation">
       <dt>Label:</dt>
       <dd><p>Value</p></dd>
       ...
     </dl>
   We use CSS grid on the <dl> to align labels and values into two columns
   cleanly, regardless of how much whitespace is in the source markup.
   ========================================================================= */

.woocommerce-cart-form .product-name dl.variation,
.woocommerce-checkout-review-order-table .product-name dl.variation,
.woocommerce-mini-cart .mini_cart_item dl.variation {
	display: grid;
	grid-template-columns: max-content 1fr;
	column-gap: 0.75em;
	row-gap: 0.2em;
	margin: 0.5em 0 0;
	padding: 0;
	font-size: 0.9em;
	line-height: 1.5;
}

.woocommerce-cart-form .product-name dl.variation dt,
.woocommerce-checkout-review-order-table .product-name dl.variation dt,
.woocommerce-mini-cart .mini_cart_item dl.variation dt {
	grid-column: 1;
	margin: 0;
	padding: 0;
	font-weight: 600;
	color: #4b5563;
	white-space: nowrap;
}

.woocommerce-cart-form .product-name dl.variation dd,
.woocommerce-checkout-review-order-table .product-name dl.variation dd,
.woocommerce-mini-cart .mini_cart_item dl.variation dd {
	grid-column: 2;
	margin: 0;
	padding: 0;
	color: #111827;
}

/* Flatten the inner <p> wrapper WooCommerce emits inside each <dd>. */
.woocommerce-cart-form .product-name dl.variation dd p,
.woocommerce-checkout-review-order-table .product-name dl.variation dd p,
.woocommerce-mini-cart .mini_cart_item dl.variation dd p {
	display: inline;
	margin: 0;
	padding: 0;
}

/* Hide the broken empty-label variation row (class ends with "variation-"
   because there's nothing after the dash) and its matching value. This
   suppresses the stray ": 12 Tonne" line caused by a PEWC field with no
   label. Scoped tightly so it can't hit any legitimate meta. */
.woocommerce-cart-form .product-name dl.variation dt.variation-,
.woocommerce-cart-form .product-name dl.variation dt.variation- + dd,
.woocommerce-checkout-review-order-table .product-name dl.variation dt.variation-,
.woocommerce-checkout-review-order-table .product-name dl.variation dt.variation- + dd,
.woocommerce-mini-cart .mini_cart_item dl.variation dt.variation-,
.woocommerce-mini-cart .mini_cart_item dl.variation dt.variation- + dd {
	display: none !important;
}

/* Custom SKU meta block used on the site — style it consistently. */
.woocommerce-cart-form .product-name .rht-pewc-sku-order-meta,
.woocommerce-checkout-review-order-table .product-name .rht-pewc-sku-order-meta {
	margin-top: 0.5em;
	font-size: 0.9em;
	color: #6b7280;
	line-height: 1.55;
}

.woocommerce-cart-form .product-name .rht-pewc-sku-order-meta strong,
.woocommerce-checkout-review-order-table .product-name .rht-pewc-sku-order-meta strong {
	display: inline-block;
	min-width: 8.5em;
	font-weight: 600;
	color: #4b5563;
}

/* =========================================================================
   Cart / Basket page
   ========================================================================= */

.woocommerce-cart .woocommerce-cart-form {
	margin-bottom: 2em;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents thead th {
	background: #f9fafb;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	color: #4b5563;
	padding: 1em 1.25em;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents tbody td {
	padding: 1.25em;
	vertical-align: middle;
	border-bottom: 1px solid #f1f2f4;
	background: #fff;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents tbody tr:last-child td {
	border-bottom: none;
}

/* Smaller product images for a cleaner look */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-thumbnail {
	width: 90px;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-thumbnail img {
	width: 72px;
	height: 72px;
	max-width: 72px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	display: block;
}

/* Product name link */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-name > a {
	font-weight: 600;
	font-size: 1.05em;
	text-decoration: none;
	color: #111827;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-name > a:hover {
	text-decoration: underline;
}

/* Remove item (×) button — make it a subtle circle */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-remove {
	width: 48px;
	text-align: center;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f3f4f6;
	color: #6b7280 !important;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-remove a.remove:hover {
	background: #fee2e2;
	color: #b91c1c !important;
}

/* Price and subtotal columns — tabular figures */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-price,
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-subtotal {
	font-variant-numeric: tabular-nums;
	color: #111827;
	font-weight: 500;
}

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

/* Quantity input */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-quantity .qty {
	width: 64px;
	padding: 0.5em;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* Coupon / Update basket row */
.woocommerce-cart .shop_table.woocommerce-cart-form__contents .actions {
	padding: 1em 1.25em;
	background: #f9fafb;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .coupon {
	display: flex;
	gap: 0.5em;
	align-items: center;
	flex-wrap: wrap;
}

.woocommerce-cart .shop_table.woocommerce-cart-form__contents .coupon .input-text {
	flex: 1 1 auto;
	min-width: 180px;
	padding: 0.6em 0.9em;
	border: 1px solid #d1d5db;
	border-radius: 6px;
}

/* Basket totals panel */
.woocommerce-cart .cart_totals {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.woocommerce-cart .cart_totals > h2 {
	margin: 0;
	padding: 1em 1.25em;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	font-size: 1.15em;
	font-weight: 600;
	color: #111827;
}

.woocommerce-cart .cart_totals .shop_table {
	width: 100%;
	border: none;
	margin: 0;
}

.woocommerce-cart .cart_totals .shop_table th,
.woocommerce-cart .cart_totals .shop_table td {
	padding: 0.95em 1.25em;
	border-bottom: 1px solid #f1f2f4;
	background: #fff;
}

.woocommerce-cart .cart_totals .shop_table th {
	font-weight: 500;
	color: #4b5563;
	text-align: left;
	width: 45%;
}

.woocommerce-cart .cart_totals .shop_table td {
	color: #111827;
	font-variant-numeric: tabular-nums;
}

.woocommerce-cart .cart_totals .shop_table .order-total th,
.woocommerce-cart .cart_totals .shop_table .order-total td {
	background: #f9fafb;
	font-weight: 700;
	font-size: 1.1em;
	border-top: 2px solid #e5e7eb;
	border-bottom: none;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
	padding: 1.25em;
	background: #f9fafb;
	border-top: 1px solid #e5e7eb;
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout .checkout-button {
	display: block;
	text-align: center;
	padding: 0.9em 1.25em;
	border-radius: 6px;
	font-weight: 600;
}

/* =========================================================================
   Checkout "Your order" review table
   ========================================================================= */

.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-checkout-review-order h3 {
	font-size: 1.25em;
	font-weight: 600;
	margin-bottom: 0.75em;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.woocommerce-checkout .woocommerce-checkout-review-order-table thead th {
	background: #f9fafb;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	color: #4b5563;
	padding: 1em 1.25em;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tbody td,
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody th {
	padding: 1em 1.25em;
	vertical-align: top;
	border-bottom: 1px solid #f1f2f4;
	background: #fff;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name {
	line-height: 1.55;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name > strong.product-quantity {
	display: inline-block;
	margin-left: 0.35em;
	padding: 0.1em 0.5em;
	background: #f3f4f6;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: 600;
	color: #374151;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td {
	padding: 0.9em 1.25em;
	border-bottom: 1px solid #f1f2f4;
	background: #fcfcfd;
	font-variant-numeric: tabular-nums;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th {
	font-weight: 500;
	color: #4b5563;
	text-align: left;
	width: 45%;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total td {
	background: #f9fafb;
	font-weight: 700;
	font-size: 1.1em;
	border-top: 2px solid #e5e7eb;
	border-bottom: none;
}

/* Shipping method list inside the review table */
.woocommerce-checkout .woocommerce-checkout-review-order-table .shipping ul#shipping_method {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .shipping ul#shipping_method li {
	margin: 0 0 0.5em;
	padding: 0;
	line-height: 1.5;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .shipping ul#shipping_method li:last-child {
	margin-bottom: 0;
}

.woocommerce-checkout .woocommerce-checkout-review-order-table .shipping ul#shipping_method li label {
	margin-left: 0.35em;
}

/* =========================================================================
   Mini-cart widget (header dropdown / sidebar)
   ========================================================================= */

.woocommerce-mini-cart {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-mini-cart .mini_cart_item {
	display: flex;
	align-items: flex-start;
	gap: 0.85em;
	padding: 0.9em 0;
	border-bottom: 1px solid #f1f2f4;
	position: relative;
}

.woocommerce-mini-cart .mini_cart_item:last-child {
	border-bottom: none;
}

.woocommerce-mini-cart .mini_cart_item a.remove {
	position: static;
	order: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #f3f4f6;
	color: #6b7280 !important;
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	flex-shrink: 0;
}

.woocommerce-mini-cart .mini_cart_item a.remove:hover {
	background: #fee2e2;
	color: #b91c1c !important;
}

.woocommerce-mini-cart .mini_cart_item > a:not(.remove) {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	flex: 1 1 auto;
	text-decoration: none;
	color: #111827;
	font-weight: 600;
	font-size: 0.95em;
	line-height: 1.4;
}

.woocommerce-mini-cart .mini_cart_item img {
	width: 56px;
	height: 56px;
	max-width: 56px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
	flex-shrink: 0;
	margin: 0;
	float: none;
}

.woocommerce-mini-cart .mini_cart_item .quantity {
	display: block;
	margin-top: 0.25em;
	font-size: 0.88em;
	font-weight: 500;
	color: #6b7280;
	font-variant-numeric: tabular-nums;
}

.woocommerce-mini-cart__total,
.widget_shopping_cart .total {
	padding: 0.9em 0;
	margin: 0.5em 0;
	border-top: 2px solid #e5e7eb;
	border-bottom: 1px solid #f1f2f4;
	font-size: 1.05em;
	color: #111827;
	font-variant-numeric: tabular-nums;
}

.woocommerce-mini-cart__buttons,
.widget_shopping_cart .buttons {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	margin: 1em 0 0;
	padding: 0;
}

.woocommerce-mini-cart__buttons .button,
.widget_shopping_cart .buttons .button {
	display: block;
	text-align: center;
	padding: 0.7em 1em;
	border-radius: 6px;
	font-weight: 600;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 600px) {

	.woocommerce-cart .shop_table.woocommerce-cart-form__contents thead th,
	.woocommerce-cart .shop_table.woocommerce-cart-form__contents tbody td,
	.woocommerce-checkout .woocommerce-checkout-review-order-table thead th,
	.woocommerce-checkout .woocommerce-checkout-review-order-table tbody td,
	.woocommerce-checkout .woocommerce-checkout-review-order-table tbody th,
	.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th,
	.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td,
	.woocommerce-cart .cart_totals .shop_table th,
	.woocommerce-cart .cart_totals .shop_table td {
		padding: 0.85em 0.9em;
	}

	.woocommerce-cart-form .product-name dl.variation,
	.woocommerce-checkout-review-order-table .product-name dl.variation {
		column-gap: 0.5em;
	}

	.woocommerce-cart-form .product-name .rht-pewc-sku-order-meta strong,
	.woocommerce-checkout-review-order-table .product-name .rht-pewc-sku-order-meta strong {
		min-width: 7em;
	}

	.woocommerce-cart .shop_table.woocommerce-cart-form__contents .product-thumbnail img {
		width: 60px;
		height: 60px;
		max-width: 60px;
	}
}
