.cta-lp-personalizer {
	--cta-navy: #243040;
	--cta-green: #103e1c;
	--cta-cream: #fcf3e5;
	clear: both;
	margin: 24px 0;
	padding: 24px;
	border: 1px solid #d7d9d8;
	border-radius: 8px;
	background: #fff;
	color: var(--cta-navy);
}

.cta-lp-personalizer h3 {
	margin: 0 0 20px;
	color: var(--cta-green);
	font-size: clamp(22px, 2.2vw, 30px);
}

.cta-lp-customer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
	gap: 28px;
	align-items: start;
}

.cta-lp-field {
	margin: 0 0 20px;
}

.cta-lp-field > label {
	display: block;
	margin: 0 0 6px;
	font-weight: 700;
	color: var(--cta-green);
}

.cta-lp-field .required {
	color: #b32d2e;
}

.cta-lp-instructions,
.cta-lp-preview-note {
	margin: 0 0 8px;
	color: #59616a;
	font-size: 14px;
	line-height: 1.45;
}

.cta-lp-field input[type="text"],
.cta-lp-field textarea,
.cta-lp-field select {
	width: 100%;
	max-width: none;
	padding: 11px 12px;
	border: 1px solid #a8adb3;
	border-radius: 4px;
	background: #fff;
	color: #111;
}

.cta-lp-field textarea {
	min-height: 92px;
	resize: vertical;
}

.cta-lp-character-count {
	display: block;
	margin-top: 4px;
	text-align: right;
	color: #687078;
	font-size: 12px;
}

.cta-lp-canvas-wrap {
	display: none;
	overflow: hidden;
	border: 1px solid #d7d9d8;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(36, 48, 64, 0.08);
}

.cta-lp-canvas-wrap.is-active {
	display: block;
}

.cta-lp-view-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.cta-lp-view-tab.is-active {
	border-color: var(--cta-green) !important;
	background: var(--cta-green) !important;
	color: #fff !important;
}

/* Reuse the personalizer garment record on third-party WooCommerce swatches. */
.variations_form .cta-lp-shared-colour-swatch {
	background-clip: padding-box !important;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.cta-lp-canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
}

.cta-lp-open-large {
	width: 100%;
	margin-top: 10px !important;
	border-color: var(--cta-green) !important;
	background: var(--cta-green) !important;
	color: #fff !important;
	font-weight: 700 !important;
}

.cta-lp-preview-note {
	margin-top: 8px;
	text-align: center;
}

.cta-lp-customer-approval {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 18px 0;
	padding: 14px 16px;
	border: 1px solid var(--cta-green);
	border-radius: 5px;
	background: #f7fbf7;
	font-weight: 600;
	line-height: 1.4;
}

.cta-lp-customer-approval input {
	flex: 0 0 auto;
	margin-top: 3px;
}

.cta-lp-image-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
	gap: 10px;
}

.cta-lp-image-choice {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	padding: 8px;
	border: 1px solid #c9cccf;
	border-radius: 5px;
	cursor: pointer;
	text-align: center;
}

.cta-lp-image-choice:has(input:checked) {
	outline: 2px solid var(--cta-green);
	border-color: var(--cta-green);
}

.cta-lp-image-choice input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cta-lp-image-choice img {
	width: 76px;
	height: 76px;
	object-fit: contain;
}

.cta-lp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 18, 28, 0.82);
}

.cta-lp-modal.is-open {
	display: flex;
}

.cta-lp-modal-dialog {
	position: relative;
	width: min(900px, 94vw);
	max-height: 94vh;
	padding: 14px;
	border-radius: 8px;
	background: #fff;
}

.cta-lp-modal-dialog img {
	display: block;
	max-width: 100%;
	max-height: calc(94vh - 28px);
	margin: auto;
}

.cta-lp-close-large {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: var(--cta-navy);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 760px) {
	.cta-lp-personalizer {
		padding: 18px;
	}

	.cta-lp-customer-grid {
		grid-template-columns: 1fr;
	}

	.cta-lp-preview-column {
		order: -1;
	}
}
