/**
 * Canvas3D Customizer — public stylesheet (Phase 6 redesign)
 *
 * Layout: sizes on top → big 2D editor (with bleed + cut lines + "View in 3D"
 * button) → adjustments toolbar + filters → warnings → confirm bar.
 * The 3D viewer opens as a 90%-screen lightbox.
 */

.c3dc-configurator {
	--c3dc-primary: #0073aa;
	--c3dc-primary-dark: #005f8a;
	--c3dc-text: #1a1f24;
	--c3dc-text-muted: #6b7280;
	--c3dc-border: #e5e7eb;
	--c3dc-surface: #f8fafc;
	--c3dc-surface-2: #f1f3f6;
	--c3dc-bg: #ffffff;
	--c3dc-radius: 14px;
	--c3dc-radius-sm: 8px;
	--c3dc-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
	--c3dc-shadow: 0 6px 24px -8px rgba(15, 23, 42, 0.18);
	--c3dc-shadow-lg: 0 18px 50px -12px rgba(15, 23, 42, 0.35);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
	color: var(--c3dc-text);
	background: var(--c3dc-bg);
	border-radius: var(--c3dc-radius);
	box-shadow: var(--c3dc-shadow);
	margin: 18px auto;
	width: 100%;
	max-width: 1080px;
	overflow: hidden;
	box-sizing: border-box;
}

.c3dc-configurator *,
.c3dc-configurator *::before,
.c3dc-configurator *::after {
	box-sizing: border-box;
}

/* ============================================================
   Empty / loading / status states
   ============================================================ */
.c3dc-empty,
.c3dc-loading-placeholder {
	padding: 60px 24px;
	text-align: center;
	color: var(--c3dc-text-muted);
	font-size: 14px;
}

.c3dc-status {
	padding: 12px 18px;
	border-radius: var(--c3dc-radius-sm);
	font-size: 13px;
	margin: 14px 24px;
}
.c3dc-status.is-loading {
	background: rgba(0, 115, 170, 0.08);
	color: var(--c3dc-primary-dark);
}
.c3dc-status.is-error {
	background: #fef2f2;
	color: #991b1b;
}

/* ============================================================
   Upload screen
   ============================================================ */
.c3dc-app-upload {
	padding: 24px;
}

.c3dc-upload-zone {
	border: 2px dashed var(--c3dc-border);
	border-radius: var(--c3dc-radius);
	padding: 60px 24px;
	text-align: center;
	background: var(--c3dc-surface);
	cursor: pointer;
	transition: all 0.18s ease;
	min-height: 280px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.c3dc-upload-zone:hover,
.c3dc-upload-zone.is-dragging {
	background: rgba(0, 115, 170, 0.04);
	border-color: var(--c3dc-primary);
}
.c3dc-upload-zone.is-uploading {
	cursor: progress;
	opacity: 0.75;
}
/* When the UploadZone lives inside the integrated stage (no image yet),
   it doesn't need to be as tall — the size picker & size banner sit above it. */
.c3dc-stage-empty .c3dc-upload-zone {
	padding: 32px 20px;
	min-height: 200px;
	width: 100%;
	max-width: 480px;
}
.c3dc-upload-icon { font-size: 42px; margin-bottom: 14px; }
.c3dc-upload-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.c3dc-upload-sub { font-size: 14px; color: var(--c3dc-text-muted); margin-bottom: 18px; }
.c3dc-upload-formats {
	font-size: 12px;
	letter-spacing: 0.4px;
	color: var(--c3dc-text-muted);
	text-transform: uppercase;
}

/* Upload progress bar */
.c3dc-upload-progress {
	width: 70%;
	max-width: 320px;
	height: 8px;
	background: rgba(0,0,0,0.08);
	border-radius: 999px;
	margin: 14px auto 8px;
	overflow: hidden;
	position: relative;
}
.c3dc-upload-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #d4a017 0%, #b8870b 100%);
	border-radius: 999px;
	transition: width 0.15s ease-out;
	min-width: 4px;
}

/* ============================================================
   Main layout (post-upload)
   ============================================================ */
.c3dc-layout-v2 {
	display: flex;
	flex-direction: column;
}

.c3dc-section {
	padding: 14px 20px;
}
.c3dc-section + .c3dc-section {
	border-top: 1px solid var(--c3dc-border);
}

/* ── Section 1: sizes bar (top, horizontal) ─────────────────── */
.c3dc-sizes-bar {
	background: var(--c3dc-surface);
}

