/* --------------------------------------------------------------------------
 * GRZ Gaming — compact mobile summary alignment (v1.7.6)
 *
 * Presentation only. Separates the total-row tracks from the independently
 * sized action buttons and keeps every WooCommerce/plugin control untouched.
 * ----------------------------------------------------------------------- */

@media (max-width: 620px) {
	.single-product {
		--grz-mobile-total-label-track: 72px;
		--grz-mobile-qty-track: 108px;
		--grz-mobile-cart-action-width: clamp(80px, 28%, 142px);
	}

	/* The Total row no longer inherits the wide cart-action column. Quantity
	 * stays attached to Total, while price retains a flexible right lane. */
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) > .grz-tp-card__body,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) {
		grid-template-columns: var(--grz-mobile-total-label-track) var(--grz-mobile-qty-track) minmax(0, 1fr);
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)):not(:has(.grz-tp-qty--action)) > .grz-tp-card__body,
	.single-product .grz-tp-card--summary:has(.grz-caller-box):not(:has(.grz-tp-qty--action)) {
		grid-template-columns: var(--grz-mobile-total-label-track) minmax(0, 1fr);
	}

	/* Compact label/value pairs remove the long empty line between Package,
	 * You save, and their live WooCommerce values. */
	.single-product .grz-tp-card--summary .grz-tp-summary-row {
		display: grid;
		grid-template-columns: 72px minmax(0, 1fr);
		align-items: start;
		justify-content: initial;
		gap: 8px;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row dd {
		justify-self: start;
		max-width: 100%;
		text-align: start;
	}

	/* v1.7.5's opaque total cells sat above the continuous background and hid
	 * its outside border. Transparent cells reveal one uninterrupted surface. */
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-total__label,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-qty--action,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-total__prices {
		background: transparent;
	}

	/* Action widths are independent of the Total grid. Both controls span the
	 * whole row, then logical margins reserve the cart lane and the 8px gap. */
	.single-product .grz-tp-card--summary:has(.grz-caller-box) button.grz-tp-add-cart-secondary,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) button.grz-tp-add-cart-secondary {
		grid-column: 1 / -1;
		justify-self: start;
		width: var(--grz-mobile-cart-action-width);
		margin-inline: var(--grz-mobile-card-inset) 0;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) button.single_add_to_cart_button.button.alt,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) button.single_add_to_cart_button.button.alt {
		grid-column: 1 / -1;
		justify-self: stretch;
		width: auto;
		margin-inline: calc(var(--grz-mobile-card-inset) + var(--grz-mobile-cart-action-width) + var(--grz-mobile-action-gap)) var(--grz-mobile-card-inset);
	}

	/* Package trigger: instruction remains at the logical start, the selected
	 * live variation value moves to a stable logical-end column. */
	.single-product .grz-tp-denom-trigger__text {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, auto);
		align-items: center;
		gap: 10px;
		width: 100%;
	}

	.single-product .grz-tp-denom-trigger__label {
		min-width: 0;
	}

	.single-product .grz-tp-denom-trigger__value {
		min-width: 0;
		max-width: 46vw;
		justify-self: end;
		line-height: 1.2;
		text-align: end;
		overflow-wrap: anywhere;
	}
}

@media (max-width: 350px) {
	.single-product {
		--grz-mobile-total-label-track: 60px;
		--grz-mobile-qty-track: 94px;
		--grz-mobile-cart-action-width: clamp(72px, 28%, 96px);
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row {
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 6px;
	}

	.single-product .grz-tp-denom-trigger__text {
		gap: 7px;
	}

	.single-product .grz-tp-denom-trigger__label,
	.single-product .grz-tp-denom-trigger__value {
		font-size: 12px;
	}
}

@media (max-width: 290px) {
	.single-product {
		--grz-mobile-total-label-track: 56px;
		--grz-mobile-qty-track: 88px;
		--grz-mobile-cart-action-width: 70px;
	}
}
