/**
 * Vanquish Multiple Addresses — admin styles.
 */

/* ------------------------------------------------------------------ Toggles */

/*
 * A styled checkbox, not a JS widget: the form submits exactly as before and the
 * control stays keyboard operable and readable by screen readers. The native box
 * is visually hidden rather than removed, so focus still lands on it.
 */
.vanmuad-toggle {
	position: relative; /* contains the visually hidden checkbox */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.form-table td .vanmuad-toggle,
.form-table td fieldset label.vanmuad-toggle {
	display: inline-flex;
	margin: 0 !important;
}

.vanmuad-toggle input[type="checkbox"],
.form-table td .vanmuad-toggle input[type="checkbox"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	opacity: 0;
	-webkit-appearance: none;
	appearance: none;
}

.vanmuad-toggle__slider {
	position: relative;
	flex: 0 0 auto;
	width: 38px;
	height: 20px;
	border-radius: 999px;
	background: #c3c4c7;
	transition: background 0.15s ease-in-out;
}

.vanmuad-toggle__slider::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.15s ease-in-out;
}

.vanmuad-toggle input:checked + .vanmuad-toggle__slider {
	background: #2271b1;
}

.vanmuad-toggle input:checked + .vanmuad-toggle__slider::before {
	transform: translateX(18px);
}

.vanmuad-toggle input:focus + .vanmuad-toggle__slider {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

.vanmuad-toggle__label {
	line-height: 1.4;
}

/* Several toggles under one settings row. A flex column rather than <br/> so the
   spacing is controlled here instead of depending on line height. */
.vanmuad-toggle-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

/* ------------------------------------------------------------ Fee ranges */

.vanmuad-ranges {
	max-width: 520px;
	margin-bottom: 10px;
}

/* The numbers read better centred over their columns; the header sat cramped
   against the left edge otherwise. */
.vanmuad-ranges th,
.vanmuad-ranges td {
	text-align: center;
	vertical-align: middle;
}

.vanmuad-ranges input[type="number"],
.vanmuad-ranges input[type="text"] {
	width: 100%;
	max-width: 130px;
	text-align: center;
}

/* The remove-row column stays narrow. */
.vanmuad-ranges th:last-child,
.vanmuad-ranges td:last-child {
	width: 32px;
}

.vanmuad-range-remove {
	color: #b32d2e;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.vanmuad-range-remove:hover,
.vanmuad-range-remove:focus {
	color: #8a2424;
}

/* ------------------------------- Saved-address picker in the order editor */

.vanmuad-order-picker {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #dcdcde;
}

.vanmuad-order-picker select {
	width: 100%;
}

.vanmuad-order-picker__preview {
	margin: 6px 0 0;
	color: #2271b1;
	font-style: italic;
}

.vanmuad-order-picker__preview[hidden] {
	display: none;
}

/* ------------------------------------------------------ CSV import */

.vanmuad-import__progress {
	margin: 14px 0;
	max-width: 520px;
}

.vanmuad-import__bar {
	height: 18px;
	overflow: hidden;
	border-radius: 999px;
	background: #dcdcde;
}

.vanmuad-import__bar span {
	display: block;
	width: 0;
	height: 100%;
	background: #2271b1;
	transition: width 0.2s ease;
}

/* Only skipped rows are listed, so this stays short even for a large file — but
   it is capped and scrollable in case a whole import misses its customers. */
.vanmuad-import__log {
	max-width: 760px;
	max-height: 260px;
	overflow-y: auto;
	margin: 10px 0;
	padding: 8px 12px;
	border: 1px solid #dcdcde;
	background: #fff;
}

.vanmuad-import__skipped {
	margin: 0 0 4px;
	color: #b32d2e;
}

/* ------------------------------------------- Conditional sub-options */

/* Indented and ruled so it reads as belonging to the toggle above it. */
.vanmuad-suboptions {
	margin: 10px 0 0 24px;
	padding-left: 14px;
	border-left: 3px solid #dcdcde;
}

.vanmuad-suboptions[hidden] {
	display: none;
}

/* ------------------------------------------------- Translatable fields */

.vanmuad-i18n-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
}

.vanmuad-lang-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 62px;
	font-weight: 600;
}

.vanmuad-lang-badge img {
	vertical-align: middle;
}

/* The multilingual hint above the settings form. Here rather than in a style
   attribute: the notice is escaped with wp_kses_post() at output, and inline CSS
   only survives that if safecss_filter_attr happens to allow each property. */
.vanmuad-locale-notice {
	margin: 12px 0;
	max-width: 90%;
}
