/**
 * Under-price freight callout (W595).
 *
 * Renders in the .second-freeshipping-text slot between the price and the CTA
 * on products tagged no-free-shipping. It has to read as loudly as the
 * "FREE SHIPPING & NO TAX" line it replaces, because it is correcting an
 * expectation the rest of the site sets.
 *
 * ONE card, two rows, one hairline between them. Earlier passes made the two
 * facts separate floating boxes, which read as clutter, and put Zero Tax in a
 * pill, which made good news look like a second warning. The rows share their
 * geometry so the block reads as one answer to "what does this price cover".
 * Only the shipping row is tinted, because only it is a correction.
 *
 * Enqueued only on product pages whose product is tagged no-free-shipping,
 * so it costs nothing on the rest of the catalog.
 *
 * ONE live dated file. On a content change, git mv it to a new date and
 * repoint the enqueue in product-page-customizations.php -- Cloudflare pins
 * max-age=1y on CSS and often strips the query version, so a ?ver bump alone
 * cannot bust the edge copy.
 */

.hdm-freight-callout {
	margin: 12px 0 0;
	border: 1px solid #e3dcd6;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	text-align: left;
}

.hdm-freight-callout__row {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 12px 14px;
}

.hdm-freight-callout__row--ship {
	background: #fdf3f0;
	color: #8a2718;
}

.hdm-freight-callout__row--tax {
	border-top: 1px solid #e3dcd6;
	color: #146036;
}

.hdm-freight-callout__icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	margin-top: 1px;
}

.hdm-freight-callout__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.hdm-freight-callout__head {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.25;
	color: inherit;
}

.hdm-freight-callout__sub {
	font-weight: 500;
	font-size: 12.5px;
	line-height: 1.35;
	color: #756c66;
}

.hdm-freight-callout__row--tax .hdm-freight-callout__sub {
	color: #5f7268;
}

/* The summary column right-aligns its banner text on desktop; this is a card,
   so keep it left-read and let it fill the column instead. */
@media (min-width: 769px) {
	.summary.entry-summary .hdm-freight-callout,
	.summary.entry-summary .hdm-freight-callout__row {
		text-align: left;
	}
}

@media (max-width: 480px) {
	.hdm-freight-callout__row {
		padding: 11px 12px;
		gap: 10px;
	}

	.hdm-freight-callout__head {
		font-size: 14px;
	}

	.hdm-freight-callout__sub {
		font-size: 12px;
	}

	.hdm-freight-callout__icon {
		width: 22px;
		height: 22px;
	}
}

/* ---------------------------------------------------------------------------
 * Desktop: span the callout across both summary columns.
 *
 * The buy box is a two-column flex row. Squeezed into the 40% price column the
 * callout stood 179px tall, which made the right column much taller than the
 * left and opened a dead area under the stock and brand boxes.
 *
 * .summary-right becomes display:contents so its price, callout and CTA are
 * grid items of .summary itself. The callout then spans both columns as one
 * short band with its two facts side by side, and the CTA goes full width
 * under it. Reading order stays price, then what the price does not cover,
 * then the call.
 *
 * Rows 2 to 5 are left free for anything else hooked onto woo_summary_right
 * (the premium Pony savings strip), so it stays stacked under the price. Row 5
 * takes the 1fr, which is what keeps that stack tight at the top instead of
 * spreading to fill the taller left column.
 *
 * Double-guarded on body classes: the freight opt-out AND the call-to-order
 * channel, so a freight product that is still buyable online keeps the stock
 * flex layout with its variation form intact.
 * ------------------------------------------------------------------------ */

@media (min-width: 769px) {
	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 40%;
		grid-template-rows: auto auto auto auto 1fr auto auto;
		align-items: start;
		column-gap: 0;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary > .summary-right {
		display: contents;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary > .summary-left {
		grid-column: 1;
		grid-row: 1 / span 5;
		width: auto;
		max-width: 100%;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .summary-right > * {
		grid-column: 2;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .summary-right > .price {
		grid-row: 1;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .hdm-freight-callout {
		grid-column: 1 / -1;
		grid-row: 6;
		margin-top: 6px;
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	/* Side by side, so the divider between them runs vertically. */
	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .hdm-freight-callout__row--tax {
		border-top: 0;
		border-left: 1px solid #e3dcd6;
	}

	/* Products that may not claim Zero Tax (EZ Raider, and the premium Pony
	   cart whose savings strip already says it) have one row, which must not
	   sit in half a card with the other half empty. */
	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .hdm-freight-callout__row:only-child {
		grid-column: 1 / -1;
	}

	body.hdm-no-free-ship.hdm-state-call-to-order .summary.entry-summary .single_add_to_cart_button {
		grid-column: 1 / -1;
		grid-row: 7;
	}
}
