/**
 * Line Items Calculator - Styles
 */

/* Container */
.wpsc-line-items-container {
	margin-top: 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 15px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

/* Terms variant: Details + Type only (no Qty) */
.wpsc-line-items-container--terms .wpsc-line-items-header,
.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-line-items-header {
	grid-template-columns: 28px 3fr 0.7fr 35px;
}

.wpsc-line-items-container--terms .wpsc-line-item-row,
.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-line-item-row {
	grid-template-columns: 28px 3fr 0.7fr 35px;
}

.wpsc-line-items-container--terms .wpsc-line-item-row > .wpsc-li-product-meta,
.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-line-item-row > .wpsc-li-product-meta {
	display: none;
}

/* Request variant: Product/Service + Unit + Qty only */
.wpsc-line-items-container--request .wpsc-line-items-header,
.wpsc-line-items-container[data-lic-variant="request"] .wpsc-line-items-header {
	grid-template-columns: 28px 3fr 0.7fr 1fr 35px;
}

.wpsc-line-items-container--request .wpsc-line-item-row,
.wpsc-line-items-container[data-lic-variant="request"] .wpsc-line-item-row {
	grid-template-columns: 28px 3fr 0.7fr 1fr 35px;
}

.wpsc-line-items-container--request .wpsc-line-item-row > .wpsc-li-product-meta,
.wpsc-line-items-container[data-lic-variant="request"] .wpsc-line-item-row > .wpsc-li-product-meta {
	display: none;
}

/* Header */
.wpsc-line-items-header {
	display: grid;
	grid-template-columns: 28px 3fr 0.7fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 35px;
	gap: 10px;
	padding: 10px;
	background: #f8fafc;
	border: 1px solid #eef2f7;
	border-radius: 4px;
	font-weight: 600;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 12px;
	color: #667085;
	align-items: center;
}

/* Rows Container */
.wpsc-line-items-rows {
	margin-bottom: 15px;
}

/* Individual Row: 11 cols (drag + 10), meta full-width below */
.wpsc-line-item-row {
	display: grid;
	grid-template-columns: 28px 3fr 0.7fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 35px;
	gap: 10px;
	padding: 10px;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	background: #f8fafc;
	margin-bottom: 20px;
	transition: all 0.2s ease;
}

/* Locked row: full lock (From cart / From Pricing) – product name editable for From cart */
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] {
	background: #f1f5f9;
	border-color: #e2e8f0;
}
/* From cart: only quantity, price, supplier locked; comments and design_fee stay editable */
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-quantity-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-price-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-supplier-input {
	background: #e2e8f0;
	cursor: not-allowed;
	color: #475569;
}
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-product-input {
	background: #fff;
	cursor: text;
	color: inherit;
}
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-quote-upload-btn,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] .wpsc-li-quote-remove {
	pointer-events: none;
	opacity: 0.7;
}

/* Locked row: From Request – lock product + quantity, gray background */
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="request"] .wpsc-li-product-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="request"] .wpsc-li-quantity-input {
	background: #e2e8f0;
	cursor: not-allowed;
	color: #475569;
}

/* Locked row: From Pricing only – locked inputs get gray background (same as From cart) */
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-from-pricing="1"] .wpsc-li-product-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-from-pricing="1"] .wpsc-li-quantity-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-from-pricing="1"] .wpsc-li-price-input,
.wpsc-line-item-row.wpsc-li-row-locked[data-lic-from-pricing="1"] .wpsc-li-supplier-input {
	background: #e2e8f0;
	cursor: not-allowed;
	color: #475569;
}

/* Product meta: separate row below cols, full width, does not affect col layout */
.wpsc-line-item-row>.wpsc-li-product-meta {
	grid-column: 1 / -1;
	margin-top: 10px;
	padding: 12px;
	background: #f8fafc;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	display: grid;
	grid-template-columns: 1fr 0.7fr 2fr 0.8fr;
	gap: 15px;
	align-items: center;
}

/* Added-by: full width row inside each line item, below .wpsc-li-product-meta */
.wpsc-line-item-row > .wpsc-li-added-by {
	grid-column: 1 / -1;
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 8px;
	padding: 2px 0;
}

.wpsc-line-item-row > .wpsc-li-added-by:empty {
	display: none;
}

