/* Measurement controls inherit Salient/WooCommerce typography and form styling. */
.omg-sds-measurement {
	width: 100%;
	margin: 1.5em 0;
	padding: 1em 0 0;
	border: 0;
	border-top: 1px solid rgba(52, 52, 52, .16);
	background: transparent;
	color: inherit;
	font: inherit;
}

.omg-sds-measurement legend {
	padding: 0 .5em 0 0;
	color: inherit;
	font: inherit;
	font-weight: 600;
}

.omg-sds-measurement-field {
	display: grid;
	grid-template-columns: minmax(9rem, 1fr) minmax(5rem, 8rem);
	align-items: center;
	gap: 1rem;
	margin: .75em 0;
}

.omg-sds-measurement-field label {
	margin: 0;
	color: inherit;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
}

.omg-sds-measurement-field input {
	width: 100%;
	min-height: 42px;
	margin: 0;
	font: inherit;
	font-size: 16px;
}

.omg-sds-measurement-totals {
	margin: 1.25em 0 0;
	border-top: 1px solid rgba(52, 52, 52, .12);
}

.omg-sds-measurement-totals>div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: .65em 0;
	border-bottom: 1px solid rgba(52, 52, 52, .12);
	font: inherit;
}

.omg-sds-measurement-totals dt,
.omg-sds-measurement-totals dd {
	margin: 0;
}

.omg-sds-measurement-totals dt {
	font-weight: 400;
}

