/**
 * Text Overlay Frontend Styles
 */

/* ========================================================================
   Choices view (sidebar text input form)
   ======================================================================== */

/* The outer element is now a <ul class="layer_choices text-overlay-choices">
   inheriting standard visibility/slide-in from the theme CSS.
   Only custom padding adjustments needed here. */
.text-overlay-choices .to-choices-wrapper {
	list-style: none;
	padding: 0;
	margin: 0;
}

.text-overlay-form {
	padding: 5px 10px;
}

/* Individual choice row */
.to-choice-row {
	margin-bottom: 15px;
}

.to-choice-row:last-child {
	margin-bottom: 0;
}

/* Text input */
.to-text-field {
	margin-bottom: 10px;
}

.to-text-input {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.to-text-input:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 1px #0073aa;
}

textarea.to-text-input {
	min-height: 60px;
	resize: vertical;
	font-family: inherit;
}

/* Field labels */
.to-field-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 5px;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* ========================================================================
   Font selector
   ======================================================================== */

.to-font-field {
	margin-bottom: 10px;
}

/* Dropdown mode */
.to-font-field select {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 14px;
	box-sizing: border-box;
}

/* List mode */
.to-font-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.to-font-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid #eee;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
}

.to-font-option:hover {
	background: #f8f8f8;
	border-color: #ccc;
}

.to-font-option input[type="radio"] {
	margin: 0;
}

.to-font-option input[type="radio"]:checked + span {
	font-weight: 600;
}

/* ========================================================================
   Color swatches
   ======================================================================== */

.to-color-field {
	margin-bottom: 10px;
}

.to-color-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.to-color-option {
	position: relative;
	cursor: pointer;
}

.to-color-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.to-color-swatch {
	display: block;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid transparent;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
	transition: border-color 0.15s, transform 0.15s;
}

.to-color-option:hover .to-color-swatch {
	transform: scale(1.1);
}

.to-color-option.active .to-color-swatch,
.to-color-option input[type="radio"]:checked + .to-color-swatch {
	border-color: #0073aa;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 0 0 2px #fff, 0 0 0 3px #0073aa;
}

/* ========================================================================
   Preview layer (on the viewer canvas)
   ======================================================================== */

/* Wrapper tracks the product image's displayed size and mirrors its
   centering, so percentage-based text positions match the admin editor. */
.text-overlay-wrapper {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translateX(-50%) translateY(-50%);
	pointer-events: none;
	overflow: visible;
}

.text-overlay-preview-layer {
	position: absolute;
	pointer-events: none;
	z-index: 100;
	white-space: nowrap;
	overflow: hidden;
	line-height: 1.2;
}