/* Grouped picker: each group has a title and one or two orientations
   on the SAME row (Vertical [sizes] Horizontal [sizes]). */
.c3dc-picker {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.c3dc-picker-bar {
	gap: 18px;
}

.c3dc-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.c3dc-group-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--c3dc-text-muted);
	margin: 0;
}
.c3dc-group-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.c3dc-group-row-orientation {
	padding: 4px 0;
}
.c3dc-group-row-orientation + .c3dc-group-row-orientation {
	border-top: 1px dashed var(--c3dc-border);
	margin-top: 2px;
	padding-top: 8px;
}
.c3dc-group-subtitle {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--c3dc-text-muted);
	white-space: nowrap;
	min-width: 76px;
}

.c3dc-size {
	border: 1.5px solid #3a3a3a;
	background: #1e1e1e;
	border-radius: 8px;
	padding: 6px 12px;
	display: inline-flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	transition: all 0.18s ease;
	font: inherit;
	line-height: 1.2;
	min-height: 34px;
	color: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.c3dc-size:hover {
	border-color: #555;
	background: #2a2a2a;
}
.c3dc-size.is-active {
	background: linear-gradient(180deg, #d4a017 0%, #b8870b 100%);
	border-color: #b8870b;
	color: #111;
	box-shadow: 0 2px 6px rgba(180, 130, 0, 0.45);
}
.c3dc-size-dims,
.c3dc-size-price {
	display: inline !important;
	color: inherit;
	white-space: nowrap;
}
.c3dc-size-dims {
	font-weight: 700;
	font-size: 13px;
}
.c3dc-size-price {
	font-size: 12px;
	font-weight: 500;
	opacity: 0.78;
}
.c3dc-size-price::before {
	content: '·';
	margin-right: 4px;
	opacity: 0.5;
}
.c3dc-size.is-active .c3dc-size-dims,
.c3dc-size.is-active .c3dc-size-price {
	color: #111;
	opacity: 1;
}

/* Mobile: even more compact */
@media (max-width: 640px) {
	.c3dc-size {
		padding: 4px 8px;
		min-height: 26px;
		border-radius: 6px;
		gap: 5px;
	}
	.c3dc-size-dims  { font-size: 11px; }
	.c3dc-size-price { font-size: 10px; }
	.c3dc-size-price::before { margin-right: 3px; }
	.c3dc-group-row { gap: 4px; }
	.c3dc-group-title { font-size: 11px; margin: 4px 0 2px; }
	.c3dc-group-row-orientation { padding: 2px 0; }
	.c3dc-group-row-orientation + .c3dc-group-row-orientation {
		padding-top: 4px;
		margin-top: 1px;
	}
}

/* ── Section 2: stage (big 2D editor) ───────────────────────── */
.c3dc-stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
	padding-top: 16px;
	padding-bottom: 8px;
}
/* Empty stage (before photo uploaded) — hosts UploadZone */
.c3dc-stage-empty {
	padding-top: 20px;
	padding-bottom: 20px;
}

.c3dc-adjustments {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--c3dc-bg);
	padding-top: 6px;
}

.c3dc-canvas-wrap {
	position: relative;
	display: inline-block;
	border-radius: var(--c3dc-radius-sm);
	overflow: hidden;
	box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.25);
	background: #ececec;
}
.c3dc-canvas {
	display: block;
	cursor: grab;
}
.c3dc-canvas:active { cursor: grabbing; }

.c3dc-view-3d-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: rgba(15, 23, 42, 0.85);
	color: #fff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: all 0.18s ease;
	box-shadow: 0 6px 18px -4px rgba(15, 23, 42, 0.35);
}
.c3dc-view-3d-btn:hover {
	background: var(--c3dc-primary);
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -4px rgba(0, 115, 170, 0.45);
}

.c3dc-change-image-btn {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: rgba(15, 23, 42, 0.85);
	color: #fff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: all 0.18s ease;
	box-shadow: 0 6px 18px -4px rgba(15, 23, 42, 0.35);
	z-index: 5;
}
.c3dc-change-image-btn:hover {
	background: #d4a017;
	color: #111;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -4px rgba(212, 160, 23, 0.55);
}
.c3dc-change-image-icon {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	text-align: center;
	line-height: 18px;
	font-size: 13px;
}
@media (max-width: 480px) {
	.c3dc-change-image-btn {
		padding: 8px 12px;
		font-size: 12px;
	}
	.c3dc-change-image-lbl { display: none; }
	.c3dc-change-image-icon {
		width: 22px;
		height: 22px;
		line-height: 22px;
		font-size: 15px;
	}
}
.c3dc-view-3d-icon {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(255,255,255,0.2);
	text-align: center;
	line-height: 18px;
	font-size: 13px;
}

