/* =========================================================
   PSBDx Custom Product Fields — Frontend Styles
   ========================================================= */

.psbdx-custom-fields {
	margin: 16px 0 20px;
}

/* ---------- Field wrapper ---------- */
.psbdx-field-wrap {
	margin-bottom: 16px;
}
.psbdx-field-wrap.psbdx-hidden {
	display: none !important;
}

/* ---------- Label ---------- */
.psbdx-field-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 5px;
	color: #374151;
}
.psbdx-field-label .required {
	color: #dc2626;
	text-decoration: none;
	margin-left: 2px;
}

/* ---------- Instruction text ---------- */
.psbdx-field-instruction {
	display: block;
	font-size: 12px;
	color: #6b7280;
	margin-bottom: 6px;
	line-height: 1.5;
}

/* ---------- Inputs ---------- */
.psbdx-custom-fields input[type="text"],
.psbdx-custom-fields input[type="number"],
.psbdx-custom-fields input[type="email"],
.psbdx-custom-fields input[type="password"],
.psbdx-custom-fields input[type="tel"],
.psbdx-custom-fields input[type="url"],
.psbdx-custom-fields input[type="date"],
.psbdx-custom-fields textarea,
.psbdx-custom-fields select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid #d1d5db;
	border-radius: 5px;
	font-size: 14px;
	line-height: 1.5;
	color: #111827;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
	appearance: none;
}
.psbdx-custom-fields textarea {
	resize: vertical;
	min-height: 90px;
	font-family: inherit;
}
.psbdx-custom-fields input:focus,
.psbdx-custom-fields textarea:focus,
.psbdx-custom-fields select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.psbdx-custom-fields input.psbdx-field-error,
.psbdx-custom-fields textarea.psbdx-field-error,
.psbdx-custom-fields select.psbdx-field-error {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.psbdx-field-error-msg {
	display: block;
	font-size: 12px;
	color: #dc2626;
	margin-top: 4px;
}

/* ---------- Password wrapper ---------- */
.psbdx-password-wrap {
	position: relative;
}
.psbdx-password-wrap input {
	padding-right: 68px;
}
.psbdx-password-toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	color: #6b7280 !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	cursor: pointer;
	padding: 2px 6px !important;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}
.psbdx-password-toggle:hover { color: #374151 !important; }

/* Hide native browser password reveal/clear icons (Edge/IE) so they don't
   visually overlap and intercept clicks meant for our custom toggle button. */
.psbdx-password-wrap input::-ms-reveal,
.psbdx-password-wrap input::-ms-clear {
	display: none;
	width: 0;
	height: 0;
}

/* ---------- Radio / Checkbox options ---------- */
.psbdx-options-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 2px 0;
}
.psbdx-option-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	cursor: pointer;
	padding: 6px 10px;
	border: 1px solid #e5e7eb;
	border-radius: 5px;
	background: #fff;
	transition: border-color 0.15s, background 0.15s;
	user-select: none;
}
.psbdx-option-item:hover {
	border-color: #6366f1;
	background: #eef2ff;
}
.psbdx-option-item input[type="radio"],
.psbdx-option-item input[type="checkbox"] {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	cursor: pointer;
	accent-color: #6366f1;
}

/* ---------- Variation notice ---------- */
.psbdx-variation-notice {
	font-size: 12px;
	color: #2563eb;
	margin-top: 4px;
	font-style: italic;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.psbdx-custom-fields input[type="text"],
	.psbdx-custom-fields input[type="number"],
	.psbdx-custom-fields input[type="email"],
	.psbdx-custom-fields input[type="password"],
	.psbdx-custom-fields input[type="tel"],
	.psbdx-custom-fields input[type="url"],
	.psbdx-custom-fields input[type="date"],
	.psbdx-custom-fields textarea,
	.psbdx-custom-fields select {
		font-size: 16px; /* prevents iOS zoom */
	}
	.psbdx-options-list {
		flex-direction: column;
		gap: 6px;
	}
	.psbdx-option-item {
		width: 100%;
	}
}
