/* Live Text Product Customizer — frontend styles */

.ltpc-customizer,
.ltpc-customizer * ,
.ltpc-customizer *::before,
.ltpc-customizer *::after {
	box-sizing: border-box;
}

.ltpc-customizer {
	max-width: 100%;
	margin: 1.5em 0;
	padding: 1em;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	background: #fafafa;
}

.ltpc-field-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin-bottom: 1em;
	max-width: 100%;
}

.ltpc-field {
	flex: 1 1 220px;
	min-width: 180px;
	max-width: 100%;
}

.ltpc-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35em;
}

.ltpc-input,
.ltpc-customizer select,
.ltpc-customizer input[type="text"] {
	width: 100%;
	max-width: 100%;
	padding: 0.5em 0.6em;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}

.ltpc-align-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.ltpc-align-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 38px;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	background: #fff;
	font-weight: normal !important;
	margin: 0 !important;
}

.ltpc-align-btn input {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	pointer-events: none;
}

.ltpc-align-btn:has(input:checked),
.ltpc-align-btn.is-active {
	border-color: #3d5a80;
	background: #eef2f7;
}

.ltpc-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-bottom: 0.4em;
	max-width: 100%;
}

.ltpc-swatch {
	width: 26px;
	height: 26px;
	border-radius: 4px;
	border: 2px solid #ddd;
	cursor: pointer;
	padding: 0;
	flex: 0 0 auto;
}

.ltpc-swatch.is-active {
	border-color: #333;
	box-shadow: 0 0 0 2px #fff inset;
}

.ltpc-checkbox-field label {
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.ltpc-checkbox-field input {
	width: auto;
}

.ltpc-checkbox-field .description {
	margin: 0.3em 0 0;
	font-weight: normal;
	color: #666;
	font-size: 0.9em;
}

/* --- Image overlay (main product page) --- */

.woocommerce-product-gallery {
	position: relative;
	overflow: hidden;
}

.ltpc-overlay {
	/* Hidden by default and only shown once JS has moved this element inside
	   .woocommerce-product-gallery and explicitly sized/positioned it. This
	   prevents the overlay from ever affecting page layout (and creating a
	   horizontal/vertical scrollbar) during the brief window before JS runs,
	   when its containing block would otherwise be unpredictable (it starts
	   out as a sibling of the gallery, not a child of it). */
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	pointer-events: none;
	z-index: 5;
	max-width: 100%;
}

.ltpc-overlay-line {
	position: absolute;
	max-width: 100%;
	overflow-wrap: break-word;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.15;
	font-weight: 700;
	text-align: center;
}

.ltpc-overlay-separator {
	position: absolute;
	height: 2px;
	background: currentColor;
}

/* --- Cart / mini-cart thumbnail overlay --- */

.ltpc-cart-thumb {
	position: relative;
	display: inline-block;
	max-width: 100%;
	container-type: inline-size;
	line-height: 0;
}

.ltpc-cart-thumb img {
	max-width: 100%;
	height: auto;
	display: block;
}

.ltpc-cart-thumb-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.ltpc-cart-thumb-line {
	position: absolute;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.ltpc-cart-thumb-separator {
	position: absolute;
	height: 1px;
}