/* Cut-line legend under the canvas */
.c3dc-cut-legend {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 14px;
	font-size: 12px;
	color: var(--c3dc-text-muted);
}
.c3dc-cut-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.c3dc-cut-legend-line {
	display: inline-block;
	width: 26px;
	height: 0;
	border-top-width: 2px;
	border-top-style: solid;
	font-style: normal;
}
.c3dc-cut-line-inner { border-top-style: dashed; border-color: #e53935; }
.c3dc-cut-line-outer { border-top-style: dashed; border-color: rgba(229,57,53,0.6); }
.c3dc-cut-legend-bottom {
	padding: 14px 16px;
	border-top: 1px solid var(--c3dc-border);
	margin-top: 0;
	background: var(--c3dc-bg);
}
.c3dc-cut-legend-hint {
	flex-basis: 100%;
	text-align: center;
	font-size: 11px;
	color: var(--c3dc-text-muted);
	font-style: italic;
	margin-top: 2px;
}

/* ── Section 3: adjustments toolbar + filters ───────────────── */
.c3dc-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	padding: 12px;
	background: var(--c3dc-surface);
	border-radius: 999px;
	border: 1px solid var(--c3dc-border);
	width: fit-content;
	margin: 0 auto;
}

.c3dc-tool {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: var(--c3dc-bg);
	color: var(--c3dc-text);
	cursor: pointer;
	font: inherit;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
	box-shadow: var(--c3dc-shadow-sm);
}
.c3dc-tool:hover {
	background: var(--c3dc-primary);
	color: #fff;
}
.c3dc-tool.is-active {
	background: var(--c3dc-primary);
	color: #fff;
}

/* Capture buttons (Grabar vídeo / Captura PNG) — pill-shaped with text. */
.c3dc-tool-rec,
.c3dc-tool-snap {
	width: auto;
	border-radius: 999px;
	padding: 0 16px;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	white-space: nowrap;
}
.c3dc-tool-snap:hover {
	background: #1e1e1e !important;
	color: #fff !important;
}
.c3dc-tool-rec {
	background: #dc2626 !important;
	color: #fff !important;
}
.c3dc-tool-rec:hover {
	background: #b91c1c !important;
	color: #fff !important;
}
.c3dc-tool-rec.is-recording {
	background: #dc2626 !important;
	color: #fff !important;
	animation: c3dc-rec-pulse 1.4s ease-in-out infinite;
}
.c3dc-tool-rec.is-recording:hover {
	background: #b91c1c !important;
}

/* Mobile: shrink capture buttons so they fit alongside play/reset. */
@media (max-width: 640px) {
	.c3dc-tool-rec,
	.c3dc-tool-snap {
		width: 40px;
		padding: 0;
		border-radius: 50%;
		font-size: 16px;
		min-width: 40px;
		justify-content: center;
		gap: 0;
	}
	/* Hide text labels on mobile — only the icon shows */
	.c3dc-rec-label-text,
	.c3dc-snap-label-text {
		display: none !important;
	}
	/* While recording, switch to pill shape that also shows the countdown */
	.c3dc-tool-rec.is-recording {
		width: auto;
		min-width: 56px;
		padding: 0 12px;
		border-radius: 999px;
		gap: 4px;
	}
	.c3dc-tool-rec.is-recording .c3dc-rec-icon {
		font-size: 14px;
	}
	.c3dc-rec-countdown {
		font-size: 12px;
		font-weight: 700;
	}
}

/* On desktop, the countdown sits next to the label naturally */
.c3dc-rec-countdown {
	font-weight: 700;
	margin-left: 2px;
}
.c3dc-rec-progress {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.c3dc-rec-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: c3dc-rec-blink 0.9s ease-in-out infinite;
}
@keyframes c3dc-rec-blink {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.3; }
}
@keyframes c3dc-rec-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
	50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

