/*
===============================
  Cnews order item tables
===============================
 */
table.cnews-order-items-table {
	/*
	  Accepted tradeoff: these order tables use px line-height so text inputs and row text share one exact vertical rhythm.
	  Assumption: body table text remains 1.25rem and large table text remains 1.5rem.
	 */
	--cnews-order-table-body-line-height: 26px;
	--cnews-order-table-large-line-height: 31px;
	--cnews-order-table-product-row-group-bottom-spacing: 20px;
	--cnews-order-table-product-row-group-top-spacing: 43px;
	border-collapse: collapse;
	line-height: normal;
	width: 100%;
}

table.cnews-order-items-table th,
table.cnews-order-items-table td {
	color: var(--black);
	text-align: left;
	vertical-align: top;
	padding-left: 16px;
	padding-right: 16px;
}

table.cnews-order-items-table th {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: var(--cnews-order-table-large-line-height);
	padding-top: 22px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--black);
}

table.cnews-order-items-table td {
	font-size: 1.25rem;
	font-weight: 400;
	line-height: var(--cnews-order-table-body-line-height);
	padding-top: 16px;
	padding-bottom: 16px;
}

/*
  Accepted tradeoff: product row group spacing uses generated table rows to keep real product rows identical.
  Assumption: supported browsers honor :has() and table-row pseudo-elements on tbody.
 */
table.cnews-order-items-table .cnews-order-product-rows:has(> .cnews-order-item-row)::before,
table.cnews-order-items-table .cnews-order-product-rows:has(> .cnews-order-item-row)::after {
	content: "";
	display: table-row;
	font-size: 0;
	line-height: 0;
}

table.cnews-order-items-table .cnews-order-product-rows:has(> .cnews-order-item-row)::before {
	height: var(--cnews-order-table-product-row-group-top-spacing);
}

table.cnews-order-items-table .cnews-order-product-rows:has(> .cnews-order-item-row)::after {
	height: var(--cnews-order-table-product-row-group-bottom-spacing);
}

table.cnews-order-items-table th:first-child,
table.cnews-order-items-table td:first-child {
	padding-left: 0;
}

table.cnews-order-items-table th:last-child,
table.cnews-order-items-table td:last-child {
	padding-right: 0;
}

table.cnews-order-items-table tbody td.checkout-error-message {
	font-size: 1.25rem;
	padding-top: 12px;
	padding-bottom: 12px;
}

table.cnews-order-items-table .cart-summary-row td,
table.cnews-order-items-table .checkout-summary-row td {
	padding-top: 26px;
	padding-bottom: 0;
}

/*
  Summaries.
 */
table.cnews-order-items-table .cart-summary-row:first-child td,
table.cnews-order-items-table .checkout-summary-row:first-child td {
	border-top: 1px solid var(--black);
	padding-top: 46px;
}

table.cnews-order-items-table .cart-summary-label,
table.cnews-order-items-table .checkout-summary-label {
	color: var(--black);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: var(--cnews-order-table-large-line-height);
}

table.cnews-order-items-table .cart-summary-note,
table.cnews-order-items-table .checkout-summary-note {
	display: block;
	margin-top: 2px;
	font-size: 1.25rem;
	font-weight: 400;
	line-height: var(--cnews-order-table-body-line-height);
}

/*
  Column roles.
 */
table.cnews-order-items-table .cnews-order-table-date,
table.cnews-order-items-table .cnews-order-table-price {
	white-space: nowrap;
}

table.cnews-order-items-table .cnews-order-table-price {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

table.cnews-order-items-table .cnews-order-table-date,
table.cnews-order-items-table .cnews-order-table-action {
	text-align: center;
}

table.cnews-order-items-table .cnews-order-table-date-editable {
	padding-top: 8px;
}

table.cnews-order-items-table .cnews-order-table-title p,
table.cnews-order-items-table .cnews-order-table-license p,
table.cnews-order-items-table .cnews-order-table-price p {
	margin: 0;
}

table.cnews-order-items-table .cnews-order-table-title a {
	color: var(--black);
	font-size: 1.25rem;
	font-weight: 400;
	line-height: var(--cnews-order-table-body-line-height);
	text-decoration: none;
}

table.cnews-order-items-table .cnews-order-table-title a:hover,
table.cnews-order-items-table .cnews-order-table-title a:focus {
	text-decoration: underline;
}

table.cnews-order-items-table .license-agreement-control {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 0;
}

table.cnews-order-items-table .license-agreement-control .agreement-checkbox {
	accent-color: var(--black);
	flex: 0 0 auto;
	height: 20px;
	width: 20px;
	margin: 3px 2px;
}

table.cnews-order-items-table .license-agreement-control .agreement-checkbox:not(:disabled) {
	cursor: pointer;
}

/*
  Row actions.
 */
table.cnews-order-items-table .cnews-order-table-action .link-btn,
table.cnews-order-items-table .cnews-order-table-action .btn {
	color: var(--black);
	font-size: 1.25rem;
	font-weight: 400;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	line-height: var(--cnews-order-table-body-line-height);
	text-transform: capitalize;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	white-space: nowrap;
}

table.cnews-order-items-table .cnews-order-table-action .ui-button {
	padding: 0 !important;
}

table.cnews-order-items-table .cnews-order-table-action .ui-button .ui-button-text {
	padding: 0;
}

/*
  Editable date input.
 */
table.cnews-order-items-table .cnews-order-table-date-editable input[type="text"] {
	box-sizing: content-box;
	display: inline-block;
	padding: 7px 8px;
	border: 1px solid var(--black);
	line-height: var(--cnews-order-table-body-line-height);
	font-size: inherit;
	text-align: center;
	width: 10ch;
}

/*
  Order view divider.
 */
table.cnews-order-items-table .order-total-divider td {
	height: 3px;
	overflow: hidden;
	background-color: #aaaaaa;
	padding: 0;
	line-height: 0;
}
