/* The default single-product block template splits the page into a fixed-width
   gallery column + summary column via a Gutenberg Columns block. This product
   has no meaningful photo (the configurator IS the product), so we hide the
   gallery column and let the summary column (title/price/configurator) use
   the full page width instead of being squeezed into half of it. */
body.single-product .wp-block-columns:has(.wp-block-woocommerce-product-image-gallery) > .wp-block-column:has(.wp-block-woocommerce-product-image-gallery) {
	display: none;
}

body.single-product .wp-block-columns:has(.wp-block-woocommerce-product-image-gallery) > .wp-block-column:not(:has(.wp-block-woocommerce-product-image-gallery)) {
	flex-basis: 100% !important;
	width: 100% !important;
	max-width: 100% !important;
}

.colmetics-configurator {
	--cm-ink: #2e2620;
	--cm-muted: #8a7d72;
	--cm-accent: #a9754a;
	--cm-accent-dark: #8f5f39;
	--cm-cream: #fbf7f2;
	--cm-line: #ece2d6;

	max-width: 960px;
	width: 100%;
	box-sizing: border-box;
	margin: 28px 0;
	padding: 32px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(46, 38, 32, 0.05), 0 12px 32px rgba(46, 38, 32, 0.07);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--cm-ink);
}

.colmetics-configurator__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 36px;
	align-items: start;
}

.colmetics-configurator__layout-canvas {
	position: sticky;
	top: 20px;
}

@media (max-width: 780px) {
	.colmetics-configurator__layout {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.colmetics-configurator__layout-canvas {
		position: static;
	}
}

.colmetics-configurator * {
	box-sizing: border-box;
}

.colmetics-configurator__step {
	margin-bottom: 24px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--cm-line);
}

.colmetics-configurator__step:last-of-type {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.colmetics-configurator__step-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: Georgia, "Playfair Display", serif;
	font-size: 17px;
	color: var(--cm-ink);
	margin-bottom: 16px;
}

.colmetics-configurator__step-label::before {
	content: counter(cm-step);
	counter-increment: cm-step;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--cm-accent);
	color: #fff;
	font-family: -apple-system, sans-serif;
	font-size: 13px;
	font-weight: 600;
	flex-shrink: 0;
}

.colmetics-configurator {
	counter-reset: cm-step;
}

.colmetics-configurator__faces {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	background: var(--cm-cream);
	padding: 5px;
	border-radius: 12px;
}

.colmetics-configurator__face-btn {
	flex: 1;
	min-height: 42px;
	padding: 10px;
	border: none;
	background: transparent;
	border-radius: 9px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: var(--cm-muted);
	transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.colmetics-configurator__face-btn.is-active {
	background: #fff;
	color: var(--cm-ink);
	box-shadow: 0 1px 3px rgba(46, 38, 32, 0.15);
}

.colmetics-configurator__canvas-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
	background: var(--cm-cream);
	border-radius: 12px;
	padding: 16px;
}

.colmetics-configurator__canvas-wrap canvas {
	max-width: 100%;
	height: auto;
	box-shadow: 0 2px 6px rgba(46, 38, 32, 0.1), 0 8px 20px rgba(46, 38, 32, 0.08);
	border-radius: 3px;
	touch-action: none;
	cursor: grab;
	background: #fff;
}

.colmetics-configurator__hint {
	font-size: 12.5px;
	color: var(--cm-muted);
	text-align: center;
	margin: 0 0 16px;
}

.colmetics-configurator__preview-row {
	display: flex;
	gap: 14px;
	margin-bottom: 14px;
}

.colmetics-configurator__preview-item {
	flex: 1;
	text-align: center;
}

.colmetics-configurator__preview-item span {
	display: block;
	font-size: 11px;
	color: var(--cm-muted);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 600;
}

.colmetics-configurator__preview-item canvas {
	width: 100%;
	height: auto;
	border-radius: 6px;
	background: var(--cm-cream);
	box-shadow: 0 1px 3px rgba(46, 38, 32, 0.12);
}

.colmetics-configurator__roll-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 9px;
	border: 1px solid var(--cm-line);
	background: #fff;
	border-radius: 10px;
	font-size: 13.5px;
	color: var(--cm-accent-dark);
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.colmetics-configurator__roll-btn:hover {
	background: var(--cm-cream);
	border-color: var(--cm-accent);
}

