/**
 * evov-sub — cart display rules
 *
 * The stylesheet half of inc/class-evov-cart-display.php. Sitewide, because the
 * rules apply on the cart page and to the slide-in cart, which opens anywhere.
 */

/* ── VAT hidden away from the checkout ───────────────────────────────────
   Evov_Cart_Display adds .evov-hide-vat to <body> when the "checkout only"
   setting is on and this is not a checkout request.

   Only the SINGLE combined row needs this. The itemised rows come from
   WC()->cart->get_tax_totals(), which is filterable and is removed in PHP;
   `tr.tax-total` is printed unconditionally by WooCommerce's cart-totals
   template, and the only hook nearby changes the amount, not the row — so
   filtering alone would leave a labelled row with an empty figure. */
body.evov-hide-vat tr.tax-total,
body.evov-hide-vat tr.tax-rate,
body.evov-hide-vat .fkcart-summary-line-item.fk-tax-rate {
	display: none !important;
}

/* ── Cart totals ─────────────────────────────────────────────────────────
   WoodMart's Cart totals widget, given the checkout order summary's
   treatment.

   Hooked rather than replaced. The widget's entire render() is a call to
   woocommerce_cart_totals(), so there is no WoodMart markup between us and
   WooCommerce's own template — which means a stylesheet reaches everything a
   bespoke widget would have had to reproduce, and none of the machinery has
   to be reproduced with it: the shipping calculator, the coupon rows, the
   fee rows, the nonce handling, and above all WooCommerce's own AJAX refresh,
   which replaces .cart_totals wholesale after every quantity change. Custom
   markup inside that container would be wiped by the first update; a
   stylesheet survives it, because the replacement re-renders the same
   template we are styling.

   The Elementor column this sits in already paints #121420 at a 10px radius
   with 30px of padding, so there is deliberately no card here — adding one
   would draw a second panel inside the first.

   Values measured off the checkout summary: 14px/700 rows, a 20px/700 total,
   and white throughout. */
.wd-cart-totals .cart_totals th,
.wd-cart-totals .cart_totals td {
	padding: 16px 0 4px;
	font-size: 14px;
	line-height: 19.6px;
	font-weight: 700;
	color: #fff;
	/* WoodMart rules every row with a 1px bottom border. The summary separates
	   the total alone, so the rest come off and one goes back on below. */
	border-bottom: 0;
}

.wd-cart-totals .cart_totals td {
	text-align: right;
}

/* The figure inherits the row rather than setting its own, so the total's
   20px below reaches the number without a second declaration. WooCommerce
   nests it in .woocommerce-Price-amount, which WoodMart paints its primary
   pink — that is why the cart total rendered pink under a white subtotal.

   The long selector is deliberate. WoodMart greys the subtotal specifically:

       .amount                                      { color: var(--wd-primary-color) }
       .cart-totals-inner table .cart-subtotal .amount { color: var(--wd-text-color) }

   That second rule is (0,3,1), so a three-class selector of ours loses to it
   and only the total would have taken the inherit — which is exactly what the
   first pass produced: a white total over a grey subtotal. Naming
   .cart-totals-inner and the table takes this to (0,4,1) and settles it on
   specificity rather than on which stylesheet loads last. */
.wd-cart-totals .cart_totals .cart-totals-inner table .woocommerce-Price-amount,
.wd-cart-totals .cart_totals .cart-totals-inner table .amount {
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	color: inherit;
}

/* The total: separated by a rule, and the one row that changes size. */
.wd-cart-totals .cart_totals .order-total th,
.wd-cart-totals .cart_totals .order-total td {
	padding: 16px 0 0;
	border-top: 1px solid rgba(255, 255, 255, .15);
	font-size: 20px;
	line-height: 20px;
}

/* ── the deferred-charges line ──
   Printed by Evov_Cart_Display::deferred_note(). Sized and coloured like the
   card's item-type row, so the two quiet lines on this page agree. */
.wd-cart-totals .cart_totals .evov-cart-totals-note td {
	padding: 8px 0 0;
	border-top: 0;
	font-size: 12px;
	line-height: 16.8px;
	font-weight: 400;
	color: rgba(255, 255, 255, .45);
	text-align: left;
}