/* Filter panel */
.c3dc-filter-panel {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	padding: 18px;
	background: var(--c3dc-surface);
	border-radius: var(--c3dc-radius);
	border: 1px solid var(--c3dc-border);
}
@media (min-width: 720px) {
	.c3dc-filter-panel {
		grid-template-columns: 1fr 1.4fr auto;
		align-items: start;
	}
}

/* Preset filter list — CanvasPop-style vertical list with real thumbnails */
.c3dc-preset-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	margin-bottom: 20px;
}
.c3dc-preset-row {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 14px;
	padding: 10px 14px;
	background: #fff;
	border: none;
	border-bottom: 1px solid #f1f1f1;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
	color: #111;
	text-align: left;
	width: 100%;
	min-height: 60px;
}
.c3dc-preset-row:last-child { border-bottom: none; }
.c3dc-preset-row:hover { background: #fafbfc; }
.c3dc-preset-row.is-active { background: #fff8e5; }

.c3dc-preset-check {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: transparent;
	color: transparent;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
	border: 2px solid #e5e7eb;
	transition: all 0.15s ease;
}
.c3dc-preset-row.is-active .c3dc-preset-check {
	background: #d4a017;
	border-color: #d4a017;
	color: #fff;
}

.c3dc-preset-thumb-wrap {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	background: #f5f5f5;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	border: 1.5px solid #e5e7eb;
}
.c3dc-preset-thumb {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.c3dc-preset-thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.c3dc-preset-label {
	font-weight: 600;
	font-size: 14px;
	color: #111 !important;
	flex: 1;
}

/* Adjustment section title */
.c3dc-adjust-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.1px;
	color: #6b7280 !important;
	margin: 0 0 10px;
}

.c3dc-sliders {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 6px 16px;
}
@media (max-width: 640px) {
	.c3dc-sliders { grid-template-columns: 1fr; gap: 4px; }
}

.c3dc-slider {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 12px;
}
.c3dc-slider-lbl {
	display: flex;
	justify-content: space-between;
	color: var(--c3dc-text-muted);
	font-weight: 500;
}
.c3dc-slider-lbl em {
	font-style: normal;
	color: var(--c3dc-text);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.c3dc-slider input[type="range"] {
	width: 100%;
	accent-color: var(--c3dc-primary);
}

.c3dc-filter-footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
}

.c3dc-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	cursor: pointer;
}

.c3dc-link {
	background: none;
	border: none;
	color: var(--c3dc-primary);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	padding: 0;
	text-decoration: underline;
}
.c3dc-link:hover { color: var(--c3dc-primary-dark); }

.c3dc-change-image {
	align-self: center;
	background: none;
	border: 1px solid var(--c3dc-border);
	border-radius: 999px;
	padding: 8px 18px;
	color: var(--c3dc-text-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s ease;
}
.c3dc-change-image:hover {
	color: var(--c3dc-primary);
	border-color: var(--c3dc-primary);
}

/* ── Warnings ───────────────────────────────────────────────── */
.c3dc-warnings {
	padding: 12px 28px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.c3dc-warning {
	padding: 10px 14px;
	border-radius: var(--c3dc-radius-sm);
	font-size: 13px;
	background: #fffbeb;
	color: #92400e;
	border-left: 4px solid #f59e0b;
}
.c3dc-warning-error {
	background: #fef2f2;
	color: #991b1b;
	border-left-color: #dc2626;
}
.c3dc-warning-icon { margin-right: 6px; }

/* ── Quality badge (traffic light: green / yellow / red) ────── */
.c3dc-quality {
	margin: 8px 20px 0;
	padding: 8px 12px;
	border-radius: var(--c3dc-radius-sm);
	font-size: 13px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 10px;
	border-left: 4px solid;
}
.c3dc-quality-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
}
.c3dc-quality-msg {
	line-height: 1.4;
	font-weight: 600 !important;
}
.c3dc-quality-green {
	background: #d1fae5;
	color: #064e3b !important;
	border-left-color: #059669;
}
.c3dc-quality-green .c3dc-quality-msg { color: #064e3b !important; }
.c3dc-quality-green .c3dc-quality-dot { background: #059669; }

.c3dc-quality-yellow {
	background: #fef3c7;
	color: #78350f !important;
	border-left-color: #d97706;
}
.c3dc-quality-yellow .c3dc-quality-msg { color: #78350f !important; }
.c3dc-quality-yellow .c3dc-quality-dot { background: #d97706; }

.c3dc-quality-red {
	background: #fee2e2;
	color: #7f1d1d !important;
	border-left-color: #dc2626;
}
.c3dc-quality-red .c3dc-quality-msg { color: #7f1d1d !important; }
.c3dc-quality-red .c3dc-quality-dot { background: #dc2626; }

/* ── Confirm bar ────────────────────────────────────────────── */
.c3dc-confirm-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 28px 24px;
	background: var(--c3dc-bg);
	border-top: 1px solid var(--c3dc-border);
	flex-wrap: wrap;
}
.c3dc-price {
	display: flex;
	flex-direction: column;
}
.c3dc-price-lbl {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--c3dc-text-muted);
}
.c3dc-price-num {
	font-size: 26px;
	font-weight: 700;
}
.c3dc-confirm-btn {
	background: var(--c3dc-primary);
	color: #fff;
	border: none;
	border-radius: var(--c3dc-radius-sm);
	padding: 14px 28px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: var(--c3dc-shadow);
}
.c3dc-confirm-btn:hover:not(:disabled) {
	background: var(--c3dc-primary-dark);
	transform: translateY(-1px);
}
.c3dc-confirm-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ── 3D Lightbox ────────────────────────────────────────────── */
.c3dc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: c3dc-fade-in 0.2s ease;
}
@keyframes c3dc-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.c3dc-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}
.c3dc-lightbox-window {
	position: relative;
	width: 90vw;
	height: 90vh;
	background: linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: var(--c3dc-shadow-lg);
	animation: c3dc-zoom-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes c3dc-zoom-in {
	from { transform: scale(0.95); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

.c3dc-lightbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: rgba(255, 255, 255, 0.85);
	border-bottom: 1px solid var(--c3dc-border);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.c3dc-lightbox-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--c3dc-text);
}
.c3dc-lightbox-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: var(--c3dc-surface-2);
	color: var(--c3dc-text);
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
}
.c3dc-lightbox-close:hover {
	background: var(--c3dc-primary);
	color: #fff;
	transform: rotate(90deg);
}

.c3dc-lightbox-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 16px;
}

/* ── 3D viewer (inside the lightbox) ────────────────────────── */
.c3dc-viewer-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	width: 100%;
}
.c3dc-viewer-stage {
	flex: 1 1 0;
	min-height: 0;       /* lets it shrink so siblings stay visible */
	border-radius: var(--c3dc-radius);
	background: linear-gradient(180deg, #fafbfc 0%, #eaecef 100%);
	overflow: hidden;
	width: 100%;
}
.c3dc-viewer-controls {
	display: flex;
	gap: 8px;
	justify-content: center;
	padding: 8px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	border: 1px solid var(--c3dc-border);
	align-self: center;
	box-shadow: var(--c3dc-shadow-sm);
	flex: 0 0 auto;       /* always visible, never compressed */
}
.c3dc-viewer-hint {
	font-size: 12px;
	color: var(--c3dc-text-muted);
	text-align: center;
	letter-spacing: 0.3px;
	flex: 0 0 auto;
}

/* ── Resize handles overlay on the canvas ─────────────────── */
.c3dc-handles {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.c3dc-handle {
	position: absolute;
	width: 14px;
	height: 14px;
	margin-left: -7px;
	margin-top: -7px;
	background: #fff;
	border: 2px solid var(--c3dc-primary);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0,0,0,0.35);
	pointer-events: auto;
	cursor: nwse-resize;
	touch-action: none;
	transition: transform 0.12s ease, background 0.12s ease;
}
.c3dc-handle:hover { transform: scale(1.25); background: var(--c3dc-primary); }
.c3dc-handle-n,  .c3dc-handle-s  { cursor: ns-resize; }
.c3dc-handle-w,  .c3dc-handle-e  { cursor: ew-resize; }
.c3dc-handle-nw, .c3dc-handle-se { cursor: nwse-resize; }
.c3dc-handle-ne, .c3dc-handle-sw { cursor: nesw-resize; }

/* Lock-aspect tool active state */
.c3dc-tool-lock.is-active {
	background: var(--c3dc-primary);
	color: #fff;
}

/* ── Transform panel (free X/Y scaling) ─────────────────────── */
.c3dc-transform-panel {
	padding: 14px 18px;
	background: var(--c3dc-surface);
	border-radius: var(--c3dc-radius);
	border: 1px solid var(--c3dc-border);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.c3dc-transform-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.c3dc-transform-lock {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	cursor: pointer;
	user-select: none;
	color: var(--c3dc-text-muted);
}
.c3dc-transform-lock input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.c3dc-transform-lock-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--c3dc-bg);
	border: 1.5px solid var(--c3dc-border);
	font-size: 13px;
	transition: all 0.15s ease;
}
.c3dc-transform-lock input:checked + .c3dc-transform-lock-icon {
	background: var(--c3dc-primary);
	color: #fff;
	border-color: var(--c3dc-primary);
}
.c3dc-transform-lock-lbl { font-weight: 500; }

.c3dc-transform-sliders {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 18px;
}
@media (max-width: 480px) {
	.c3dc-transform-sliders { grid-template-columns: 1fr; }
}

/* ── Cut-line legend (extra variant for lateral/back lines) ── */
.c3dc-cut-line-lateral { border-top-style: dashed; border-color: #e53935; }
.c3dc-cut-line-back    { border-top-style: dashed; border-color: rgba(229,57,53,0.6); }

/* ── Shortcode embed ────────────────────────────────────────── */
.c3dc-configurator-shortcode {
	width: 100%;
	max-width: 100%;
	margin: 24px 0;
}

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 640px) {
	.c3dc-section { padding: 10px 14px; }
	.c3dc-confirm-bar { padding: 12px 14px 18px; }
	.c3dc-confirm-btn { width: 100%; }
	.c3dc-picker-bar { gap: 12px; }
	.c3dc-stage { padding-top: 12px; padding-bottom: 12px; }

	/* Keep the lightbox at 90% on mobile too (user request), and shrink the
	   header padding so the 3D + controls + hint all fit. */
	.c3dc-lightbox-window { width: 90vw; height: 90vh; border-radius: 14px; }
	.c3dc-lightbox-header { padding: 10px 14px; }
	.c3dc-lightbox-header h3 { font-size: 14px; }
	.c3dc-lightbox-close { width: 32px; height: 32px; }
	.c3dc-lightbox-body { padding: 10px; gap: 8px; }
	.c3dc-viewer-wrap { gap: 8px; }
	.c3dc-viewer-controls { padding: 6px; }
	.c3dc-viewer-controls .c3dc-tool { width: 36px; height: 36px; font-size: 16px; }
	.c3dc-viewer-hint { font-size: 11px; }
}
@media (max-width: 380px) {
	.c3dc-viewer-hint { display: none; } /* hide hint on very small screens */
}

/* ============================================================
   Size picker: single trigger button + modal sheet on ALL screen sizes
   (CanvasPop-style). Previously we showed open buttons on desktop and modal
   on mobile — now everyone sees the modal.
   ============================================================ */
.c3dc-picker-mobile { display: block; }
.c3dc-picker-desktop { display: none !important; }

/* Center the trigger button on wider screens so it doesn't stretch full-width. */
@media (min-width: 641px) {
	.c3dc-picker-mobile {
		max-width: 480px;
		margin: 0 auto;
	}
}

/* Trigger button (closed state) */
.c3dc-mtrigger {
	width: 100%;
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #ffffff;
	color: #1f2937;
	border: 1.5px solid #d1d5db;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	gap: 12px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
	min-height: 44px;
	transition: all 0.15s ease;
}
.c3dc-mtrigger:hover {
	border-color: #9ca3af;
	background: #fafbfc;
}
.c3dc-mtrigger.has-selection {
	background: #fff8e5;
	color: #78350f;
	border-color: #d4a017;
	box-shadow: 0 2px 8px rgba(212, 160, 23, 0.25);
}
.c3dc-mtrigger.has-selection:hover {
	background: #fef3c7;
	border-color: #b8870b;
}
.c3dc-mtrigger-label {
	flex: 1;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit;
}
.c3dc-mtrigger-caret {
	font-size: 16px;
	opacity: 0.85;
	color: inherit;
}

/* Modal backdrop */
.c3dc-msheet-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.55);
	z-index: 99998;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	animation: c3dc-fade-in 0.18s ease-out;
}
/* On desktop the sheet is centered on the viewport, not stuck to the bottom. */
@media (min-width: 641px) {
	.c3dc-msheet-backdrop {
		align-items: center;
		padding: 24px;
	}
}
@keyframes c3dc-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Modal sheet — bottom-sheet on phones, centered dialog on desktop. */
.c3dc-msheet {
	background: #fff;
	border-radius: 16px 16px 0 0;
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
	animation: c3dc-slide-up 0.22s ease-out;
}
@media (min-width: 641px) {
	.c3dc-msheet {
		border-radius: 16px;
		max-height: 84vh;
		box-shadow: 0 20px 60px rgba(0,0,0,0.35);
	}
}
@keyframes c3dc-slide-up {
	from { transform: translateY(40px); opacity: 0.4; }
	to   { transform: translateY(0); opacity: 1; }
}

