/**
 * trc-cart.css — Transporter Cart Page (Mobbin-grade rebuild)
 * ---------------------------------------------------------------------------
 * A standalone stylesheet for the classic WooCommerce cart page. It:
 *   1. Neutralises ALL default WooCommerce / theme table styling (borders,
 *      backgrounds, responsive data-title labels, floated totals).
 *   2. Restyles the cart <table> as a clean, borderless block/grid LIST.
 *   3. Lays out a modern two-column grid: items (left) + sticky Order Summary
 *      card (right); stacks to one column on <=768px.
 *
 * Loads AFTER the global CSS, so a handful of resets use !important purely to
 * beat WooCommerce core / Woodmart high-specificity rules.
 *
 * Brand tokens (no new colours/fonts are invented):
 *   Red CTA        #C62D3C  (hover #A52330)
 *   Dark button    #1a1a1a  (hover #000)
 *   Outline        1.5px #e2e2e2, text #1a1a1a, hover border+text #C62D3C
 *   Text           #1a1a1a primary / #7a7a7a muted
 *   Separators     #eee / #f2f2f2 / #f0f0f0
 *   Body font      var(--tr-font-ka)      FiraGO — weight 400/500/600, NEVER 700
 *   Display/price  var(--tr-font-display) Bebas
 * ---------------------------------------------------------------------------
 */

/* Local fallbacks so the file is self-contained; global tokens win when set. */
.trc-cartpage {
	--trc-c-red: #C62D3C;
	--trc-c-red-dark: #A52330;
	--trc-c-ink: #1a1a1a;
	--trc-c-ink-2: #7a7a7a;
	--trc-c-line: #eee;
	--trc-c-line-2: #f2f2f2;
	--trc-c-line-3: #f0f0f0;
	--trc-c-surface: #fff;
	--trc-c-thumb-bg: #fafafa;
	--trc-font-body: var(--tr-font-ka, "FiraGO", "Noto Sans Georgian", sans-serif);
	--trc-font-display: var(--tr-font-display, Bebas, "Gilroy Geo", sans-serif);
}

/* ═══════════════════════════════════════════════════════════
   1. Page container
   ═══════════════════════════════════════════════════════════ */
.trc-cartpage {
	max-width: var(--tr-container, 1560px);
	margin: 0 auto;
	padding: 36px 24px 72px;
	font-family: var(--trc-font-body);
	color: var(--trc-c-ink);
	box-sizing: border-box;
}
.trc-cartpage *,
.trc-cartpage *::before,
.trc-cartpage *::after { box-sizing: border-box; }

/* WooCommerce notices — keep them on-brand and unobtrusive. */
.trc-cartpage .woocommerce-message,
.trc-cartpage .woocommerce-info,
.trc-cartpage .woocommerce-error {
	font-family: var(--trc-font-body);
	font-size: 14px;
	border-radius: 10px;
	border: 1px solid var(--trc-c-line);
	border-left-width: 3px;
	background: var(--trc-c-thumb-bg);
	margin: 0 0 22px;
}
.trc-cartpage .woocommerce-message { border-left-color: var(--trc-c-red); }
.trc-cartpage .woocommerce-error { border-left-color: var(--trc-c-red); }

/* ═══════════════════════════════════════════════════════════
   2. Two-column layout
   ═══════════════════════════════════════════════════════════ */
.trc-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
	gap: 40px;
	align-items: start;
}
.trc-cart__main { min-width: 0; }

.trc-cart__aside {
	position: sticky;
	top: 100px;
	min-width: 0;
}

/* ═══════════════════════════════════════════════════════════
   3. Free-shipping progress bar
   ═══════════════════════════════════════════════════════════ */
.trc-cart-freeship {
	background: var(--trc-c-thumb-bg);
	border: 1px solid var(--trc-c-line);
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 24px;
}
.trc-cart-freeship__text {
	margin: 0 0 11px;
	font-family: var(--trc-font-body);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.4;
	color: #4a4a4a;
}
.trc-cart-freeship__text .woocommerce-Price-amount { font-weight: 600; color: var(--trc-c-red); }
.trc-cart-freeship__track {
	height: 8px;
	border-radius: 999px;
	background: #ececec;
	overflow: hidden;
}
.trc-cart-freeship__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--trc-c-red);
	transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.trc-cart-freeship.is-complete .trc-cart-freeship__text { color: var(--trc-c-ink); }

