/*
 * JLC3DP configurator — scoped under .zbotic-jlc3dp-app.
 * Stepped card flow (technology → material → colour → finish → quantity
 * → calculate + price; lead time is a static line, not a selector).
 * Standalone keeps the two-column desktop layout (steps left, sticky
 * viewer/price right) and stacks on mobile; embedded mode
 * (.zbotic-jlc3dp-embedded, inside zbotic-3dprint's #tdp-handoff-slot) is a
 * single full-width column matching the host page's .tdp-card look.
 * Theme-agnostic: inherits the theme font, neutral palette.
 * Filename-versioned (frontend-v4.css) — bump the filename, never ?ver=.
 */

.zbotic-jlc3dp-app {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 24px;
	align-items: start;
	margin: 0 auto;
	max-width: 1200px;
	color: #1f2933;
	font-size: 15px;
	line-height: 1.5;
}
.zbotic-jlc3dp-app [hidden] { display: none !important; }

.zbotic-jlc3dp-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }

.zbotic-jlc3dp-card {
	background: #fff;
	border: 1px solid #e3e8ee;
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.zbotic-jlc3dp-side .zbotic-jlc3dp-card { margin-bottom: 0; }

.zbotic-jlc3dp-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.zbotic-jlc3dp-step-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #52606d; margin: 18px 0 8px; }
.zbotic-jlc3dp-muted { color: #6b7683; font-size: 13px; }
.zbotic-jlc3dp-micro { margin: 8px 0 0; }
.zbotic-jlc3dp-center { text-align: center; }

/* Step cards: numbered by a CSS counter over the VISIBLE steps only —
   [hidden] steps are display:none, which counters skip, so the conditional
   finish step never leaves a gap in the numbering. */
#zbotic-jlc3dp-configurator { counter-reset: jlc3dp-step; }
.zbotic-jlc3dp-step-heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
}
.zbotic-jlc3dp-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	flex: none;
}
.zbotic-jlc3dp-step .zbotic-jlc3dp-step-num::before {
	counter-increment: jlc3dp-step;
	content: counter(jlc3dp-step);
}

/* Model summary: horizontal stat strip across the top of the flow. */
.zbotic-jlc3dp-summary-card .zbotic-jlc3dp-step-title { margin-top: 0; }
.zbotic-jlc3dp-summary-card .zbotic-jlc3dp-geo { gap: 12px 44px; }

