.ctd-designer-wrap {
	margin: 24px 0;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 20px;
	background: #fafafa;
}

.ctd-loading {
	text-align: center;
	color: #888;
	padding: 40px 0;
}

.ctd-designer {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
}

.ctd-stage {
	flex: 1 1 320px;
	max-width: 520px;
	text-align: center;
}

.ctd-angle-tabs {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-bottom: 12px;
}

.ctd-angle-btn {
	padding: 6px 14px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
}

.ctd-angle-btn.active {
	background: #222;
	color: #fff;
	border-color: #222;
}

.ctd-canvas-holder {
	position: relative;
	margin: 0 auto;
	max-width: 100%;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

/*
 * The mockup photo is intentionally NOT a separate <img> positioned with
 * absolute/z-index. fabric.js wraps the canvas it's given in its own
 * <div class="canvas-container">, force-sets that wrapper to
 * position:relative via inline styles, and keeps that wrapper's CSS
 * width/height in sync whenever canvas.setWidth()/setHeight() runs (see
 * fabric's _initWrapperElement / _setCssDimension). Trying to override that
 * wrapper's position to "absolute" and stack a separate <img> behind it
 * with z-index is fighting fabric's own layout rather than working with it,
 * and is what caused the design to intermittently render behind the mockup.
 * Using the mockup photo as a CSS background-image on the holder itself
 * removes the competing element entirely — there is nothing left for the
 * canvas wrapper to be "behind".
 */

.ctd-drag-hint {
	font-size: 12px;
	color: #888;
	margin-top: 10px;
}

.ctd-controls {
	flex: 1 1 280px;
	max-width: 360px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.ctd-control-group h4 {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
}

.ctd-color-swatches,
.ctd-design-grid,
.ctd-sticker-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ctd-color-swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #ddd;
	cursor: pointer;
	padding: 0;
}

.ctd-color-swatch.active {
	border-color: #222;
	box-shadow: 0 0 0 2px #fff inset;
}

.ctd-design-thumb,
.ctd-sticker-thumb {
	width: 56px;
	height: 56px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	padding: 4px;
}

.ctd-design-thumb img,
.ctd-sticker-thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ctd-file-input {
	width: 100%;
}

.ctd-upload-status {
	font-size: 12px;
	min-height: 16px;
	color: #2a7a2a;
}

.ctd-upload-status.ctd-error {
	color: #c0392b;
}

.ctd-text-input {
	width: 100%;
	padding: 6px 8px;
	margin-bottom: 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.ctd-text-row {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
}

.ctd-font-select {
	flex: 1;
}

.ctd-text-color {
	width: 40px;
	padding: 0;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.ctd-element-controls .button {
	width: 100%;
}

.ctd-reset-btn {
	width: 100%;
}

/* Currency display block (single product page) */
.ctd-currency-block {
	margin: 6px 0 14px;
	font-size: 13px;
	color: #555;
}

.ctd-currency-equivalents {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 4px;
}

.ctd-equiv {
	background: #f1f1f1;
	border-radius: 4px;
	padding: 2px 8px;
}

.ctd-currency-switcher-label select {
	margin-left: 4px;
}

.ctd-currency-disclaimer {
	font-size: 11px;
	color: #999;
	margin: 4px 0 0;
}

.ctd-cart-preview-thumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
}

.ctd-order-preview img {
	display: block;
}

@media ( max-width: 600px ) {
	.ctd-designer {
		flex-direction: column;
	}
	.ctd-stage,
	.ctd-controls {
		max-width: 100%;
	}
}