.c3dc-msheet-header {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}
.c3dc-msheet-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	color: #111;
}
.c3dc-msheet-close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 4px 10px;
	margin: -4px -10px -4px 0;
}
.c3dc-msheet-close:hover { color: #111; }

.c3dc-msheet-body {
	padding: 12px 18px 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.c3dc-mgroup {
	margin-bottom: 16px;
}
.c3dc-mgroup-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.1px;
	color: #888;
	margin: 0 0 8px;
}
.c3dc-msub {
	margin-bottom: 10px;
}
.c3dc-msub-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #999;
	margin: 4px 0 6px;
}
/* Modal size rows — CanvasPop-style: vertical list, each row has a proportional
   preview thumbnail on the left, dims+price in the middle, check on the right. */
.c3dc-mgroup-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid #eee;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.c3dc-msize {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
	padding: 12px 14px;
	background: #fff;
	border: none;
	border-bottom: 1px solid #f1f1f1;
	border-radius: 0;
	font: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
	color: #111;
	min-height: 60px;
	text-align: left;
	width: 100%;
}
.c3dc-msize:last-child { border-bottom: none; }
.c3dc-msize:hover {
	background: #fafbfc;
}
.c3dc-msize.is-active {
	background: #fff8e5;
}

/* Check indicator (left column, always same width for alignment). */
.c3dc-msize-check {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: transparent;
	color: transparent;
	font-size: 14px;
	font-weight: 700;
	flex-shrink: 0;
	border: 2px solid #e5e7eb;
	transition: all 0.15s ease;
}
.c3dc-msize.is-active .c3dc-msize-check {
	background: #d4a017;
	border-color: #d4a017;
	color: #fff;
}

