/*
 * Add Busy Bee style fixes here.
 * Keep these rules scoped and CSS-only so plugin updates do not overwrite them.
 */

/* Checkout: the jc-woocommerce-donation tip prompt normally provides the gap
 * below the header. When a tip is already in the cart the plugin skips that
 * block entirely, so restore the gap only when the block is absent. */
body.woocommerce-checkout div.woocommerce:not(:has(#jcwd-woocommerce-info)) {
	padding-top: 2.5rem;
}

/* Checkout order review: Elementor Pro's generated widget CSS
 * (custom-pro-widget-woocommerce-checkout-page.min.css) caps the
 * shipping-options cell at max-width:70px, which squeezes the pickup/delivery
 * radio labels into one-word-per-line columns on phones. The cap serves no
 * purpose for long option labels, so lift it at every size. */
body.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .woocommerce-shipping-totals td {
	max-width: none;
}

/* Same Elementor CSS caps the product-name cell at 150px. Keep that on
 * desktop (narrow order sidebar) but lift it on phones, where the order
 * box is full-width and names can breathe. */
@media (max-width: 767px) {
	body.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .woocommerce-checkout-review-order-table .cart_item td.product-name {
		max-width: none;
	}
}

/* Checkout order-review totals on phones: un-table the tfoot so the
 * Delivery row can span the full table width (percentages inside a table
 * keep resolving against the column otherwise). Normal totals rows become
 * flex rows (label left, amount right — same look as the table gave), and
 * the shipping row stacks: "Delivery" heading on top, options full-width
 * below. The !importants beat theme cell-border rules of higher
 * specificity; the divider moves from the cells to the row so it stays
 * one full-width line. */
@media (max-width: 767px) {
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot {
		display: block;
		width: 100%;
	}
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr {
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 1em;
		border-bottom: 1px solid rgb(238, 238, 238) !important;
	}
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr th,
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr td {
		border-bottom: none !important;
	}
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals {
		display: block;
	}
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals th,
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals td {
		display: block;
		width: 100%;
		text-align: left;
		padding-left: 0;
		padding-right: 0;
	}
	body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr.woocommerce-shipping-totals td {
		padding-top: 0.25em;
	}
	body.woocommerce-checkout ul#shipping_method li {
		display: flex;
		align-items: baseline;
		gap: 0.5em;
		margin-bottom: 0.75em;
	}
	body.woocommerce-checkout ul#shipping_method li input.shipping_method {
		flex: 0 0 auto;
	}
	body.woocommerce-checkout ul#shipping_method li label {
		flex: 1 1 auto;
		margin: 0;
	}
}
