/* PromoTrade price calculator. Self-contained so it looks the same whatever the theme does with text alignment. */
.ptw-calc {
	--ptw-border: rgba(0, 0, 0, .12);
	--ptw-soft: rgba(0, 0, 0, .035);
	--ptw-accent: #1f4e9c;
	--ptw-accent-soft: rgba(31, 78, 156, .1);
	text-align: left;
	max-width: 520px;
	margin: 0 0 1.25em;
	padding: 1.1em 1.2em 1em;
	border: 1px solid var(--ptw-border);
	border-radius: 8px;
	background: #fff;
	font-size: 15px;
	line-height: 1.45;
	box-sizing: border-box;
}
.ptw-calc[hidden] { display: none; }
.ptw-calc *, .ptw-calc *::before, .ptw-calc *::after { box-sizing: border-box; }
.ptw-calc p { margin: 0; }

/* Fields */
.ptw-calc .ptw-field { margin: 0 0 .9em; }
.ptw-calc .ptw-field label,
.ptw-calc .ptw-single-colour .ptw-label {
	display: block;
	margin: 0 0 .3em;
	font-size: .78em;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .75;
}
.ptw-calc select {
	display: block;
	width: 100%;
	min-height: 42px;
	padding: .45em .7em;
	border: 1px solid var(--ptw-border);
	border-radius: 6px;
	background-color: #fff;
	font-size: 1em;
	text-align: left;
}

/* Price table */
.ptw-calc .ptw-tiers {
	width: 100%;
	margin: .2em 0 1em;
	border: 1px solid var(--ptw-border);
	border-radius: 6px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	font-size: .93em;
}
.ptw-calc .ptw-tiers th,
.ptw-calc .ptw-tiers td {
	padding: .5em .75em;
	text-align: left;
	border: 0;
	border-bottom: 1px solid var(--ptw-border);
	background: transparent;
}
.ptw-calc .ptw-tiers th:nth-child(2), .ptw-calc .ptw-tiers td:nth-child(2) { text-align: right; }
.ptw-calc .ptw-tiers th:nth-child(3), .ptw-calc .ptw-tiers td:nth-child(3) { text-align: right; }
.ptw-calc .ptw-tiers tbody tr:last-child td { border-bottom: 0; }
.ptw-calc .ptw-tiers th { background: var(--ptw-soft); font-weight: 600; font-size: .85em; }
.ptw-calc .ptw-tiers tbody tr { cursor: pointer; transition: background-color .15s; }
.ptw-calc .ptw-tiers tbody tr:hover,
.ptw-calc .ptw-tiers tbody tr:focus { background: var(--ptw-soft); outline: none; }
.ptw-calc .ptw-tiers tbody tr.is-active { background: var(--ptw-accent-soft); font-weight: 600; }
.ptw-calc .ptw-tiers tbody tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--ptw-accent); }

/* Summary: four compact boxes, label and value on the same lines in each.
   !important is used here so the theme's own label/input styles can't push them out of line. */
.ptw-calc .ptw-summary {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .5em;
	margin: 0 0 .8em;
	align-items: stretch;
}
.ptw-calc .ptw-summary > div {
	display: flex !important;
	flex-direction: column;
	justify-content: flex-start;
	gap: 4px;
	min-width: 0;
	margin: 0 !important;
	padding: 8px 10px !important;
	border-radius: 6px;
	background: var(--ptw-soft);
}
.ptw-calc .ptw-summary > div.ptw-qty-box { background: var(--ptw-accent-soft); }
.ptw-calc .ptw-summary .ptw-box-label {
	display: block !important;
	float: none !important;
	width: auto !important;
	height: 14px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	font-style: normal !important;
	line-height: 14px !important;
	letter-spacing: .04em !important;
	text-transform: uppercase !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: .7;
}
.ptw-calc .ptw-summary .ptw-box-value,
.ptw-calc .ptw-summary .ptw-qty-box input {
	display: block !important;
	float: none !important;
	box-sizing: border-box !important;
	height: 26px !important;
	min-height: 0 !important;
	margin: 0 !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 24px !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ptw-calc .ptw-summary .ptw-box-value { padding: 1px 0 !important; }
.ptw-calc .ptw-summary .ptw-qty-box input {
	width: 100% !important;
	max-width: none !important;
	padding: 0 6px !important;
	border: 1px solid var(--ptw-border) !important;
	border-radius: 4px !important;
	background: #fff !important;
	box-shadow: none !important;
	color: inherit;
	font-family: inherit;
	font-style: inherit;
	text-align: left;
	-moz-appearance: textfield;
}
.ptw-calc .ptw-summary .ptw-qty-box input::-webkit-outer-spin-button,
.ptw-calc .ptw-summary .ptw-qty-box input::-webkit-inner-spin-button { margin: 0; }
.ptw-calc .ptw-summary .ptw-error { grid-column: 1 / -1; color: #b32d2e; font-size: .92em; }

.ptw-calc .ptw-template { font-size: .88em; opacity: .85; margin: 0 0 .35em; }
.ptw-calc .ptw-template a { text-decoration: underline; }

/* Quantity is entered in the calculator: hide WooCommerce's box (it still submits) and centre the button. */
form.ptw-form .quantity { display: none !important; }
form.ptw-form .single_add_to_cart_button {
	float: none !important;
	display: block !important;
	margin: 0 auto !important;
}
form.ptw-form .woocommerce-variation-add-to-cart { text-align: center; }
/* No "Clear" link: switching Standard/Express clears choices, and each dropdown can be set back. */
form.ptw-form .reset_variations { display: none !important; }

/* Print / Colour rows on single products (grouped products use WooCommerce's own options table). */
table.ptw-options { width: 100%; max-width: 520px; margin: 0 0 1em; border: 0; }
table.ptw-options th.label { width: 30%; padding: .5em 1em .5em 0; text-align: left; vertical-align: middle; border: 0; background: none; }
table.ptw-options td.value { padding: .4em 0; border: 0; background: none; }
table.ptw-options select { width: 100%; }
/* On grouped products the rows copy the theme's option rows (set by front.js). */
table.ptw-options--matched { max-width: none; margin-top: 0; }
tr.ptw-row[hidden] { display: none; }

/* Options that don't fit the current choice (shown greyed out instead of hidden). */
.variations_form select option.ptw-unavailable { color: #a7aaad; }

@media (max-width: 480px) {
	.ptw-calc { padding: .9em; }
	.ptw-calc .ptw-summary { grid-template-columns: 1fr 1fr; }
}

/* Note at the end of the product description: plain text in the theme's own style. */
.ptw-description-note { margin: 1em 0 0; }
.ptw-description-note p { margin: 0 0 .4em; }
.ptw-description-note p:last-child { margin-bottom: 0; }