.wpsc-line-item-row:hover {
	border-color: #e5e7eb;
	box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
}

/* Drag handle column */
.wpsc-li-col.wpsc-li-drag {
	justify-content: center;
	min-width: 0;
}

.wpsc-li-drag-handle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	cursor: grab;
	color: #94a3b8;
	border-radius: 4px;
	transition: color 0.15s ease, background 0.15s ease;
}

.wpsc-li-drag-handle:hover {
	color: #64748b;
	background: rgba(0, 0, 0, 0.05);
}

.wpsc-li-drag-handle:active {
	cursor: grabbing;
}

.wpsc-li-drag-handle .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Row being dragged (original row left in place, dimmed) */
.wpsc-line-item-row.wpsc-li-dragging {
	opacity: 0.35;
	box-shadow: none;
}

/* Custom drag image shown while dragging */
.wpsc-li-drag-ghost {
	opacity: 0.95;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	border-radius: 8px;
	background: #fff;
	z-index: 10000;
}

.wpsc-line-item-row.wpsc-li-drag-over {
	border-color: var(--wpsc-lic-accent, #3b82f6);
	background: rgba(59, 130, 246, 0.04);
}

/* Column */
.wpsc-li-col {
	display: flex;
	align-items: center;
}

/* Product column */
.wpsc-li-col.wpsc-li-product {
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
	min-width: 0;
}

/* Column-specific alignment/sizing */
.wpsc-li-col.wpsc-li-unit,
.wpsc-li-col.wpsc-li-quantity,
.wpsc-li-col.wpsc-li-price,
.wpsc-li-col.wpsc-li-cost,
.wpsc-li-col.wpsc-li-tax,
.wpsc-li-col.wpsc-li-price-profit,
.wpsc-li-col.wpsc-li-profit-amount,
.wpsc-li-col.wpsc-li-total {
	justify-content: center;
}

.wpsc-li-col.wpsc-li-unit .wpsc-li-unit-input {
	min-width: 100px;
	max-width: 110px;
}

/* Meta section: Comments and Design Fee in one row, side by side */
.wpsc-li-product-meta .wpsc-li-comments-design-fee-wrap {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

.wpsc-li-product-meta .wpsc-li-comments-design-fee-wrap .wpsc-li-comments-row {
	flex: 1;
	min-width: 0;
	margin-top: 0;
}

.wpsc-li-product-meta .wpsc-li-comments-design-fee-wrap .wpsc-li-design-fee-row {
	flex: 0 0 auto;
	margin-top: 0;
}

.wpsc-li-product-meta .wpsc-li-meta-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 0;
}

.wpsc-li-product-meta .wpsc-li-meta-row label {
	font-weight: 600;
	font-size: 12px;
	color: #667085;
}

.wpsc-li-product-meta .wpsc-li-comments-row .wpsc-li-input {
	flex: 1;
	min-width: 0;
}

.wpsc-li-product-meta .wpsc-li-design-fee-row .wpsc-li-input {
	width: 100px;
	text-align: center;
}

.wpsc-li-col.wpsc-li-actions {
	justify-content: flex-end;
}

/* Input alignment (numbers) */
.wpsc-li-col.wpsc-li-quantity .wpsc-li-input,
.wpsc-li-col.wpsc-li-price .wpsc-li-input,
.wpsc-li-col.wpsc-li-cost .wpsc-li-input,
.wpsc-li-col.wpsc-li-price-profit .wpsc-li-input,
.wpsc-li-col.wpsc-li-profit-amount .wpsc-li-input,
.wpsc-li-col.wpsc-li-tax .wpsc-li-input {
	text-align: center;
	font-variant-numeric: tabular-nums;
	width: 80px;
}

#wpsc-container table,
#wpsc-container th,
#wpsc-container td,
.wpsc-modal table,
.wpsc-modal th,
.wpsc-modal td {
	border: 1px solid #e5e7eb;

}


/* Total/Cost/Profit inputs */
.wpsc-li-input.wpsc-li-cost-input,
.wpsc-li-input.wpsc-li-price-profit-input,
.wpsc-li-input.wpsc-li-design-fee-input,
.wpsc-li-input.wpsc-li-profit-amount-input,
.wpsc-li-input.wpsc-li-total-input {
	text-align: center;
	font-variant-numeric: tabular-nums;
	background: #f8fafc;
	width: 80px;
}

/* Unit Price Excl. VAT and Design Fee are editable - white background */
.wpsc-li-input.wpsc-li-price-profit-input,
.wpsc-li-input.wpsc-li-design-fee-input {
	background: #fff;
}

/* Input Fields */
.wpsc-li-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #e5e7eb;
	border-radius: 3px;
	font-size: 14px;
	transition: border-color 0.2s ease;
	line-height: 2;
	border-radius: 10px;
	background: #fff;
}