/* Preview wrap: fixed 48px box that centers the proportional preview inside. */
.c3dc-msize-preview-wrap {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex-shrink: 0;
}
.c3dc-msize-preview {
	display: inline-block;
	background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
	border: 1.5px solid #cbcbcb;
	border-radius: 3px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.c3dc-msize.is-active .c3dc-msize-preview {
	background: linear-gradient(135deg, #fff8e5 0%, #f5e5b8 100%);
	border-color: #b8870b;
}

/* Info column: dims stacked over price. */
.c3dc-msize-info {
	display: inline-flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	gap: 2px;
	flex: 1;
	min-width: 0;
}
.c3dc-msize-dims {
	display: block !important;
	font-weight: 700;
	font-size: 15px;
	color: #111 !important;
	line-height: 1.2;
	white-space: nowrap;
}
.c3dc-msize-price {
	display: block !important;
	font-size: 13px;
	font-weight: 600;
	color: #b8870b !important;
	line-height: 1.2;
	white-space: nowrap;
}

/* ============================================================
   Pick-size banner — shown inside the 2D stage when the customer
   hasn't selected a canvas size yet.
   ============================================================ */
.c3dc-pick-size-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	width: calc(100% - 32px);
	max-width: 540px;
	margin: 8px auto 4px;
	padding: 10px 14px;
	background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
	border: 1px solid #f59e0b;
	border-left: 4px solid #d97706;
	border-radius: 10px;
	color: #78350f !important;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	box-shadow: 0 4px 12px rgba(217, 119, 6, 0.18);
	animation: c3dc-pick-pulse 1.8s ease-in-out infinite;
}
.c3dc-pick-size-banner-icon {
	font-size: 22px;
	flex-shrink: 0;
	animation: c3dc-pick-bounce 1.2s ease-in-out infinite;
}
.c3dc-pick-size-banner-text {
	color: #78350f !important;
	flex: 1;
}
@keyframes c3dc-pick-pulse {
	0%, 100% { box-shadow: 0 4px 12px rgba(217, 119, 6, 0.18); }
	50%      { box-shadow: 0 4px 22px rgba(217, 119, 6, 0.35); }
}
@keyframes c3dc-pick-bounce {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-3px); }
}

