/* BOOHC planner production estimate UI */

.bprod-hidden {
	display: none !important;
}

.bprod-open-btn {
	margin-top: 6px;
	font-size: 0.85em;
	position: relative;
	min-height: 2.25em;
}

.bprod-open-btn.is-loading,
.bprod-save.is-loading {
	cursor: wait;
	opacity: 0.85;
	pointer-events: none;
}

.bprod-open-btn .bprod-btn-inner,
.bprod-save .bprod-btn-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45em;
}

.bprod-spinner {
	display: inline-block;
	width: 0.95em;
	height: 0.95em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.1em;
	animation: bprod-spin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes bprod-spin {
	to { transform: rotate(360deg); }
}

.bprod-open-btn--mobile {
	width: 100%;
	margin-top: 8px;
}

.bprod-chip {
	display: inline;
	font-size: 0.95em;
}

.bprod-grand-total {
	font-weight: 600;
}

/* Modal */

.bprod-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.bprod-modal {
	background: #fff;
	border-radius: 8px;
	/* Wide enough for the access-method selects + line totals without clipping */
	max-width: 1240px;
	width: calc(100vw - 32px);
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bprod-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #e5e5e5;
}

.bprod-modal-head h3 {
	margin: 0;
	font-size: 1.05em;
}

.bprod-close {
	background: none;
	border: none;
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.bprod-modal-body {
	padding: 14px 18px;
	overflow-y: auto;
}

.bprod-stale-note {
	margin: 0 0 10px;
	padding: 8px 10px;
	background: #fff8e5;
	border-left: 3px solid #dba617;
	font-size: 0.86em;
}

.bprod-table-wrap {
	overflow-x: auto;
}

.bprod-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88em;
}

.bprod-table th,
.bprod-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: middle;
	white-space: nowrap;
}

.bprod-table input[type="number"] {
	width: 74px;
}

.bprod-table select {
	max-width: none;
	width: auto;
}

.bprod-table .bprod-line-total {
	min-width: 90px;
}

.bprod-face-label small {
	color: #888;
}

.bprod-digital-note {
	color: #777;
	font-style: italic;
}

/* Product (unit) grouping — mirrors the planner's product → faces division.
   Four rotating hues: header row tinted + bold, face rows lightly tinted with
   a colored left border. */

.bprod-product-row td {
	font-weight: 600;
	border-top: 2px solid #ddd;
	padding-top: 9px;
	padding-bottom: 9px;
}

.bprod-product-row.bprod-g0 td { background: rgba(33, 150, 243, 0.10); border-left: 4px solid #2196f3; }
.bprod-product-row.bprod-g1 td { background: rgba(76, 175, 80, 0.10);  border-left: 4px solid #4caf50; }
.bprod-product-row.bprod-g2 td { background: rgba(255, 152, 0, 0.10);  border-left: 4px solid #ff9800; }
.bprod-product-row.bprod-g3 td { background: rgba(156, 39, 176, 0.10); border-left: 4px solid #9c27b0; }

.bprod-face-row.bprod-g0 td { background: rgba(33, 150, 243, 0.035); }
.bprod-face-row.bprod-g1 td { background: rgba(76, 175, 80, 0.035); }
.bprod-face-row.bprod-g2 td { background: rgba(255, 152, 0, 0.035); }
.bprod-face-row.bprod-g3 td { background: rgba(156, 39, 176, 0.035); }

.bprod-face-row.bprod-g0 td:first-child { border-left: 4px solid rgba(33, 150, 243, 0.45); }
.bprod-face-row.bprod-g1 td:first-child { border-left: 4px solid rgba(76, 175, 80, 0.45); }
.bprod-face-row.bprod-g2 td:first-child { border-left: 4px solid rgba(255, 152, 0, 0.45); }
.bprod-face-row.bprod-g3 td:first-child { border-left: 4px solid rgba(156, 39, 176, 0.45); }

/* (Planner-side row coloring was reverted in 1.4.3 — colors live only in the
   estimator table above. The product_id % 4 mapping remains, so re-enabling
   matched colors later is a small, deliberate change.) */

.bprod-line-total {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.bprod-total-row {
	margin: 12px 0 4px;
	font-size: 1.05em;
}

.bprod-disclaimer {
	color: #777;
	font-size: 0.82em;
	margin: 4px 0 0;
}

.bprod-modal-foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	padding: 12px 18px;
	border-top: 1px solid #e5e5e5;
}

.bprod-link-out {
	margin-right: auto;
	font-size: 0.88em;
}

@media (max-width: 767px) {
	.bprod-modal {
		max-height: 96vh;
	}
	.bprod-table input[type="number"] {
		width: 58px;
	}
}
