/**
 * Catalogue Mode — cart and checkout.
 *
 * Enqueued only when the whole cart is an enquiry.
 *
 * THIRD-PARTY SELECTORS IN THIS FILE — READ BEFORE EDITING
 * --------------------------------------------------------
 * Almost every selector below is a WooCommerce **Blocks** class name.
 * These are NOT a public API. WooCommerce restructures Blocks markup
 * between releases and is under no obligation to keep them.
 *
 * They are used because Blocks renders from the Store API and never runs
 * the woocommerce_cart_item_price / _subtotal PHP filters, so CSS is the
 * only way to suppress prices there. That is a deliberate trade, not an
 * oversight.
 *
 * When this breaks, the failure is silent: prices reappear on an enquiry
 * site, or the cart renders as a column of empty boxes. Nobody gets an
 * error. This file is the first place to look.
 *
 * Phase 4 moves this list into a compatibility layer so Phase 6's health
 * check can assert the selectors still match something.
 */

/* -- WooCommerce Blocks cart: hide price columns -------------------- */
.wc-block-cart-item__prices,
.wc-block-components-product-price,
.wc-block-components-totals-item__value,
.wc-block-components-totals-item__label,
.wc-block-components-order-summary-item__individual-prices,
.wc-block-components-totals-item {
	display: none !important;
}

/*
 * Rental price exception.
 *
 * Gated on a body class rather than emitted conditionally from PHP, so
 * this file stays static and cacheable. PHP adds jr-wca-show-rental-price
 * to <body> when the "Show Rental Price in Enquiry List" setting is on.
 *
 * The customer chose those dates and that price, so hiding it causes more
 * confusion than it prevents — but it stays opt-in.
 */
.jr-wca-show-rental-price .wc-block-cart-items__row:has( .wc-block-components-product-details ) .wc-block-cart-item__prices,
.jr-wca-show-rental-price .wc-block-cart-items__row:has( .wc-block-components-product-details ) .wc-block-components-product-price {
	display: block !important;
}

/*
 * The same exception on the checkout order summary (R24).
 *
 * This was missing, and the two surfaces contradicted each other: with the
 * setting on, the enquiry list showed the rental price and the Enquiry
 * Summary two clicks later showed nothing. The hide rule above covers both
 * surfaces — .wc-block-components-order-summary-item__individual-prices is
 * in it, and the summary row also reuses .wc-block-cart-item__prices — but
 * the exception only ever named .wc-block-cart-items__row, which exists on
 * the cart page alone.
 *
 * Rental rows are told apart exactly as on the cart, by the presence of item
 * meta. Confirmed in the browser rather than assumed: on a summary holding a
 * rental and an accessory, .wc-block-components-product-details is present
 * on the rental row and absent on the accessory.
 *
 * No third selector is needed for __individual-prices — its class list
 * includes wc-block-components-product-price, so the second line below
 * already covers it.
 */
.jr-wca-show-rental-price .wc-block-components-order-summary-item:has( .wc-block-components-product-details ) .wc-block-cart-item__prices,
.jr-wca-show-rental-price .wc-block-components-order-summary-item:has( .wc-block-components-product-details ) .wc-block-components-product-price {
	display: block !important;
}

/* -- WooCommerce Blocks checkout: hide the payment warning ---------- */
.wc-block-checkout__no-payment-methods,
.wc-block-components-notice-banner.is-error {
	display: none !important;
}

/* -- Avada classic checkout: subtotal column and totals table ------- */
.woocommerce-checkout-review-order-table th.product-total,
.woocommerce-checkout-review-order-table td.product-total,
.awb-cart-totals-table {
	display: none !important;
}

/* -- Cart and checkout chrome that makes no sense for an enquiry ---- */
#wrapper .wc-block-components-checkout-step__heading-container,
#wrapper .wc-block-checkout__terms,
#wrapper .wp-block-woocommerce-cart-order-summary-block,
#wrapper .wc-block-cart-items thead {
	display: none !important;
}

/*
 * Empty price sub-blocks in the checkout order summary.
 *
 * MUST target these specific sub-blocks, NOT the generic
 * .wc-block-components-totals-wrapper. WooCommerce wraps EVERY summary
 * section in that class, including the product line items, so hiding it
 * globally hides the products too. That regression shipped once already
 * in v1.5.10 — do not "simplify" this back into one selector.
 */
#wrapper .wp-block-woocommerce-checkout-order-summary-subtotal-block,
#wrapper .wp-block-woocommerce-checkout-order-summary-discount-block,
#wrapper .wp-block-woocommerce-checkout-order-summary-fee-block,
#wrapper .wp-block-woocommerce-checkout-order-summary-shipping-block,
#wrapper .wp-block-woocommerce-checkout-order-summary-taxes-block,
#wrapper .wp-block-woocommerce-checkout-order-summary-totals-block {
	display: none !important;
}