@media (max-width: 640px) {
	.c3dc-pick-size-banner {
		margin: 10px 14px 4px;
		padding: 10px 12px;
		font-size: 13px;
		width: auto;
	}
	.c3dc-pick-size-banner-icon { font-size: 20px; }
}

/* ============================================================
   Post-recording processing overlay (FFmpeg fix for WhatsApp)
   ============================================================ */
.c3dc-proc-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 20;
	animation: c3dc-fade-in 0.15s ease-out;
}
.c3dc-proc-box {
	background: #fff;
	color: #111;
	border-radius: 16px;
	padding: 24px 28px;
	width: min(90%, 380px);
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.c3dc-proc-spinner {
	width: 42px;
	height: 42px;
	margin: 0 auto 14px;
	border-radius: 50%;
	border: 4px solid #e5e7eb;
	border-top-color: #d4a017;
	animation: c3dc-spin 0.9s linear infinite;
}
@keyframes c3dc-spin {
	to { transform: rotate(360deg); }
}
.c3dc-proc-title {
	font-size: 15px;
	font-weight: 700;
	color: #111 !important;
	margin-bottom: 12px;
	line-height: 1.35;
}
.c3dc-proc-progress {
	width: 100%;
	height: 8px;
	background: #f1f5f9;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 10px;
}
.c3dc-proc-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #d4a017 0%, #b8870b 100%);
	border-radius: 999px;
	transition: width 0.2s ease-out;
	min-width: 4px;
}
.c3dc-proc-hint {
	font-size: 12px;
	color: #64748b !important;
	line-height: 1.4;
}