/* ═══════════════════════════════════════════════════════════
   4. Neutralise default WooCommerce / theme table styling
   ═══════════════════════════════════════════════════════════ */
.trc-cartpage table.shop_table,
.trc-cartpage table.cart,
.trc-cartpage .cart_totals table {
	border: 0 !important;
	border-collapse: collapse !important;
	border-radius: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	width: 100%;
}
.trc-cartpage table.shop_table th,
.trc-cartpage table.shop_table td,
.trc-cartpage table.cart th,
.trc-cartpage table.cart td {
	border: 0 !important;
	background: transparent !important;
}
/* Kill the responsive "data-title" pseudo labels — this layout supplies its own. */
.trc-cart-table td::before,
.trc-cart-totals__table td::before,
.trc-cart-totals__table th::before {
	content: none !important;
	display: none !important;
}
/* WooCommerce floats .cart_totals to the right at ~48% — we own the column. */
.trc-cart__aside .cart_totals {
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   5. Item list — table restyled to a block/grid list
   ═══════════════════════════════════════════════════════════ */
.trc-cart-table,
.trc-cart-table tbody { display: block; width: 100%; }
.trc-cart-table thead { display: none; }
.trc-cart-table tr { display: block; }
.trc-cart-table td { display: block; padding: 0; }

/* One product row = a grid; thumb / qty / subtotal / remove span both text rows. */
.trc-cart-table tbody tr.woocommerce-cart-form__cart-item {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr) auto minmax(96px, auto) 40px;
	grid-template-areas:
		"thumb name  qty subtotal remove"
		"thumb price qty subtotal remove";
	column-gap: 22px;
	row-gap: 2px;
	align-items: center;
	padding: 24px 0;
	border-bottom: 1px solid var(--trc-c-line-3);
}
.trc-cart-table tbody tr.woocommerce-cart-form__cart-item:first-child { padding-top: 8px; }

/* display:block !important beats WooCommerce's woocommerce-smallscreen.css, which
   hides .product-thumbnail on small screens — we keep the thumbnail at all widths. */
.trc-cart-table .product-thumbnail  { grid-area: thumb; display: block !important; }
.trc-cart-table .product-name       { grid-area: name; align-self: end; }
.trc-cart-table .product-price      { grid-area: price; align-self: start; }
.trc-cart-table .product-quantity   { grid-area: qty; }
.trc-cart-table .product-subtotal   { grid-area: subtotal; text-align: right; }
.trc-cart-table .product-remove     { grid-area: remove; text-align: right; }

/* Thumbnail */
.trc-cart-table .product-thumbnail a,
.trc-cart-table .product-thumbnail img {
	display: block;
	/* !important beats WooCommerce core's `.woocommerce-cart table.cart img
	   {width:32px}` (specificity 0,2,2), which otherwise shrinks the thumbnail. */
	width: 92px !important;
	height: 92px !important;
}
.trc-cart-table .product-thumbnail img {
	object-fit: contain;
	background: var(--trc-c-thumb-bg);
	border: 1px solid var(--trc-c-line);
	border-radius: 10px;
	padding: 7px;
}

/* Title */
.trc-cart-table .product-name,
.trc-cart-table .product-name a {
	font-family: var(--trc-font-body);
	font-weight: 400;              /* regular — NEVER 700 on FiraGO */
	font-size: 15px;
	line-height: 1.4;
	color: var(--trc-c-ink);
	text-decoration: none;
}
.trc-cart-table .product-name a:hover { color: var(--trc-c-red); }
.trc-cart-table .product-name .variation,
.trc-cart-table .product-name .wc-item-meta {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: var(--trc-c-ink-2);
	list-style: none;
	padding: 0;
}
.trc-cart-table .product-name .backorder_notification {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--trc-c-ink-2);
}