.omg-sds-measurement-totals dd {
	color: inherit;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.omg-sds-measurement-totals .omg-sds-unit-cost-row {
	font-size: 14px;
}

.omg-sds-measurement-totals .omg-sds-final-price-row {
	border-bottom: 0;
	font-size: 16px;
	font-weight: 600;
}

.omg-sds-measurement-totals .omg-sds-final-price-row dd {
	font-size: 18px;
	font-weight: 600;
}

/* Keep each summary detail readable without introducing extra blank lines. */
.omg-sds-measurement-line {
	display: block !important;
	margin: 0;
	color: inherit;
	font: inherit;
	font-size: 12px;
	line-height: 1.6;
}

.omg-sds-measurement-line strong {
	color: inherit;
	font-weight: 500;
}

.omg-sds-measurement-line.omg-sds-measurement-total {
	margin-top: .45em;
	padding-top: 0;
	border-top: 0;
}

.omg-sds-measurement-line.omg-sds-unit-cost {
	font-size: 12px;
}

.wc-block-components-product-details .omg-sds-measurement-line,
.woocommerce-cart .variation .omg-sds-measurement-line,
.woocommerce-checkout .variation .omg-sds-measurement-line {
	display: block !important;
}

/* Classic cart markup groups all custom details in one definition list. */
.woocommerce-cart dl.variation:has(.omg-sds-measurement-line, .omg-sds-pallet-summary__label),
.woocommerce-checkout dl.variation:has(.omg-sds-measurement-line, .omg-sds-pallet-summary__label) {
	box-sizing: border-box;
	margin: .5rem 0;
	padding: .65rem .8rem;
	border-left: 2px solid #f15a24;
	background: #f7f7f7;
	color: #555;
	font: inherit;
	font-size: 12px;
}

/* Style each custom Cart and Checkout block entry as a consistent detail panel. */
.wc-block-components-product-details__measurements,
.wc-block-components-product-details__product-amount,
.wc-block-components-product-details__weight,
.wc-block-components-product-details__delivery-amount,
.wc-block-components-product-details__pallet-information {
	box-sizing: border-box;
	margin: .35rem 0;
	padding: .5rem .7rem;
	border-left: 2px solid #f15a24;
	background: #f7f7f7;
	color: #555;
	font: inherit;
	font-size: 12px;
}

/* The Cart and Checkout blocks preserve these spans but remove the wrapper div. */
.wc-block-components-product-details__measurements,
.wc-block-components-product-details__product-amount,
.wc-block-components-product-details__weight {
	display: block !important;
	width: 100%;
}

/* Keep the weight total clean and give the following pallet guidance its own section. */
.wc-block-components-product-details__weight .omg-sds-weight-summary {
	margin: 0;
	padding: 0;
	border-top: 0;
}

.wc-block-components-product-details__weight+.wc-block-components-product-details__pallet-information {
	margin-top: 1rem;
}

.wc-block-components-product-details__measurements .wc-block-components-product-details__name,
.wc-block-components-product-details__product-amount .wc-block-components-product-details__name,
.wc-block-components-product-details__weight .wc-block-components-product-details__name,
.wc-block-components-product-details__pallet-information .wc-block-components-product-details__name {
	display: none;
}

.wc-block-components-product-details__measurements .wc-block-components-product-details__value:has(.omg-sds-measurement-line),
.wc-block-components-product-details__product-amount .wc-block-components-product-details__value:has(.omg-sds-measurement-line),
.wc-block-components-product-details__weight .wc-block-components-product-details__value:has(.omg-sds-measurement-line),
.wc-block-components-product-details__pallet-information .wc-block-components-product-details__value:has(.omg-sds-pallet-summary__label) {
	display: contents;
}

/* WooCommerce inserts literal slashes between Cart block detail entries. */
.wc-block-components-product-details>span:has(.omg-sds-measurement-line, .omg-sds-pallet-summary__label)>[aria-hidden="true"] {
	display: none !important;
}

.wc-block-components-product-details__pallet-information {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 1rem;
	width: 100%;
}

.wc-block-components-product-details__delivery-amount {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 1rem;
	width: 100%;
}

.wc-block-components-product-details__delivery-amount .wc-block-components-product-details__value {
	text-align: right;
}

.wc-block-components-product-details__pallet-information .omg-sds-pallet-summary__label::after {
	content: ":";
}

.wc-block-components-product-details__pallet-information .omg-sds-pallet-summary__value {
	grid-column: 2;
	color: inherit;
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	text-align: right;
}

.woocommerce-cart .variation dt:has(+ dd .omg-sds-measurement-line strong),
.woocommerce-checkout .variation dt:has(+ dd .omg-sds-measurement-line strong),
.woocommerce-cart .variation dt:has(+ dd .omg-sds-pallet-summary),
.woocommerce-checkout .variation dt:has(+ dd .omg-sds-pallet-summary) {
	display: none;
}

.woocommerce-cart .variation dd:has(.omg-sds-measurement-line strong),
.woocommerce-checkout .variation dd:has(.omg-sds-measurement-line strong),
.woocommerce-cart .variation dd:has(.omg-sds-pallet-summary),
.woocommerce-checkout .variation dd:has(.omg-sds-pallet-summary) {
	grid-column: 1 / -1;
	float: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

.woocommerce-cart .variation dd:has(.omg-sds-pallet-summary) .omg-sds-pallet-summary,
.woocommerce-checkout .variation dd:has(.omg-sds-pallet-summary) .omg-sds-pallet-summary {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

/* Put measurement labels and amounts on opposite sides of each summary row. */
.omg-sds-measurement-line {
	display: flex !important;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
}

.omg-sds-measurement-line strong {
	flex: 1 1 auto;
}

.omg-sds-pallet-summary__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: baseline;
	gap: 1rem;
}

.omg-sds-pallet-summary__label,
.omg-sds-pallet-summary__value {
	margin: 0;
	font: inherit;
	font-size: inherit;
}

.omg-sds-pallet-summary__value {
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	text-align: right;
}

/* Custom-measured lines show the rate and exact calculation in item details. */
.wc-block-cart-items__row:has(.omg-sds-custom-price-calculation) .wc-block-cart-item__prices,
.wc-block-components-order-summary-item:has(.omg-sds-custom-price-calculation) .wc-block-components-order-summary-item__individual-prices {
	display: none !important;
}

@media (max-width: 480px) {
	.omg-sds-measurement-field {
		grid-template-columns: minmax(0, 1fr) 7rem;
		gap: .75rem;
	}

	.wc-block-components-product-details__pallet-information {
		grid-template-columns: minmax(0, 1fr);
		gap: .2rem;
	}

	.omg-sds-pallet-summary__value {
		text-align: left;
	}

	.wc-block-components-product-details__pallet-information .omg-sds-pallet-summary__value {
		grid-column: 1;
		text-align: left;
	}
}

/* Keep measured product details compact and aligned on the order confirmation page. */
.woocommerce-order-received .woocommerce-order-details .woocommerce-table--order-details {
	table-layout: fixed;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table--order-details th:first-child,
.woocommerce-order-received .woocommerce-order-details .woocommerce-table--order-details td:first-child {
	width: 72%;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table--order-details th:last-child,
.woocommerce-order-received .woocommerce-order-details .woocommerce-table--order-details td:last-child {
	width: 28%;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__line-item>td {
	vertical-align: top;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-total {
	text-align: left;
	font-variant-numeric: tabular-nums;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-total .woocommerce-Price-amount {
	text-align: left;
}

.woocommerce-order-received .woocommerce-order-details h2,
.woocommerce-order-received .woocommerce-customer-details h2 {
	margin: 0 0 .7em;
	font-size: clamp(1.5rem, 2.4vw, 1.9rem) !important;
	line-height: 1.2;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta {
	display: block !important;
	height: auto !important;
	min-height: 0 !important;
	max-width: 42rem;
	margin: .55rem 0 0;
	padding: .65rem .85rem;
	border-left: 2px solid #f26522;
	background: #f7f7f6;
	list-style: none;
	font-size: 12px;
	line-height: 1.25 !important;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta>li {
	display: flex !important;
	align-items: baseline !important;
	gap: .6rem !important;
	align-items: baseline;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
	height: auto !important;
	min-height: 0 !important;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta-label {
	color: #555;
	font-weight: 600;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta strong {
	display: block !important;
	flex: 0 0 12rem !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
}

.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta p {
	padding-bottom: .5em !important;
}

@media (max-width: 600px) {
	.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta {
		padding: .5rem .65rem;
	}

	.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta>li {
		gap: .4rem !important;
	}

	.woocommerce-order-received .woocommerce-order-details .woocommerce-table__product-name .wc-item-meta strong {
		flex-basis: 9.5rem !important;
	}
}

/* Keep WooCommerce account headings and order details in proportion with the site. */
.woocommerce-account .woocommerce-MyAccount-content h2 {
	margin: 0 0 .7em;
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
	line-height: 1.2;
}

.woocommerce-account .woocommerce-MyAccount-content h3 {
	margin: 1.4em 0 .65em;
	font-size: clamp(1.2rem, 2vw, 1.45rem);
	line-height: 1.25;
}

.woocommerce-account .woocommerce-MyAccount-content h4 {
	font-size: 1.1rem;
	line-height: 1.3;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details {
	table-layout: fixed;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details th:first-child,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details td:first-child {
	width: 72%;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details th:last-child,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details td:last-child {
	width: 28%;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__line-item>td {
	vertical-align: top;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-total {
	text-align: left;
	font-variant-numeric: tabular-nums;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta {
	display: block !important;
	height: auto !important;
	min-height: 0 !important;
	max-width: 42rem;
	margin: .55rem 0 0;
	padding: .65rem .85rem;
	border-left: 2px solid #f26522;
	background: #f7f7f6;
	list-style: none;
	font-size: 12px;
	line-height: 1.25 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta>li {
	display: flex !important;
	align-items: baseline !important;
	gap: .6rem !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
	height: auto !important;
	min-height: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta-label {
	color: #555;
	font-weight: 600;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta strong {
	display: block !important;
	flex: 0 0 12rem !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta p {
	padding-bottom: .5em !important;
}

.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details th,
.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table--order-details td {
	padding: .7rem .8rem;
}

@media (max-width: 600px) {
	.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta {
		padding: .5rem .65rem;
	}

	.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta>li {
		gap: .4rem !important;
	}

	.woocommerce-account .woocommerce-MyAccount-content .woocommerce-table__product-name .wc-item-meta strong {
		flex-basis: 9.5rem !important;
	}
}