/* Tools inside the "Girar, ampliar y ajustar" modal — give them room. */
.c3dc-msheet-body-tools .c3dc-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	padding: 8px 0;
}
.c3dc-msheet-body-tools .c3dc-tool {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: #f4f4f5;
	color: #111;
	border: 1.5px solid #e5e7eb;
	font-size: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.15s ease;
}
.c3dc-msheet-body-tools .c3dc-tool:hover {
	background: #fff8e5;
	border-color: #d4a017;
}
.c3dc-msheet-body-tools .c3dc-tool.is-active {
	background: #d4a017;
	color: #fff;
	border-color: #d4a017;
}

/* Adjust panel (always-visible sliders block between the two dropdowns) */
.c3dc-adjust-panel {
	margin: 4px 0;
	padding: 10px 14px;
	background: #fafbfc;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}
.c3dc-adjust-panel .c3dc-adjust-title {
	margin-bottom: 8px;
}

/* ============================================================
   Icon toolbar (CanvasPop-style bottom bar with SVG icons)
   ============================================================ */
.c3dc-icbar {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	gap: 4px;
	padding: 6px 4px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	margin-top: 8px;
}
.c3dc-ic {
	display: flex !important;
	flex-direction: column !important;
	align-items: center;
	justify-content: center;
	gap: 2px;
	flex: 1;
	padding: 8px 4px;
	background: transparent;
	border: none;
	border-radius: 8px;
	color: #1f2937;
	font: inherit;
	cursor: pointer;
	transition: all 0.15s ease;
	min-width: 0;
}
.c3dc-ic:hover {
	background: #fff8e5;
	color: #b8870b;
}
.c3dc-ic.is-active {
	background: #fff8e5;
	color: #b8870b;
}
.c3dc-ic-glyph {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}
.c3dc-ic-glyph svg {
	width: 22px;
	height: 22px;
}
.c3dc-ic-label {
	display: block !important;
	font-size: 11px;
	font-weight: 600;
	color: inherit;
	line-height: 1.2;
	margin-top: 2px;
	white-space: nowrap;
}
.c3dc-ic-sub {
	display: block !important;
	font-size: 10px;
	font-weight: 500;
	color: #b8870b !important;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Desktop: bar centered with max width */
@media (min-width: 641px) {
	.c3dc-icbar {
		max-width: 560px;
		margin-left: auto;
		margin-right: auto;
	}
	.c3dc-ic-label { font-size: 12px; }
	.c3dc-ic-glyph svg { width: 24px; height: 24px; }
}

/* Icon toolbar at TOP of the app — no top margin needed */
.c3dc-icbar-section {
	padding-top: 10px;
	padding-bottom: 4px;
}
.c3dc-icbar-section .c3dc-icbar {
	margin-top: 0;
}

/* Disabled state — greyed out until an image is uploaded */
.c3dc-ic.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
.c3dc-ic.is-disabled:hover {
	background: transparent;
	color: #1f2937;
}