.colmetics-configurator__bg-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.colmetics-configurator__bg-swatch {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--cm-line);
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: box-shadow 0.15s, transform 0.15s;
}

.colmetics-configurator__bg-swatch:hover {
	transform: translateY(-1px);
}

.colmetics-configurator__bg-swatch.is-active {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cm-accent);
}

.colmetics-configurator__custom-swatch {
	position: relative;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	flex-shrink: 0;
	cursor: pointer;
	background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
	box-shadow: 0 0 0 1px var(--cm-line);
	display: block;
}

.colmetics-configurator__custom-swatch input[type="color"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	opacity: 0;
}

.colmetics-configurator__roll-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(30, 24, 20, 0.75);
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.colmetics-configurator__roll-modal-inner {
	background: #fff;
	border-radius: 14px;
	padding: 24px;
	max-width: 95vw;
	max-height: 90vh;
	overflow: auto;
	position: relative;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.colmetics-configurator__roll-canvas {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

.colmetics-configurator__roll-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: var(--cm-cream);
	color: var(--cm-ink);
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s;
}

.colmetics-configurator__roll-close:hover {
	background: var(--cm-line);
}

.colmetics-configurator__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.colmetics-configurator__toolbar button,
.colmetics-configurator__add-photo-label {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	line-height: 1;
	margin: 0;
	box-sizing: border-box;
	flex: 1;
	min-width: 150px;
	height: 46px;
	text-align: center;
	padding: 0 16px;
	border: 1px solid var(--cm-accent);
	background: #fff;
	border-radius: 23px;
	cursor: pointer;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--cm-accent-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
}

.colmetics-configurator__toolbar button:hover,
.colmetics-configurator__add-photo-label:hover {
	background: var(--cm-accent);
	color: #fff;
}

.colmetics-configurator__element-panel {
	margin: 18px 0 0;
	padding: 18px;
	background: var(--cm-cream);
	border-radius: 12px;
}

.colmetics-configurator__field {
	margin-bottom: 16px;
}

.colmetics-configurator__field:last-child {
	margin-bottom: 0;
}

.colmetics-configurator__field label {
	display: block;
	font-size: 12.5px;
	color: var(--cm-muted);
	margin-bottom: 8px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.colmetics-configurator__field input[type="text"] {
	width: 100%;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid var(--cm-line);
	border-radius: 10px;
	font-size: 16px;
	box-sizing: border-box;
	background: #fff;
}

.colmetics-configurator__field input[type="text"]:focus {
	outline: none;
	border-color: var(--cm-accent);
}

.colmetics-configurator__swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.colmetics-configurator__swatch {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--cm-line);
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: box-shadow 0.15s;
}

.colmetics-configurator__swatch.is-active {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cm-accent);
}

.colmetics-configurator__el-fonts,
.colmetics-configurator__el-shapes {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.colmetics-configurator__el-fonts button,
.colmetics-configurator__el-shapes button {
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--cm-line);
	background: #fff;
	border-radius: 20px;
	font-size: 13px;
	cursor: pointer;
	color: var(--cm-ink);
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.colmetics-configurator__el-fonts button.is-active,
.colmetics-configurator__el-shapes button.is-active {
	background: var(--cm-accent);
	color: #fff;
	border-color: var(--cm-accent);
}

.colmetics-configurator__el-delete {
	width: 100%;
	min-height: 42px;
	padding: 9px;
	border: 1px solid transparent;
	background: transparent;
	color: #a33;
	border-radius: 10px;
	cursor: pointer;
	font-size: 13px;
	margin-top: 6px;
	transition: background 0.15s;
}

.colmetics-configurator__el-delete:hover {
	background: rgba(170, 51, 51, 0.08);
}

.colmetics-configurator__status {
	font-size: 13px;
	color: #a33;
	margin-top: 8px;
	min-height: 16px;
}

@media (max-width: 540px) {
	.colmetics-configurator {
		max-width: 100%;
		padding: 18px;
		border-radius: 14px;
		margin: 20px 0;
	}

	.colmetics-configurator__toolbar button,
	.colmetics-configurator__add-photo-label {
		min-width: 100%;
	}
}
