/* ── WooCommerce 3D Personalizer — frontend styles ──────────────────────── */

.wc3dp-personaliser {
	margin: 1.5em 0 2em;
	font-family: inherit;
}

.wc3dp-section-title {
	font-size: 1.1em;
	font-weight: 700;
	margin-bottom: 0.75em;
	color: #333;
	border-bottom: 2px solid #7952b3;
	padding-bottom: 0.35em;
}

/* ── 3-D viewer ──────────────────────────────────────────────────────────── */
.wc3dp-viewer-wrap {
	position: relative;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: #e8e8e8;
	margin-bottom: 1.25em;
	box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.wc3dp-canvas {
	display: block;
	width: 100% !important;
	height: 400px;
	border-radius: 10px;
	cursor: grab;
}

.wc3dp-canvas:active {
	cursor: grabbing;
}

.wc3dp-hint {
	position: absolute;
	bottom: 8px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 0.72em;
	color: rgba(0,0,0,0.45);
	pointer-events: none;
	margin: 0;
}

/* ── Design placement ────────────────────────────────────────────────────── */
.wc3dp-design-wrap {
	margin-bottom: 1.25em;
}

.wc3dp-design-canvas {
	display: block;
	width: 100%;
	max-width: 320px;
	aspect-ratio: 1 / 1;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #f4f4f4;
	cursor: grab;
	touch-action: none;
	margin-top: 0.4em;
}

.wc3dp-design-canvas:active {
	cursor: grabbing;
}

.wc3dp-hint-static {
	position: static;
	text-align: left;
	margin-top: 0.4em;
}

/* ── Zone tabs ────────────────────────────────────────────────────────────── */
.wc3dp-zone-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 0.5em;
}

.wc3dp-zone-tab {
	padding: 0.4em 0.9em;
	border: 1.5px solid #ddd;
	background: #fff;
	border-radius: 20px;
	font-size: 0.82em;
	font-weight: 600;
	color: #555;
	cursor: pointer;
	transition: all 0.15s;
}

.wc3dp-zone-tab.active {
	border-color: #7952b3;
	background: #7952b3;
	color: #fff;
}

/* ── Layers toolbar & list ───────────────────────────────────────────────── */
.wc3dp-layers-toolbar {
	display: flex;
	gap: 8px;
	margin-top: 0.6em;
}

.wc3dp-layers-list {
	list-style: none;
	margin: 0.6em 0 0;
	padding: 0;
	max-width: 320px;
	border: 1px solid #eee;
	border-radius: 6px;
	overflow: hidden;
}

.wc3dp-layers-list:empty {
	display: none;
}

.wc3dp-layer-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0.45em 0.6em;
	border-bottom: 1px solid #eee;
	cursor: pointer;
	font-size: 0.85em;
}

.wc3dp-layer-row:last-child {
	border-bottom: none;
}

.wc3dp-layer-row:hover {
	background: #f9f7fc;
}

.wc3dp-layer-row.active {
	background: #f1ecf9;
}

.wc3dp-layer-icon {
	flex: 0 0 auto;
	width: 20px;
	text-align: center;
	color: #7952b3;
	font-weight: 700;
}

.wc3dp-layer-name {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #444;
}

.wc3dp-layer-controls {
	flex: 0 0 auto;
	display: flex;
	gap: 4px;
}

.wc3dp-layer-btn {
	border: none;
	background: none;
	cursor: pointer;
	color: #888;
	font-size: 0.95em;
	padding: 2px 5px;
	border-radius: 3px;
}

.wc3dp-layer-btn:hover {
	background: #eee;
	color: #333;
}

.wc3dp-layer-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.wc3dp-layer-btn.wc3dp-layer-delete:hover {
	background: #fbe4e4;
	color: #c0392b;
}

/* ── Active layer editors ────────────────────────────────────────────────── */
.wc3dp-layer-editor {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 320px;
	margin-top: 0.6em;
	font-size: 0.82em;
	color: #666;
}

.wc3dp-layer-editor input[type="text"] {
	flex: 1;
	padding: 0.4em 0.6em;
	border: 1.5px solid #ddd;
	border-radius: 6px;
}

.wc3dp-layer-editor input[type="range"] {
	flex: 1;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.wc3dp-fields {
	display: flex;
	flex-direction: column;
	gap: 1.1em;
}

.wc3dp-field-group {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.wc3dp-label {
	font-weight: 600;
	font-size: 0.92em;
	color: #444;
}

.wc3dp-char-count {
	font-size: 0.78em;
	color: #888;
	text-align: right;
}

/* ── Colour swatches ─────────────────────────────────────────────────────── */
.wc3dp-color-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.wc3dp-swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.15s, border-color 0.15s;
	padding: 0;
	box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.wc3dp-swatch:hover {
	transform: scale(1.15);
}

.wc3dp-swatch.active {
	border-color: #7952b3;
	transform: scale(1.15);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7952b3;
}

.wc3dp-color-input {
	width: 40px;
	height: 32px;
	border: 1.5px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	padding: 2px;
	background: none;
}

.wc3dp-color-preview {
	display: inline-block;
	width: 20px;
	height: 20px;
	border-radius: 4px;
	border: 1px solid #ccc;
	vertical-align: middle;
	margin-left: 6px;
}

/* ── Image upload ────────────────────────────────────────────────────────── */
.wc3dp-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
}

.wc3dp-upload-hint {
	font-size: 0.76em;
	color: #aaa;
	margin: 0.4em 0 0;
}

/* ── Surcharge notice ────────────────────────────────────────────────────── */
.wc3dp-surcharge {
	font-size: 0.88em;
	color: #7952b3;
	font-weight: 600;
	margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media ( min-width: 768px ) {
	.wc3dp-fields {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 1.25em;
	}
	.wc3dp-viewer-wrap {
		margin-bottom: 1.5em;
	}
}

@media ( max-width: 480px ) {
	.wc3dp-canvas {
		height: 280px;
	}
}
