.tdcp-split-container {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 24px;
	max-width: 1280px;
	margin: 24px auto;
	padding: 0 16px;
	box-sizing: border-box;
	font-family: inherit;
}

.tdcp-viewer-panel,
.tdcp-controls-panel {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 18px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
	box-sizing: border-box;
}

.tdcp-viewer-panel {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 520px;
	position: sticky;
	top: 20px;
	align-self: start;
}

.tdcp-viewer-header,
.tdcp-viewer-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.tdcp-vista-modo {
	display: flex;
	gap: 6px;
	width: 100%;
}

.tdcp-vista-modo .tdcp-btn-mini {
	background: #e2e8f0;
	color: #0f172a;
}

.tdcp-vista-modo .tdcp-btn-mini.is-active {
	background: #0f172a;
	color: #ffffff;
}

.tdcp-badge {
	background: #0f172a;
	color: #f8fafc;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 999px;
}

.tdcp-viewer-hint,
.tdcp-medidas-pill {
	font-size: 12px;
	color: #475569;
}

.tdcp-medidas-pill {
	background: #f1f5f9;
	padding: 5px 10px;
	border-radius: 8px;
	font-weight: 600;
}

.tdcp-canvas-wrapper {
	position: relative;
	width: 100%;
	height: 410px;
	margin: 12px 0;
	border-radius: 10px;
	overflow: hidden;
	background: radial-gradient(circle at top, #f8fafc 0%, #e2e8f0 100%);
}

#tdcp-3d-canvas {
	width: 100%;
	height: 100%;
	display: block;
}

.tdcp-preview-png-wrap {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px;
	background: #0f172a;
}

.tdcp-preview-png-wrap[hidden] {
	display: none !important;
}

.tdcp-preview-png {
	max-width: 100%;
	max-height: calc(100% - 36px);
	object-fit: contain;
	border-radius: 6px;
}

.tdcp-preview-png-caption {
	margin: 0;
	font-size: 12px;
	color: #cbd5e1;
	text-align: center;
}

.tdcp-spinner-overlay {
	position: absolute;
	inset: 0;
	background: rgba(248, 250, 252, 0.82);
	backdrop-filter: blur(2px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	z-index: 10;
}

.tdcp-spinner-overlay[hidden] {
	display: none;
}

.tdcp-spinner {
	width: 38px;
	height: 38px;
	border: 4px solid #cbd5e1;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: tdcp-spin 0.8s linear infinite;
}

.tdcp-spinner-text {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
}

@keyframes tdcp-spin {
	to {
		transform: rotate(360deg);
	}
}

.tdcp-title {
	margin: 0 0 16px;
	font-size: 22px;
	color: #0f172a;
}

.tdcp-group {
	margin-bottom: 16px;
}

.tdcp-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.tdcp-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 6px;
}

.tdcp-label-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.tdcp-select,
.tdcp-file-input,
.tdcp-text,
.tdcp-number {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
	color: #0f172a;
	box-sizing: border-box;
}

.tdcp-number {
	width: 110px;
	text-align: center;
}

.tdcp-range {
	width: 100%;
	cursor: pointer;
}

.tdcp-help {
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.45;
	color: #64748b;
}

.tdcp-cupo-contador {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: #334155;
}

.tdcp-cupo-contador.is-empty {
	color: #b91c1c;
}

.tdcp-cupo-contador strong {
	font-weight: 700;
}

.tdcp-group.is-disabled {
	opacity: 0.42;
	pointer-events: none;
}

.tdcp-colores-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tdcp-color-item {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	padding: 6px 8px;
	border-radius: 8px;
}

.tdcp-color-item.is-merge-source {
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.tdcp-merge-color {
	border: none;
	background: transparent;
	color: #1d4ed8;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	padding: 0 4px;
}

.tdcp-color-item input[type="color"] {
	width: 30px;
	height: 26px;
	border: none;
	padding: 0;
	background: transparent;
	cursor: pointer;
}

.tdcp-color-role {
	font-size: 11px;
	font-weight: 600;
	color: #475569;
}

.tdcp-remove-color {
	border: none;
	background: transparent;
	color: #dc2626;
	font-weight: 700;
	cursor: pointer;
	padding: 0 4px;
}

.tdcp-cotizador-box {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.tdcp-qty-row,
.tdcp-resumen-linea,
.tdcp-resumen-total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.tdcp-resumen-total {
	font-size: 18px;
	color: #0f172a;
	margin-bottom: 14px;
}

.tdcp-aviso-oculto {
	display: none;
}

.tdcp-aviso-visible {
	display: block;
	color: #b91c1c;
	background: #fef2f2;
	border: 1px solid #fecaca;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 12px;
	margin-bottom: 10px;
}

.tdcp-aviso-visible.tdcp-aviso-ams,
.tdcp-aviso-visible.tdcp-aviso-info {
	color: #92400e;
	background: #fffbeb;
	border-color: #fcd34d;
}

.tdcp-link-btn {
	display: inline;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	color: #1d4ed8;
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

.tdcp-modal {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.tdcp-modal[hidden] {
	display: none !important;
}

.tdcp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
}

.tdcp-modal-panel {
	position: relative;
	z-index: 1;
	width: min(560px, 100%);
	max-height: min(90vh, 640px);
	overflow: auto;
	background: #fff;
	border-radius: 12px;
	padding: 20px 22px 18px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}

.tdcp-modal-title {
	margin: 0 28px 10px 0;
	font-size: 18px;
	color: #0f172a;
}

.tdcp-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: none;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
}

.tdcp-modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.tdcp-modal-actions .tdcp-btn-primary,
.tdcp-modal-actions .tdcp-btn-secondary {
	flex: 1 1 140px;
}

.tdcp-medidas-table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 10px;
	font-size: 12px;
}

.tdcp-medidas-table th,
.tdcp-medidas-table td {
	border: 1px solid #e2e8f0;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}

.tdcp-medidas-table th {
	background: #f8fafc;
	color: #0f172a;
	font-weight: 700;
}

.tdcp-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 10px;
}

.tdcp-btn-block {
	width: 100%;
	padding: 12px 16px;
	font-size: 14px;
}

#tdcp-ver-llavero {
	margin-top: 8px;
}

.tdcp-btn-primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.tdcp-btn-primary,
.tdcp-btn-secondary,
.tdcp-btn-mini {
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	transition: opacity 0.15s ease;
}

.tdcp-btn-primary:hover,
.tdcp-btn-secondary:hover,
.tdcp-btn-mini:hover {
	opacity: 0.9;
}

.tdcp-btn-primary {
	width: 100%;
	padding: 12px 16px;
	background: #0f172a;
	color: #ffffff;
	font-size: 15px;
}

.tdcp-btn-secondary {
	padding: 6px 12px;
	background: #e2e8f0;
	color: #0f172a;
	font-size: 12px;
}

.tdcp-btn-mini {
	padding: 5px 10px;
	background: #2563eb;
	color: #ffffff;
	font-size: 12px;
}

.tdcp-resumen-box {
	margin-top: 12px;
	padding: 12px;
	background: #0f172a;
	color: #e2e8f0;
	border-radius: 8px;
	font-size: 12px;
	overflow-x: auto;
	white-space: pre-wrap;
}

@media (max-width: 900px) {
	.tdcp-split-container {
		grid-template-columns: 1fr;
	}

	.tdcp-viewer-panel {
		position: static;
		min-height: 420px;
	}

	.tdcp-canvas-wrapper {
		height: 310px;
	}

	.tdcp-grid-2 {
		grid-template-columns: 1fr;
	}
}