/* Unit price (muted) */
.trc-cart-table .product-price,
.trc-cart-table .product-price .woocommerce-Price-amount {
	font-family: var(--trc-font-body);
	font-weight: 500;
	font-size: 13.5px;
	color: var(--trc-c-ink-2);
}

/* Line subtotal (display font, emphasised) */
.trc-cart-table .product-subtotal,
.trc-cart-table .product-subtotal .woocommerce-Price-amount {
	font-family: var(--trc-font-display);
	font-size: 19px;
	letter-spacing: .3px;
	color: var(--trc-c-ink);
}

/* ── Quantity stepper ── */
.trc-cart-table .product-quantity .quantity {
	display: inline-flex;
	align-items: center;
	height: 42px;
	border: 1.5px solid #e2e2e2;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
.trc-cart-table .product-quantity .quantity .trc-qty-btn {
	width: 38px;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--trc-c-ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .18s ease, color .18s ease;
	-webkit-tap-highlight-color: transparent;
}
.trc-cart-table .product-quantity .quantity .trc-qty-btn:hover { background: #f6f6f6; color: var(--trc-c-red); }
.trc-cart-table .product-quantity .quantity .trc-qty-btn:active { background: #efefef; }

.trc-cart-table .product-quantity .quantity input.qty {
	width: 46px;
	height: 100%;
	border: 0;
	border-left: 1px solid #ededed;
	border-right: 1px solid #ededed;
	background: transparent;
	text-align: center;
	font-family: var(--trc-font-display);
	font-size: 16px;
	color: var(--trc-c-ink);
	-moz-appearance: textfield;
	appearance: textfield;
	padding: 0;
}
.trc-cart-table .product-quantity .quantity input.qty:focus { outline: none; }
.trc-cart-table .product-quantity .quantity input.qty::-webkit-outer-spin-button,
.trc-cart-table .product-quantity .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
/* Fallback before the stepper JS upgrades the field. */
.trc-cart-table .product-quantity .quantity:not(.trc-qty-ready) input.qty {
	width: 64px;
	border-left: 0;
	border-right: 0;
}

/* ── Remove (minimal ✕) ── */
.trc-cart-table .product-remove .remove {
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: transparent !important;
	color: #b5b5b5 !important;
	font-size: 22px;
	line-height: 1;
	text-decoration: none;
	transition: background .18s ease, color .18s ease;
}
.trc-cart-table .product-remove .remove:hover {
	background: #faf0f1 !important;
	color: var(--trc-c-red) !important;
}

/* ═══════════════════════════════════════════════════════════
   6. Actions row — coupon + update
   ═══════════════════════════════════════════════════════════ */
.trc-cart-table td.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 26px 0 4px;
	margin: 0;
}
.trc-cart-table td.actions .coupon {
	display: flex;
	gap: 10px;
	flex: 1 1 340px;
	max-width: 440px;
}
.trc-cart-table td.actions #coupon_code {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	border: 1.5px solid #e2e2e2;
	border-radius: 8px;
	padding: 0 16px;
	font-family: var(--trc-font-body);
	font-size: 14px;
	color: var(--trc-c-ink);
	background: #fff;
	transition: border-color .18s ease;
}
.trc-cart-table td.actions #coupon_code::placeholder { color: #a8a8a8; }
.trc-cart-table td.actions #coupon_code:focus { outline: none; border-color: var(--trc-c-ink); }

/* Apply coupon = dark button */
.trc-cart-table td.actions .trc-coupon-btn,
.trc-cartpage .trc-cart-table td.actions button.trc-coupon-btn {
	height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: 8px;
	background: var(--trc-c-ink);
	color: #fff;
	font-family: var(--trc-font-body);
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: background .18s ease;
}
.trc-cart-table td.actions .trc-coupon-btn:hover { background: #000; color: #fff; }

/* Update cart = outline button (auto-update usually fires; this is the fallback) */
.trc-cart-table td.actions .trc-update-cart,
.trc-cartpage .trc-cart-table td.actions button.trc-update-cart {
	height: 48px;
	padding: 0 22px;
	margin-left: auto;
	border: 1.5px solid #e2e2e2;
	border-radius: 8px;
	background: #fff;
	color: var(--trc-c-ink);
	font-family: var(--trc-font-body);
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color .18s ease, color .18s ease;
}
.trc-cart-table td.actions .trc-update-cart:hover { border-color: var(--trc-c-red); color: var(--trc-c-red); }
.trc-cart-table td.actions .trc-update-cart:disabled { opacity: .45; cursor: default; }
.trc-cart-table td.actions .trc-update-cart:disabled:hover { border-color: #e2e2e2; color: var(--trc-c-ink); }

/* ═══════════════════════════════════════════════════════════
   7. Order Summary card (cart-totals.php)
   ═══════════════════════════════════════════════════════════ */
.trc-cart__aside .cart_totals {
	background: var(--trc-c-surface);
	border: 1px solid var(--trc-c-line);
	border-radius: 12px;
	padding: 26px 24px;
}
.trc-cart-totals__title {
	margin: 0 0 18px;
	font-family: var(--trc-font-display);
	font-size: 25px;
	line-height: 1.1;
	letter-spacing: .5px;
	color: var(--trc-c-ink);
}

.trc-cart-totals__table,
.trc-cart-totals__table tbody { display: block; width: 100%; }
.trc-cart-totals__table tr {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 13px 0;
	border-bottom: 1px solid var(--trc-c-line-2);
}
.trc-cart-totals__table th {
	font-family: var(--trc-font-body);
	font-weight: 500;
	font-size: 14px;
	color: var(--trc-c-ink-2);
	text-align: left;
	padding: 0;
	margin: 0;
}
.trc-cart-totals__table td {
	font-family: var(--trc-font-display);
	font-size: 18px;
	letter-spacing: .3px;
	color: var(--trc-c-ink);
	text-align: right;
	padding: 0;
	margin: 0;
	white-space: nowrap;
}
.trc-cart-totals__table .cart-discount td { color: var(--trc-c-red); }
.trc-cart-totals__table .cart-discount td a {
	display: block;
	font-family: var(--trc-font-body);
	font-size: 11.5px;
	font-weight: 500;
	color: var(--trc-c-ink-2);
	text-decoration: none;
}
.trc-cart-totals__table .cart-discount td a:hover { color: var(--trc-c-red); }

/* Order total — the emphasis row */
.trc-cart-totals__table .order-total {
	border-bottom: 0;
	border-top: 1px solid var(--trc-c-line);
	margin-top: 4px;
	padding-top: 17px;
}
.trc-cart-totals__table .order-total th {
	font-weight: 600;
	font-size: 15px;
	color: var(--trc-c-ink);
}
.trc-cart-totals__table .order-total td {
	font-size: 26px;
	color: var(--trc-c-red);
}
.trc-cart-totals__table .order-total td small { font-size: 11px; color: var(--trc-c-ink-2); }

/* ── Checkout button (prominent red) ── */
.trc-cart__aside .wc-proceed-to-checkout { margin-top: 22px; padding: 0; }
.trc-cartpage .trc-cart__aside a.trc-checkout-btn,
.trc-cart__aside .trc-checkout-btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	padding: 0 20px;
	border: 0;
	border-radius: 8px;
	background: var(--trc-c-red);
	color: #fff;
	font-family: var(--trc-font-body);
	font-weight: 600;
	font-size: 15px;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	transition: background .2s ease, transform .12s ease;
}
.trc-cart__aside .trc-checkout-btn:hover { background: var(--trc-c-red-dark); color: #fff; }
.trc-cart__aside .trc-checkout-btn:active { transform: translateY(1px); }

/* ═══════════════════════════════════════════════════════════
   8. Cross-sells
   ═══════════════════════════════════════════════════════════ */
.trc-cart-crosssells { margin-top: 64px; }
.trc-cart-crosssells__title {
	margin: 0 0 24px;
	font-family: var(--trc-font-display);
	font-size: 30px;
	line-height: 1.1;
	letter-spacing: .5px;
	color: var(--trc-c-ink);
}
/* Grid columns come from the shop-archive card CSS; only guarantee spacing here. */
.trc-cart-crosssells__grid { margin: 0; }

/* ═══════════════════════════════════════════════════════════
   9. Accessibility helpers
   ═══════════════════════════════════════════════════════════ */
.trc-cartpage .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}
.trc-cart-table .product-quantity .quantity .trc-qty-btn:focus-visible,
.trc-cart-table .product-remove .remove:focus-visible,
.trc-cart-table td.actions button:focus-visible,
.trc-cart-table td.actions #coupon_code:focus-visible,
.trc-cart__aside .trc-checkout-btn:focus-visible {
	outline: 2px solid var(--trc-c-red);
	outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   10. Responsive
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
	.trc-cart { gap: 32px; }
}

/* Tablet: two narrow columns would crush the product title, so the page
   collapses to a single column here — the item row then keeps its full-width
   desktop layout and the summary drops below the items (static, not sticky). */
@media (max-width: 900px) {
	.trc-cart {
		grid-template-columns: 1fr;
		gap: 30px;
	}
	.trc-cart__aside {
		position: static;
		top: auto;
	}
}

/* Mobile: stack the product row for touch; summary is already static. */
@media (max-width: 768px) {
	.trc-cartpage { padding: 22px 16px 56px; }

	.trc-cart { gap: 28px; }

	/* Product row: thumb on the left, details stacked, controls on their own row.
	   Col 3 is `auto` so the line subtotal (and the remove ✕) get content width. */
	.trc-cart-table tbody tr.woocommerce-cart-form__cart-item {
		grid-template-columns: 76px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb name     remove"
			"thumb price    price"
			"thumb qty      subtotal";
		column-gap: 14px;
		row-gap: 8px;
		padding: 20px 0;
		align-items: center;
	}
	.trc-cart-table .product-name    { align-self: start; }
	.trc-cart-table .product-price   { align-self: start; }
	.trc-cart-table .product-quantity { align-self: center; }
	.trc-cart-table .product-subtotal {
		align-self: center;
		text-align: right !important;
	}
	/* Thumbnail top-aligned with the title (not centered in its 3-row span). */
	.trc-cart-table .product-thumbnail { align-self: start !important; }
	/* WooCommerce smallscreen.css forces td { text-align:right } on phones —
	   restore left alignment for the text cells (subtotal stays right, above). */
	.trc-cart-table .product-name,
	.trc-cart-table .product-name a,
	.trc-cart-table .product-price,
	.trc-cart-table .product-quantity { text-align: left !important; }
	.trc-cart-table .product-remove  { align-self: start; }

	.trc-cart-table .product-thumbnail a,
	.trc-cart-table .product-thumbnail img { width: 76px !important; height: 76px !important; }

	/* Comfortable touch targets (>=40px). */
	.trc-cart-table .product-quantity .quantity { height: 44px; }
	.trc-cart-table .product-quantity .quantity .trc-qty-btn { width: 44px; }
	.trc-cart-table .product-quantity .quantity input.qty { width: 44px; }

	/* Actions: full-width stacked controls. */
	.trc-cart-table td.actions {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		padding-top: 22px;
	}
	.trc-cart-table td.actions .coupon { flex: 1 1 auto; max-width: none; }
	.trc-cart-table td.actions .trc-coupon-btn { padding: 0 18px; }
	.trc-cart-table td.actions .trc-update-cart { margin-left: 0; width: 100%; }

	.trc-cart-crosssells { margin-top: 44px; }
	.trc-cart-crosssells__title { font-size: 24px; }
}

@media (max-width: 400px) {
	.trc-cart-table tbody tr.woocommerce-cart-form__cart-item {
		grid-template-columns: 68px minmax(0, 1fr) auto;
		column-gap: 12px;
	}
	.trc-cart-table .product-thumbnail a,
	.trc-cart-table .product-thumbnail img { width: 68px !important; height: 68px !important; }
	.trc-cart-table td.actions .coupon { flex-direction: column; }
	.trc-cart-table td.actions .trc-coupon-btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   11. Motion preferences
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
	.trc-cart-freeship__fill,
	.trc-cart__aside .trc-checkout-btn,
	.trc-cart-table .product-quantity .quantity .trc-qty-btn,
	.trc-cart-table .product-remove .remove { transition: none; }
}