.wpsc-li-product-meta {
	grid-column: 1 / -1;
	padding: 12px;
	font-size: 13px;
	color: #64748b;
	background: #fdfdfd;
	border: 1px solid #f1f5f9;
	border-radius: 8px;
	display: grid;
	grid-template-columns: 1.2fr 1.2fr 1.5fr auto;
	gap: 15px;
	align-items: center;
}

/* Group: supplier + quote-display + quote-upload in one div, stacked vertically */
.wpsc-li-product-meta .wpsc-li-supplier-quote-group {
	display: contents;
}

/* Supplier, quote-display, quote-upload each in own block, stacked vertically */
.wpsc-li-product-meta .wpsc-li-meta-block {
	width: 100%;
	min-width: 0;
}

.wpsc-li-product-meta .wpsc-li-supplier-input {
	font-size: 13px;
	padding: 6px 8px;
	width: 100%;
	min-width: 140px;
	max-width: 240px;
}

/* Required asterisk for supplier when container has spm-supplier-required */
.wpsc-line-items-container.spm-supplier-required .wpsc-line-item-row .wpsc-li-supplier-block::before {
	content: '*';
	color: #c00;
	font-weight: bold;
}

.wpsc-li-product-meta .wpsc-li-quote-display {
	margin: 0;
	min-height: 0;
	min-width: 0;
}

.wpsc-li-product-meta .wpsc-li-quote-display-block:has(.wpsc-li-quote-display:empty) {
	display: none;
}

/* Show upload when no quote; hide upload block when quote has content */
.wpsc-li-product-meta .wpsc-li-quote-upload-block .wpsc-li-quote-upload {
	display: block;
}

.wpsc-li-product-meta .wpsc-li-quote-display-block:has(.wpsc-li-quote-display:not(:empty))+.wpsc-li-quote-upload-block {
	display: none;
}