/* Upload */
.zbotic-jlc3dp-dropzone {
	border: 2px dashed #c4cdd6;
	border-radius: 10px;
	padding: 32px 16px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.zbotic-jlc3dp-dropzone:hover,
.zbotic-jlc3dp-dropzone.is-dragover { border-color: #2563eb; background: #f4f8ff; }
.zbotic-jlc3dp-drop-line { margin: 0 0 4px; }
.zbotic-jlc3dp-file-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-weight: 600; }
.zbotic-jlc3dp-link-btn { background: none; border: none; padding: 0; color: #2563eb; cursor: pointer; font-size: 13px; text-decoration: underline; }

/* Errors and warnings */
.zbotic-jlc3dp-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.zbotic-jlc3dp-error-text { color: #b91c1c; font-weight: 600; }
.zbotic-jlc3dp-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 8px 12px; margin-top: 10px; font-size: 13px; }
.zbotic-jlc3dp-reason-list li { color: #92400e; }

/* Spinner */
.zbotic-jlc3dp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(37, 99, 235, .25);
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: zbotic-jlc3dp-spin .8s linear infinite;
	vertical-align: -3px;
	margin-right: 8px;
}
.zbotic-jlc3dp-btn-primary .zbotic-jlc3dp-spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes zbotic-jlc3dp-spin { to { transform: rotate(360deg); } }

/* Geometry */
.zbotic-jlc3dp-geo { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.zbotic-jlc3dp-geo dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b7683; margin: 0; }
.zbotic-jlc3dp-geo dd { margin: 2px 0 0; font-weight: 600; }

/* Technology tabs */
.zbotic-jlc3dp-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.zbotic-jlc3dp-tab { border: 1px solid #c4cdd6; background: #fff; border-radius: 999px; padding: 9px 18px; cursor: pointer; font-size: 14px; }
.zbotic-jlc3dp-tab.is-active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.zbotic-jlc3dp-tab.is-disabled { opacity: .45; cursor: not-allowed; }

/* Materials */
.zbotic-jlc3dp-materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.zbotic-jlc3dp-material-card { border: 1px solid #d9e0e8; border-radius: 8px; padding: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.zbotic-jlc3dp-material-card:hover { border-color: #2563eb; }
.zbotic-jlc3dp-material-card.is-active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.zbotic-jlc3dp-material-card.is-disabled { opacity: .55; cursor: not-allowed; background: #f8fafc; }
.zbotic-jlc3dp-material-card.is-disabled:hover { border-color: #d9e0e8; }
.zbotic-jlc3dp-material-name { font-weight: 600; }
.zbotic-jlc3dp-material-desc { color: #6b7683; font-size: 12.5px; line-height: 1.45; margin-top: 4px; }
.zbotic-jlc3dp-unable { color: #b45309; font-size: 12px; margin-top: 6px; }
.zbotic-jlc3dp-badge { display: inline-block; background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin-top: 6px; }
.zbotic-jlc3dp-badge-soft { background: #eef2ff; color: #3730a3; margin: 0 0 0 6px; }

/* Colours */
.zbotic-jlc3dp-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.zbotic-jlc3dp-color-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #c4cdd6; background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.zbotic-jlc3dp-color-chip.is-active { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); font-weight: 600; }
.zbotic-jlc3dp-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(16, 24, 40, .2); flex: none; }

/* Finishes */
.zbotic-jlc3dp-finishes { display: flex; flex-direction: column; gap: 8px; }
.zbotic-jlc3dp-finish-option { border: 1px solid #d9e0e8; border-radius: 8px; padding: 9px 12px; }
.zbotic-jlc3dp-finish-option.is-active { border-color: #2563eb; background: #f4f8ff; }
.zbotic-jlc3dp-finish-option.is-disabled { opacity: .55; }
.zbotic-jlc3dp-finish-option.is-disabled .zbotic-jlc3dp-finish-toggle { cursor: not-allowed; }
.zbotic-jlc3dp-finish-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; font-size: 14px; }
.zbotic-jlc3dp-finish-attr { margin-top: 8px; width: 100%; max-width: 320px; }
#zbotic-jlc3dp-finish-surface-group .zbotic-jlc3dp-step-title { margin-top: 0; }

/* Quantity (the lead-time selector was removed — a static "Factory lead
   time: 15–20 days" line lives in the price panel instead) */
.zbotic-jlc3dp-qty-row { display: flex; align-items: center; gap: 12px; }
.zbotic-jlc3dp-qty-label { font-weight: 600; font-size: 14px; margin: 0; }
#zbotic-jlc3dp-qty { width: 110px; padding: 7px 10px; border: 1px solid #c4cdd6; border-radius: 8px; }

/* Viewer */
.zbotic-jlc3dp-viewer-card { padding: 0; overflow: hidden; }
.zbotic-jlc3dp-viewer { width: 100%; height: 300px; background: #f1f5f9; }
.zbotic-jlc3dp-viewer canvas { display: block; max-width: 100%; }

/* Price */
.zbotic-jlc3dp-price-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.zbotic-jlc3dp-price-total-row { border-top: 1px solid #e3e8ee; margin-top: 4px; padding-top: 10px; font-weight: 700; font-size: 17px; }

/* Unpriced state: JLC-style "Total: —" until an explicit calculate. */
.zbotic-jlc3dp-unpriced-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 17px; }
.zbotic-jlc3dp-unpriced-dash { color: #98a2b3; }
#zbotic-jlc3dp-price-empty-hint { margin: 6px 0 0; }

/* Buttons */
.zbotic-jlc3dp-btn { border: 1px solid #c4cdd6; background: #fff; border-radius: 8px; padding: 10px 18px; cursor: pointer; font-size: 15px; }
.zbotic-jlc3dp-btn-primary { display: block; width: 100%; margin-top: 14px; background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 700; }
.zbotic-jlc3dp-btn-primary:hover:not(:disabled) { background: #1d4fd8; }
.zbotic-jlc3dp-btn:disabled { opacity: .5; cursor: not-allowed; }
.zbotic-jlc3dp-calc-btn { margin: 0 0 14px; }

/* Mobile: single column, viewer/price flow after the configurator */
@media (max-width: 900px) {
	.zbotic-jlc3dp-app { grid-template-columns: 1fr; }
	.zbotic-jlc3dp-side { position: static; }
	.zbotic-jlc3dp-viewer { height: 240px; }
}
@media (max-width: 600px) {
	.zbotic-jlc3dp-materials { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Embedded mode (inside zbotic-3dprint's order page, #tdp-handoff-slot):
   one full-width column — no 360px side column, no sticky price panel. The
   .zbotic-jlc3dp-embedded class is stamped on the container by the JS at
   embedded boot. */
.zbotic-jlc3dp-app.zbotic-jlc3dp-embedded { display: block; max-width: none; }
.zbotic-jlc3dp-embedded .zbotic-jlc3dp-side { position: static; display: block; }
.zbotic-jlc3dp-embedded .zbotic-jlc3dp-side .zbotic-jlc3dp-card { margin-bottom: 16px; }
.tdp-handoff-notice { background:#eef4ff; border:1px solid #b9ccf0; border-radius:8px; padding:12px 14px; margin-bottom:14px; font-size:14px; line-height:1.5; }
.jlc-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
