/* --------------------------------------------------------------------------
 * GRZ Gaming — receipt-style compact mobile purchase summary (v1.7.7)
 *
 * Presentation only. The live WooCommerce variation, price, quantity, cart and
 * Buy Now controls remain in their original DOM and retain their native names,
 * values, hooks and event handlers.
 * ----------------------------------------------------------------------- */

.single-product .grz-tp-qty__compact-label {
	display: none;
}

@media (max-width: 620px) {
	.single-product {
		--grz-mobile-receipt-border: color-mix(in srgb, var(--grz-tp-page-color, #0762e6) 16%, #ced8e6);
		--grz-mobile-receipt-divider: rgba(124, 147, 177, 0.28);
		--grz-mobile-receipt-inset: 14px;
		--grz-mobile-receipt-gap: 10px;
	}

	.single-product .grz-tp-hero .grz-favorite-button--product {
		border-radius: var(--grz-product-control-radius, 6px);
	}

	/* The selected variation stays at the logical end of the native package
	 * opener. The real button, value and picker behavior remain untouched. */
	.single-product .grz-tp-card--package .grz-tp-card__sub {
		display: block;
		font-size: 10.5px;
		line-height: 1.35;
	}

	.single-product .grz-tp-denom-trigger__text {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 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;
	}

	/* Three tracks preserve the 44/56 Qty/Total balance while the first track
	 * gives the visible actions a true 25/75 split after insets and the gap. */
	.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: minmax(0, 27fr) minmax(0, 17fr) minmax(0, 56fr);
		column-gap: 0;
		row-gap: 0;
	}

	.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: minmax(0, 27fr) minmax(0, 17fr) minmax(0, 56fr);
	}

	/* Receipt rows use the full content width and one strong alignment axis. */
	.single-product .grz-tp-card--summary .grz-tp-summary-list {
		box-sizing: border-box;
		width: 100%;
		margin: 0;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, auto);
		align-items: center;
		min-height: 40px;
		gap: 12px;
		border-bottom: 1px solid var(--grz-mobile-receipt-divider);
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row dt,
	.single-product .grz-tp-card--summary .grz-tp-summary-row dd {
		margin: 0;
		line-height: 1.35;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row dt {
		color: #53627a;
		font-weight: 500;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row dd {
		justify-self: end;
		max-width: 62vw;
		color: #101c2d;
		font-weight: 750;
		text-align: end;
		overflow-wrap: anywhere;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row--save dd {
		color: #0b9b55;
	}

	/* Qty and Total share one balanced purchase row. Their labels sit above the
	 * real control/value, matching the selected reference without cloning data. */
	.single-product .grz-tp-card--summary .grz-tp-total__label,
	.single-product .grz-tp-card--summary .grz-tp-qty--action,
	.single-product .grz-tp-card--summary .grz-tp-total__prices {
		box-sizing: border-box;
		align-self: stretch;
		margin: 0;
		border: 0;
		background: transparent;
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 7px;
		padding: 11px 5px 12px var(--grz-mobile-receipt-inset);
	}

	.single-product .grz-tp-card--summary .grz-tp-qty__compact-label {
		display: block;
		color: #53627a;
		font-size: 11px;
		font-weight: 500;
		line-height: 1.25;
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action .quantity {
		width: min(128px, 100%);
		height: 44px;
		grid-template-columns: minmax(30px, 1fr) minmax(40px, 1.25fr) minmax(30px, 1fr);
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action .grz-tp-qty__btn {
		width: 100%;
		height: 42px;
		min-height: 42px;
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action .quantity .qty {
		height: 42px;
		min-height: 42px;
		line-height: 42px;
	}

	.single-product .grz-tp-card--summary .grz-tp-total__label {
		display: flex;
		align-items: flex-start;
		justify-content: flex-end;
		padding: 11px var(--grz-mobile-receipt-inset) 0 5px;
		color: #53627a;
		font-size: 11px;
		font-weight: 500;
		line-height: 1.25;
		text-align: end;
	}

	.single-product .grz-tp-card--summary .grz-tp-total__prices {
		display: flex;
		min-width: 0;
		align-items: flex-end;
		justify-content: flex-end;
		padding: 30px var(--grz-mobile-receipt-inset) 12px 5px;
		overflow: visible;
		text-align: end;
	}

	.single-product .grz-tp-card--summary .grz-tp-total__now {
		max-width: 100%;
		font-size: clamp(24px, 7vw, 30px);
		line-height: 1;
		white-space: nowrap;
	}

	.single-product .grz-tp-card--summary .grz-tp-total__was {
		max-width: 100%;
		font-size: 11px;
		line-height: 1.2;
		white-space: nowrap;
	}

	/* The label and prices are one real flex stack. Earlier layers used
	 * display:contents to place both children in the same grid cell, which
	 * allowed real-site font metrics to paint "Total" behind the amount. */
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-total {
		display: flex !important;
		min-width: 0;
		min-height: 86px;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		align-self: stretch;
		box-sizing: border-box;
		margin: 0;
		padding: 10px var(--grz-mobile-receipt-inset) 11px 5px;
		border: 0;
		background: transparent;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total {
		grid-column: 3;
		grid-row: 2;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-total {
		z-index: 1;
		grid-column: 3;
		grid-row: 4;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)):not(:has(.grz-tp-qty--action)) .grz-tp-total,
	.single-product .grz-tp-card--summary:has(.grz-caller-box):not(:has(.grz-tp-qty--action)) .grz-tp-total {
		grid-column: 1 / -1;
	}

	.single-product .grz-tp-card--summary .grz-tp-total > .grz-tp-total__label {
		display: block;
		min-height: 14px;
		flex: 0 0 auto;
		align-self: stretch;
		padding: 0;
		text-align: end;
	}

	.single-product .grz-tp-card--summary .grz-tp-total > .grz-tp-total__prices {
		min-height: 0;
		flex: 1 1 auto;
		align-self: stretch;
		justify-content: flex-start;
		padding: 5px 0 0;
	}

	/* Native summary placement. */
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) > .grz-tp-card__body {
		display: grid;
		padding-block: 0;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-summary-list {
		grid-column: 1 / -1;
		grid-row: 1;
		padding-inline: var(--grz-mobile-receipt-inset);
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-qty--action,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total__label,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total__prices {
		grid-row: 2;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-qty--action {
		grid-column: 1 / 3;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total__label,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-total__prices {
		grid-column: 3;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)):not(:has(.grz-tp-qty--action)) .grz-tp-total__label,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)):not(:has(.grz-tp-qty--action)) .grz-tp-total__prices {
		grid-column: 1 / -1;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) > .grz-tp-card__body::after {
		z-index: 1;
		grid-column: 1 / -1;
		grid-row: 3;
		align-self: start;
		margin-inline: var(--grz-mobile-receipt-inset);
		border-top: 1px solid var(--grz-mobile-receipt-divider);
		content: "";
		pointer-events: none;
	}

	/* The validator remains a separate Step 2. A single grid-spanning surface
	 * now paints Step 3, eliminating split-cell edge cuts by construction. */
	.single-product .grz-tp-card--summary:has(.grz-caller-box)::before {
		z-index: 0;
		grid-column: 1 / -1;
		grid-row: 2 / 8;
		align-self: stretch;
		margin: 0;
		border: 1px solid var(--grz-mobile-receipt-border);
		border-radius: var(--grz-product-card-radius, 8px);
		background: #fff;
		content: "";
		pointer-events: none;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box)::after {
		z-index: 1;
		display: block;
		grid-column: 1 / -1;
		grid-row: 5;
		align-self: start;
		margin-inline: var(--grz-mobile-receipt-inset);
		border: 0;
		border-top: 1px solid var(--grz-mobile-receipt-divider);
		background: transparent;
		content: "";
		pointer-events: none;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) > .grz-tp-card__head {
		padding: 11px var(--grz-mobile-receipt-inset) 7px;
		border: 0;
		border-radius: 0;
		background: transparent;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-summary-list {
		padding: 0 var(--grz-mobile-receipt-inset);
		border: 0;
		background: transparent;
	}

	.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__label,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-total__prices {
		z-index: 1;
		grid-row: 4;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-qty--action {
		grid-column: 1 / 3;
		align-items: flex-start;
		justify-content: flex-start;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-qty--action .quantity,
	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)) .grz-tp-qty--action .quantity {
		align-self: flex-start;
		margin-inline: 0;
	}

	.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-total__prices {
		grid-column: 3;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box):not(:has(.grz-tp-qty--action)) .grz-tp-total__label,
	.single-product .grz-tp-card--summary:has(.grz-caller-box):not(:has(.grz-tp-qty--action)) .grz-tp-total__prices {
		grid-column: 1 / -1;
	}

	/* Selected-reference action proportions: balanced secondary action and a
	 * still-dominant primary action, both with their native submit semantics. */
	.single-product .grz-tp-card--summary button.grz-tp-add-cart-secondary,
	.single-product .grz-tp-card--summary .single_add_to_cart_button {
		box-sizing: border-box;
		align-self: center;
		justify-self: stretch;
		width: auto;
		min-width: 0;
		height: 50px;
		min-height: 50px;
		margin-block: 10px 8px;
		border-radius: var(--grz-product-control-radius, 6px);
	}

	.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;
		justify-self: stretch;
		width: auto;
		height: 50px;
		margin-block: 10px 8px;
		margin-inline: var(--grz-mobile-receipt-inset) calc(var(--grz-mobile-receipt-gap) / 2);
	}

	.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: 2 / -1;
		justify-self: stretch;
		width: auto;
		height: 50px;
		margin-block: 10px 8px;
		margin-inline: calc(var(--grz-mobile-receipt-gap) / 2) var(--grz-mobile-receipt-inset);
		padding-block: 0;
	}

	.single-product .grz-tp-card--summary:not(:has(.grz-caller-box)):not(:has(.grz-tp-qty--action)) button.single_add_to_cart_button.button.alt,
	.single-product .grz-tp-card--summary:has(.grz-caller-box):not(:has(.grz-tp-qty--action)) button.single_add_to_cart_button.button.alt {
		grid-column: 2 / -1;
		justify-self: stretch;
		width: auto;
	}

	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-express-slot,
	.single-product .grz-tp-card--summary:has(.grz-caller-box) .grz-tp-secure {
		border: 0;
		background: transparent;
	}

	.single-product .grz-tp-card--summary .grz-tp-secure {
		margin: 0;
		padding: 7px var(--grz-mobile-receipt-inset) 11px;
		color: #617089;
		font-size: 10px;
		line-height: 1.35;
		text-align: center;
	}
}

@media (max-width: 350px) {
	.single-product {
		--grz-mobile-receipt-inset: 11px;
		--grz-mobile-receipt-gap: 7px;
	}

	.single-product .grz-tp-card--summary .grz-tp-summary-row {
		min-height: 38px;
		gap: 8px;
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action .quantity {
		width: min(112px, 100%);
		grid-template-columns: minmax(26px, 1fr) minmax(38px, 1.25fr) minmax(26px, 1fr);
	}

	.single-product .grz-tp-card--summary .grz-tp-total__now {
		font-size: clamp(21px, 7vw, 25px);
	}

	.single-product .grz-tp-card--summary button.grz-tp-add-cart-secondary,
	.single-product .grz-tp-card--summary .single_add_to_cart_button {
		height: 48px;
		min-height: 48px;
	}
}

@media (max-width: 290px) {
	.single-product {
		--grz-mobile-receipt-inset: 9px;
		--grz-mobile-receipt-gap: 6px;
	}

	.single-product .grz-tp-card--summary .grz-tp-qty--action .quantity {
		width: min(104px, 100%);
	}

	.single-product .grz-tp-card--summary .grz-tp-total__now {
		font-size: 20px;
	}

	.single-product .grz-tp-card--summary .single_add_to_cart_button {
		padding-inline: 8px;
		font-size: 10.5px;
	}
}
