/* Frontend styling for the classic cart/checkout Omniva picker.
 *
 * Two responsibilities:
 *   1. Lay out our shipping rate row so the method name is bold-left and the
 *      price is right-aligned (consistent with cart totals).
 *   2. Visually separate the terminal picker from the radio row so the two
 *      labels (method name + "Pickup terminal") don't look like duplicates.
 *
 * Scoped to our `.swa-rate-row` + `.swa-omniva-picker` classes — no global
 * `ul#shipping_method` rules, so other shipping methods on the same checkout
 * keep WC's default rendering.
 */

/* ----- shipping rate row: name left, price right ------------------------ */
.swa-rate-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	width: 100%;
}
.swa-rate-row__name {
	font-weight: 600;
}
.swa-rate-row__price {
	white-space: nowrap;
}

/* Lay out the shipping rate <li> as a flex container so the radio + label
 * stay inline (WC's default behaviour) and the picker drops to a new row
 * below the radio. The previous approach forced the label to
 * `display: block` to make the .swa-rate-row flex take full width, but a
 * block-level label is pushed to its own line below the radio — that's
 * what made the radio float above "Omniva parcel terminal" instead of
 * appearing inline next to it.
 *
 * Uses :has() — supported in all evergreen browsers
 * (Safari 15.4+, Chrome 105+, Firefox 121+).
 */
li:has(> .swa-omniva-picker),
li:has(.swa-rate-row) {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.5rem;
}
li:has(.swa-rate-row) > label {
	flex: 1 1 0;
	min-width: 0;
}
li:has(> .swa-omniva-picker) > .swa-omniva-picker {
	flex: 0 0 100%;
}

/* ----- terminal picker: indented under the radio, breathing room ------- */
.swa-omniva-picker {
	margin-top: 0.875rem;
	padding-left: 1.5rem;
	border-left: 2px solid #e5e7eb;
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
}
.swa-omniva-picker__label {
	display: block;
	font-size: 0.8125rem;
	color: #4b5563;
	font-weight: 500;
	margin-bottom: 0.375rem;
	letter-spacing: 0.01em;
}
.swa-omniva-picker__select {
	display: block;
	width: 100%;
	max-width: 28rem;
	padding: 0.5rem 0.75rem;
	font-size: 0.9375rem;
	border: 1px solid #d1d5db;
	border-radius: 0.375rem;
	background-color: #fff;
}
.swa-omniva-picker__select:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba( 79, 70, 229, 0.18 );
}
.swa-omniva-picker__select:disabled {
	background-color: #f3f4f6;
	color: #9ca3af;
	cursor: not-allowed;
}
.swa-omniva-picker__empty {
	margin: 0.25rem 0 0;
	color: #b91c1c;
	font-size: 0.8125rem;
}
