/* ============================================================
   PWL Product Extra Options — Frontend Styles
   ============================================================ */

/* Wrapper */
.pwl-peo-wrapper {
	margin: 1.2em 0;
}

/* ── Main option row ── */
.pwl-peo-option {
	margin-bottom: 0.8em;
}

.pwl-peo-option-label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.4;
	user-select: none;
}

.pwl-peo-option-label input[type="checkbox"],
.pwl-peo-option-label input[type="radio"],
.pwl-peo-suboption-label input[type="checkbox"] {
	/* Restore native appearance in case the block theme resets it */
	-webkit-appearance: checkbox;
	-moz-appearance: checkbox;
	appearance: auto;
	width: 18px;
	height: 18px;
	min-width: 18px;
	flex-shrink: 0;
	cursor: pointer;
	margin: 0;
	padding: 0;
	border: 1px solid #767676;
	background: #fff;
	accent-color: currentColor;
	opacity: 1;
	visibility: visible;
}

.pwl-peo-option-text {
	flex: 1;
	font-size: 0.9em;
}

.pwl-peo-price-tag {
	color: #6b7280;
	font-size: 0.9em;
	white-space: nowrap;
}

/* ── Children (sub-options + fields) ── */
.pwl-peo-children {
	margin-top: 0.75em;
	margin-left: 28px;
}

/* ── Sub-options ── */
.pwl-peo-suboptions {
	margin-bottom: 2em;
	margin-top: 1em;
}

.pwl-peo-suboption {
	margin-bottom: 0.5em;
}

.pwl-peo-suboption-label {
	display: flex;
	align-items: center;
	gap: 0.5em;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.4;
	user-select: none;
}

.pwl-peo-suboption-label input[type="checkbox"] {
	/* Inherits the full reset from the rule above */
	-webkit-appearance: checkbox;
	-moz-appearance: checkbox;
	appearance: auto;
}

.pwl-peo-sub-text {
	flex: 1;
	font-size: 0.9em;
}

.pwl-peo-sub-price {
	color: #6b7280;
	font-size: 0.9em;
	white-space: nowrap;
}

/* Extra fields revealed when a sub-option is checked */
.pwl-peo-sub-extra-fields {
	margin-top: 0.75em;
	margin-left: 1.8em;
	padding: 0.75em 1em;
	background: #f9fafb;
	border-left: 3px solid #d1d5db;
	border-radius: 0 4px 4px 0;
}

/* ── Extra fields ── */
.pwl-peo-extra-fields {
	margin-top: 0.75em;
}

.pwl-peo-field-wrap {
	margin-bottom: 1em;
}

.pwl-peo-field-label {
	display: block;
	font-weight: normal;
	font-size: 0.95em;
	margin-bottom: 0.4em;
	color: #374151;
}

.pwl-peo-field-label .required {
	color: #e53935;
	font-style: normal;
	margin-left: 2px;
	text-decoration: none;
}

/* Text input */
.pwl-peo-text-input {
	display: block;
	width: 240px;
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 3px;
	font-size: 0.95em;
	line-height: 1.4;
	background: #fff;
	transition: border-color 0.15s ease;
}

.pwl-peo-text-input:focus {
	outline: none;
	border-color: #6c757d;
}

/* ── File upload dropzone ── */
.pwl-peo-dropzone {
	border: 2px dashed #d1d5db;
	border-radius: 4px;
	padding: 0;
	background: #fafafa;
	transition: border-color 0.2s ease, background 0.2s ease;
	max-width: 480px;
}

.pwl-peo-dropzone.is-dragover {
	border-color: #374151;
	background: #f3f4f6;
}

.pwl-peo-dropzone-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 28px 20px 24px;
	gap: 10px;
}

.pwl-peo-upload-icon {
	color: #4f94ea;
	display: block;
}

.pwl-peo-drop-text {
	margin: 0;
	font-size: 0.9em;
	color: #6b7280;
}

.pwl-peo-file-btn {
	display: inline-block;
	padding: 8px 18px;
	background: #374151;
	color: #fff !important;
	border: none;
	border-radius: 3px;
	font-size: 0.9em;
	cursor: pointer;
	line-height: 1.5;
	text-decoration: none;
	transition: background 0.15s ease;
}

.pwl-peo-file-btn:hover {
	background: #1f2937;
}

/* Hide the actual file input visually */
.pwl-peo-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* File info note */
.pwl-peo-file-note {
	font-size: 0.82em;
	color: #9ca3af;
	margin: 4px 0 0;
}

/* ── File preview ── */
.pwl-peo-file-preview {
	width: 100%;
}

.pwl-peo-file-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #f9f9f9;
	border-top: 1px solid #e5e7eb;
	font-size: 0.88em;
}

.pwl-peo-file-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #374151;
}

.pwl-peo-file-size {
	color: #9ca3af;
	white-space: nowrap;
}

.pwl-peo-file-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	font-size: 16px;
	line-height: 1;
	padding: 0 2px;
	transition: color 0.15s;
}

.pwl-peo-file-remove:hover {
	color: #e53935;
}