.wpsc-li-quote-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	font-size: 12px;
	color: var(--spm-primary, #005681);
	background: transparent;
	border: 1px solid var(--spm-primary, #005681);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.wpsc-li-quote-upload-btn:hover {
	background: var(--spm-primary-light, rgba(0, 86, 129, 0.1));
	color: var(--spm-primary, #005681);
}

.wpsc-li-quote-upload.wpsc-li-quote-uploading .wpsc-li-quote-upload-btn {
	opacity: 0.7;
	pointer-events: none;
}

.wpsc-li-meta-block.wpsc-li-comments-design-fee-wrap {
	display: contents;
}

/* wpsc-li-quote-display: same CSS as SPM .spm-cart-item-quote */
.wpsc-li-quote-display,
.wpsc-li-quote-display .spm-cart-item-quote {
	font-size: 12px;
	color: #64748b;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.wpsc-li-quote-display .spm-quote-icon {
	display: inline-flex;
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	color: var(--spm-primary, #005681);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23005681' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
}


.wpsc-li-quote-display .spm-cart-item-quote a,
.wpsc-li-quote-display a {
	color: var(--spm-primary, #005681);
	text-decoration: none;
	font-weight: 500;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpsc-li-quote-display .spm-cart-item-quote a:hover,
.wpsc-li-quote-display a:hover {
	text-decoration: underline;
}

/* Quote display: remove/replace action buttons */
.wpsc-li-quote-actions {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 4px;
	flex-shrink: 0;
}

.wpsc-li-quote-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: none;
	background: transparent;
	color: #64748b;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

.wpsc-li-quote-remove:hover {
	background: rgba(0, 86, 129, 0.1);
	color: var(--spm-primary, #005681);
}

.wpsc-li-quote-remove .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.wpsc-li-product-input {
	width: auto;
	resize: none;
	overflow: hidden;
	min-height: 24px !important;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	letter-spacing: inherit;
	line-height: 1.2;
	padding: 4px 6px;
	align-content: center;
	color: unset;
}

.wpsc-li-input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.wpsc-li-input[readonly] {
	background-color: #f8fafc;
	cursor: not-allowed;
	font-weight: 600;
	color: #333;
}

/* Number inputs - remove spinner in some browsers */
.wpsc-li-input[type="number"]::-webkit-inner-spin-button,
.wpsc-li-input[type="number"]::-webkit-outer-spin-button {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* Show spin buttons only on hover/focus (Chrome/Edge) */
.wpsc-li-input[type="number"]:hover::-webkit-inner-spin-button,
.wpsc-li-input[type="number"]:hover::-webkit-outer-spin-button,
.wpsc-li-input[type="number"]:focus::-webkit-inner-spin-button,
.wpsc-li-input[type="number"]:focus::-webkit-outer-spin-button,
.wpsc-li-input[type="number"]:focus-visible::-webkit-inner-spin-button,
.wpsc-li-input[type="number"]:focus-visible::-webkit-outer-spin-button {
	opacity: 1;
	pointer-events: auto;
}

/* Buttons */
.wpsc-lic-btn {
	padding: 8px 15px;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.wpsc-lic-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpsc-lic-btn:active {
	transform: translateY(0);
}

.wpsc-lic-btn-add {
	background: transparent;
	color: #3b82f6;
	border-radius: 8px;
	font-weight: 500;
}

.wpsc-lic-btn-add:hover {
	background: transparent;
	color: #666;
	box-shadow: none;
}

.wpsc-lic-btn-remove {
	background: transparent;
	color: #98a2b3;
	padding: 6px 8px;
	width: auto;
	justify-content: center;
}

.wpsc-lic-btn-remove:hover {
	background: #f2f4f7;
	color: #667085;
	box-shadow: none;
}

.wpsc-lic-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Footer */
.wpsc-line-items-footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding-top: 15px;
	border-top: 1px solid #eef2f7;
}

/* Summary (tax + grand total) */
.wpsc-lic-summary {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 12px 14px;
	min-width: 300px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wpsc-lic-summary.wpsc-lic-summary--display {
	width: 100%;
}

.wpsc-lic-tax-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

.wpsc-lic-tax-label {
	color: #344054;
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 12px;
	font-weight: 600;
}

.wpsc-lic-tax-rate-input {
	width: 72px;
	padding: 6px 8px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font-size: 13px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	background: #f8fafc;
}

/* Tax breakdown */
.wpsc-lic-tax-breakdown {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 180px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 6px 10px;
}

.wpsc-lic-tax-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
}

.wpsc-lic-tax-row-label {
	color: #667085;
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: 12px;
	font-weight: 600;
}

.wpsc-lic-tax-row-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: #111827;
}

.wpsc-lic-tax-row+.wpsc-lic-tax-row {
	border-top: 1px dashed #eef2f7;
}

.wpsc-lic-tax-row-total {
	margin-top: 2px;
    border: 1px solid #e5e7eb !important;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: var(--spm-card-radius);
}

.wpsc-lic-tax-row-total .wpsc-lic-tax-row-label {
	color: #344054;
	font-weight: 700;
}

.wpsc-lic-tax-row-total .wpsc-lic-tax-row-value {
	color: #005681;
	font-size: 18px;
	font-weight: 800;
}

/* Grand Total */
.wpsc-lic-grand-total-container {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 600;
	margin-left: auto;
}

.wpsc-lic-grand-total-label {
	color: #667085;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 12px;
}

.wpsc-lic-grand-total-value {
	color: #3b82f6;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.1;
}

/* Add button: plus-in-circle look (matches screenshot) */
.wpsc-lic-btn-add .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Display Mode (Read-only view) */
.wpsc-line-items-display {
	margin-top: 10px;
}

.wpsc-line-items-table {
	width: 100%;
	border-collapse: collapse;
	background-color: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
}

.wpsc-line-items-table thead {
	background-color: #f8fafc;
}

.wpsc-line-items-table th,
.wpsc-line-items-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #eef2f7;
}

.wpsc-line-items-table th {
	font-weight: 600;
	color: #667085;
	text-transform: none;
}

.wpsc-line-items-table tbody tr:hover {
	background-color: #f9f9f9;
}

.wpsc-line-items-table tfoot {
	background-color: #fff;
	font-weight: 600;
}

.wpsc-line-items-table tfoot td {
	border-bottom: none;
}

/* Summary in display mode */
.wpsc-line-items-display .wpsc-lic-summary-wrapper {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

/* Widget display (inside wpsc-widget-body) - match card-like screenshot */
.wpsc-widget-body .wpsc-line-items-display {
	margin-top: 0;
	margin-bottom: 10px;
	padding: 0;
	width: 100%;
	min-width: 0; /* allow shrinking in flex/grid so parent can define width */
	box-sizing: border-box;
}

/* Let the list item (and thus the table wrapper) take full width in widget */
.info-list-item:has(.wpsc-line-items-display) {
	width: 100%;
	display: block;
}

.info-list-item:has(.wpsc-line-items-display)>.info-label {
	display: none;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	overflow: hidden;
	width: 100%;
	table-layout: fixed; /* force table to use full width and distribute columns */
	border-collapse: collapse;
	background-color: #fff;
	border: 1px solid #e5e7eb;
	box-sizing: border-box;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget thead {
	background-color: #f8f9fa;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget th {
	font-size: 14px;
	font-weight: 700;
	color: #344054;
	padding: 12px 16px;
	text-align: left;
	background-color: #f8f9fa;
	border-bottom: 1px solid #e5e7eb;
	text-transform: none;
	letter-spacing: normal;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget th:nth-child(2) {
	text-align: center;
	width: 80px;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget th:first-child {
	text-align: left;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget th:last-child,
.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget td:last-child {
	font-variant-numeric: tabular-nums;
	text-align: center !important;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget td {
	font-size: 14px;
	color: #344054;
	padding: 12px 16px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: middle;
	font-weight: 400;
	background-color: #fff;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget td:first-child {
	text-align: left;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget td:nth-child(2) {
	text-align: center;
	font-variant-numeric: tabular-nums;
	font-weight: 400;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget tbody tr {
	background-color: #fff;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget tbody tr:last-child td {
	border-bottom: 1px solid #e5e7eb;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget tfoot {
	background-color: #fff;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget tfoot tr {
	border-top: 1px solid #e5e7eb;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget .wpsc-line-items-tax-row td {
	color: #344054;
	font-weight: 400;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget .wpsc-line-items-grand-total-row td {
	border-bottom: none;
	border-top: 1px solid #e5e7eb;
	padding-top: 12px;
	padding-bottom: 12px;
	background-color: #fff;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget .wpsc-line-items-grand-total-row td:first-child {
	font-weight: 700;
	color: #344054;
	font-size: 14px;
}

.wpsc-widget-body .wpsc-line-items-display .wpsc-line-items-table.wpsc-line-items-table--widget .wpsc-line-items-grand-total-row td:last-child {
	font-weight: 700;
	color: #3b82f6;
	font-size: 14px;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {

	.wpsc-line-items-header,
	.wpsc-line-item-row {
		grid-template-columns: 28px 1.5fr 0.7fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr 60px;
		gap: 8px;
	}

	.wpsc-line-items-container--request .wpsc-line-items-header,
	.wpsc-line-items-container--request .wpsc-line-item-row,
	.wpsc-line-items-container[data-lic-variant="request"] .wpsc-line-items-header,
	.wpsc-line-items-container[data-lic-variant="request"] .wpsc-line-item-row {
		grid-template-columns: 28px 1.5fr 0.7fr 0.8fr 60px;
	}

	.wpsc-line-items-container--terms .wpsc-line-items-header,
	.wpsc-line-items-container--terms .wpsc-line-item-row,
	.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-line-items-header,
	.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-line-item-row {
		grid-template-columns: 28px 1.5fr 0.7fr 60px;
	}

	.wpsc-li-input {
		padding: 6px 8px;
		font-size: 13px;
	}
}

@media screen and (max-width: 768px) {
	.wpsc-line-items-header {
		display: none;
	}

	.wpsc-line-item-row {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.wpsc-li-col {
		flex-direction: column;
		width: 100%;
	}

	.wpsc-li-col.wpsc-li-product {
		align-items: center;
	}

	.wpsc-li-col.wpsc-li-quantity .wpsc-li-input,
	.wpsc-li-col.wpsc-li-price .wpsc-li-input,
	.wpsc-li-col.wpsc-li-cost .wpsc-li-input,
	.wpsc-li-col.wpsc-li-price-profit .wpsc-li-input,
	.wpsc-li-col.wpsc-li-profit-amount .wpsc-li-input,
	.wpsc-li-col.wpsc-li-tax .wpsc-li-input {
		width: 80% !important;
	}

	.wpsc-li-quote-display,
	.wpsc-li-quote-display .spm-cart-item-quote {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 230px;
	}

	textarea.wpsc-li-input.wpsc-li-product-input {
		width: 80%;
	}

	input.wpsc-li-input.wpsc-li-total-input {
		width: 80%;
	}

	input.wpsc-li-input.wpsc-li-supplier-input {
		width: 90%;
	}

	.wpsc-li-col::before {
		content: attr(data-label);
		font-weight: 600;
		margin-bottom: 5px;
		color: #666;
		font-size: 12px;
		text-transform: uppercase;
	}

	.wpsc-li-product::before {
		content: 'Product/Service';
	}

	.wpsc-li-unit::before {
		content: 'Unit';
	}

	.wpsc-line-items-container--terms .wpsc-li-product::before,
	.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-li-product::before {
		content: 'Description';
	}

	.wpsc-line-items-container--terms .wpsc-li-unit::before,
	.wpsc-line-items-container[data-lic-variant="terms"] .wpsc-li-unit::before {
		content: 'Type';
	}

	.wpsc-li-product-meta::before {
		content: 'Supplier';
		font-weight: 600;
		margin-bottom: 5px;
		color: #666;
		font-size: 12px;
		text-transform: uppercase;
		display: block;
	}

	.wpsc-li-quantity::before {
		content: 'Qty.';
	}

	.wpsc-li-price::before {
		content: 'Unit Cost';
	}

	.wpsc-li-cost::before {
		content: 'Total Cost';
	}

	.wpsc-li-tax::before {
		content: 'Profit (%)';
	}

	.wpsc-li-price-profit::before {
		content: 'Unit Price Excl. VAT (SR)';
	}

	.wpsc-li-profit-amount::before {
		content: 'Profit in SAR';
	}

	.wpsc-li-total::before {
		content: 'Total Price (SR)';
	}

	.wpsc-li-actions {
		justify-content: flex-end;
	}

	.wpsc-line-items-footer {
		flex-direction: column;
		gap: 15px;
		align-items: stretch;
	}

	.wpsc-lic-summary {
		width: auto;
		align-items: stretch;
		min-width: 0;
	}

	.wpsc-lic-tax-container {
		justify-content: space-between;
	}

	.wpsc-lic-tax-breakdown {
		width: auto;
	}

	.wpsc-lic-btn-add {
		width: 100%;
		justify-content: center;
	}

	.wpsc-lic-grand-total-container {
		justify-content: space-between;
	}

	/* Responsive table */
	.wpsc-line-items-table {
		font-size: 14px;
	}

	.wpsc-line-items-table th,
	.wpsc-line-items-table td {
		padding: 8px;
	}
}

@media screen and (max-width: 480px) {
	.wpsc-line-items-container {
		padding: 10px;
	}

	.wpsc-li-input {
		font-size: 14px;
	}

	.wpsc-lic-grand-total-value {
		min-width: 80px;
		font-size: 14px;
	}
}

/* Template - Hidden */
template {
	display: none;
}

/* Animation for new rows */
@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wpsc-line-item-row {
	animation: slideIn 0.3s ease;
}

/* Loading state */
.wpsc-line-items-container.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Error state */
.wpsc-li-input.error {
	border-color: #dc3232;
}

.wpsc-li-input.error:focus {
	box-shadow: 0 0 0 1px #dc3232;
}

/* Success state */
.wpsc-li-input.success {
	border-color: #46b450;
}

/* SPM Integration - Add button picker (select from SPM cart) */
.wpsc-line-items-footer {
	position: relative;
}

.wpsc-lic-spm-picker {
	position: absolute;
	bottom: 100%;
	left: 0;
	margin-bottom: 4px;
	min-width: 280px;
	max-width: 400px;
	max-height: 320px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	z-index: 1000;
}

.wpsc-lic-spm-picker-item {
	padding: 10px 14px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1.4;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s ease;
}

.wpsc-lic-spm-picker-item:last-of-type {
	border-bottom: none;
}

.wpsc-lic-spm-picker-item:hover {
	background: #f5f5f5;
}

.wpsc-lic-spm-picker-empty {
	font-weight: 500;
}

.wpsc-lic-spm-picker-divider {
	height: 1px;
	background: #e5e5e5;
	margin: 4px 0;
}

.wpsc-lic-spm-picker-section-label {
	padding: 8px 14px 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #666;
	letter-spacing: 0.5px;
}

.wpsc-lic-spm-picker-empty-hint {
	padding: 12px 14px;
	color: #888;
	font-size: 13px;
	text-align: center;
}

.wpsc-lic-spm-picker-loading {
	padding: 10px 14px;
	color: #888;
	font-size: 12px;
	font-style: italic;
}

/* .wpsc-lic-spm-picker-from-request: styling inherited from .wpsc-lic-spm-picker-item */

/* ========== Dark Mode (wpsc-modern-theme integration) ========== */
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-header,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-container .wpsc-line-items-header {
	background: #1c1c1d !important;
	border-color: #374151 !important;
	color: #b0b3b8 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-rows,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-container .wpsc-line-items-rows {
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-item-row,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-container .wpsc-line-item-row {
	background: #252728 !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-item-row:hover {
	border-color: #374151 !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2) !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-item-row.wpsc-li-row-locked[data-lic-locked="1"] {
	background: #1c1c1d !important;
	border-color: #374151 !important;
	color: #b0b3b8 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-item-row > .wpsc-li-product-meta,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-product-meta {
	background: #1c1c1d !important;
	border-color: #374151 !important;
	color: #b0b3b8 !important;
}

/* Line items inputs - quantity, tax, and all .wpsc-li-input */
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input.wpsc-li-quantity-input,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input.wpsc-li-tax-input,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input.wpsc-li-cost-input,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input.wpsc-li-price-input,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input.wpsc-li-total-input {
	background: #252728 !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-input[readonly],
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-li-product-input[readonly] {
	background-color: #2d2f31 !important;
	color: #b0b3b8 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-tax-rate-input {
	background: #252728 !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
}

/* SPM Picker dropdown */
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker {
	background: #252728 !important;
	border-color: #374151 !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-item {
	background: transparent !important;
	border-bottom-color: #374151 !important;
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-item:hover {
	background: #333334 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-divider {
	background: #374151 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-section-label {
	color: #b0b3b8 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-empty-hint,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-spm-picker-loading {
	color: #b0b3b8 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-line-items-container .wpsc-lic-summary {
	background: #252728 !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
	box-shadow: none !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-container,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-breakdown {
	background: #1c1c1d !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-row-label {
    color: #e2e5e9 !important;
}
:root[data-theme="dark"] .wpsc-lic-tax-row-value {
    color: #e2e5e9 !important;
}

:root[data-theme="dark"] .wpsc-lic-tax-row-label {
    color: #e2e5e9 !important;
}
:root[data-theme="dark"] .wpsc-lic-tax-label {
    color: #e2e5e9 !important;
}
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-rate-input {
	background: #252728 !important;
	border-color: #374151 !important;
	color: #e2e5e9 !important;
}

:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-row + .wpsc-lic-tax-row {
	border-color: #374151 !important;
}
:root[data-theme="dark"] .wpsc-lic-tax-row + .wpsc-lic-tax-row {
    border-top: 1px dashed #374151;
}
:root[data-theme="dark"] .wpsc-lic-tax-row + .wpsc-lic-tax-row,
:root[data-theme="dark"] .wpsc-line-items-footer {
    border-color: #374151;
}

:root[data-theme="dark"] .wpsc-lic-tax-row-total .wpsc-lic-tax-row-value {
    color: #38bdf8 !important; 
}
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-tax-row-total,
:root[data-theme="dark"] #wpsc-container.wpsc-dark-mode-enabled .wpsc-lic-summary .wpsc-lic-grand-total-row {
	border-top-color: #374151 !important;
	color: #e2e5e9 !important;
}