/* Woo's own field and error classes draw the picker; this adds only its layout, the logos, the suggestion list, the picked place and the editor skeleton, in the theme's colours */
.fulbit-picker__box:empty { display: none; }
.fulbit-picker__box { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 16px; font-size: .875rem; line-height: 1.4; }
.wc-block-components-validation-error:empty, .checkout-inline-error-message:empty { display: none; }

/* Under a picked option of Woo's list, the picker lines up with the option's text */
.wc-block-components-radio-control .fulbit-picker__box { margin: 12px 16px 16px; }

/* Woo drops the list's bottom edge when its last option is picked, as that option draws its own border; the picker below it closes the list, so the edge comes back */
.wc-block-components-radio-control--highlight-checked--last-selected:has(> .fulbit-picker__box:last-child)::after { border-bottom: 1px solid var(--wc-separator-color, color-mix(in srgb, currentColor 20%, transparent)); margin-bottom: 0; }
#shipping_method .fulbit-picker__box { margin: 12px 0; }

/* The courier's logo before each mapped option's name, and at the right of the place field */
.fulbit-option-logo { display: inline-block; width: 44px; height: auto; margin-right: 8px; vertical-align: middle; }
/* The box's gap spaces the fields; Woo's own margin between sibling text fields would push the postcode below the town */
.fulbit-picker__box .fulbit-picker__field.fulbit-picker__field { position: relative; margin: 0; }
.fulbit-picker__logo { position: absolute; right: 12px; top: 50%; width: 52px; height: auto; transform: translateY(-50%); pointer-events: none; }
.wc-block-components-text-input.fulbit-picker__field .fulbit-picker__logo { top: 25px; }
.fulbit-picker__field--place input { padding-right: 76px !important; }
.fulbit-picker__field .woocommerce-input-wrapper { position: relative; display: block; }

/* Town and postcode side by side, as in the popup */
.fulbit-picker__address { display: flex; flex-direction: column; gap: 12px; }
.fulbit-picker__row { display: flex; gap: 12px; }
.fulbit-picker__row > .fulbit-picker__field--city { flex: 2; min-width: 0; }
.fulbit-picker__row > .fulbit-picker__field--postcode { flex: 1; min-width: 0; }
.fulbit-picker__check:empty { display: none; }

/* Suggestions under a field */
.fulbit-suggest-host { position: relative; }
.fulbit-suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; max-height: 280px; overflow-y: auto; overflow-x: hidden; background: var(--wp--preset--color--base, #fff); color: inherit; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 25%, transparent); border-radius: 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); font-size: .875rem; line-height: 1.4; white-space: normal; }
.fulbit-suggest__item, .fulbit-suggest__empty { margin: 0; padding: 10px 16px; overflow-wrap: anywhere; cursor: pointer; }
.fulbit-suggest__empty { cursor: default; opacity: .7; }
.fulbit-suggest__item:hover, .fulbit-suggest__item.is-active { background: color-mix(in srgb, currentColor 8%, transparent); }

/* The picked place, bordered as Woo's selected option */
.fulbit-picker__card { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid currentColor; border-radius: 4px; }
.fulbit-picker__card-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fulbit-picker__card-label { font-size: .75rem; opacity: .7; }
.fulbit-picker__change { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.fulbit-picker__map { flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat; }
.fulbit-picker__map:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* A spinner beside the picked option's name while the courier checks, and inside a field while its search runs; neither takes space, so nothing moves */
@keyframes fulbit-spin { to { transform: rotate(360deg); } }
.fulbit-spinner, .is-busy::after { box-sizing: border-box; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: .6; animation: fulbit-spin .7s linear infinite; }
.fulbit-spinner { display: inline-block; margin-left: 8px; vertical-align: middle; }
.is-busy::after { content: ""; position: absolute; right: 12px; top: calc(50% - 7px); pointer-events: none; }
.wc-block-components-text-input.is-busy::after { top: 18px; }
.fulbit-picker__field--place.is-busy::after, .fulbit-picker__field--place .is-busy::after { right: 76px; }
@media (prefers-reduced-motion: reduce) { .fulbit-spinner, .is-busy::after { animation-duration: 2s; } }

/* While a Fulbit method is picked, the picker fills Woo's street, apartment, town and postcode, so they are hidden with the county where Woo does not require it; country, names and phone stay */
.fulbit-fills-address:not(.fulbit-keeps-state) #shipping .wc-block-components-address-form__state,
.fulbit-fills-address:not(.fulbit-keeps-state) form.checkout:has(#ship-to-different-address-checkbox:checked) #shipping_state_field,
.fulbit-fills-address:not(.fulbit-keeps-state) form.checkout:not(:has(#ship-to-different-address-checkbox:checked)) #billing_state_field,
.fulbit-fills-address #shipping .wc-block-components-address-form__address_1,
.fulbit-fills-address #shipping .wc-block-components-address-form__address_2,
.fulbit-fills-address #shipping .wc-block-components-address-form__address_2-toggle,
.fulbit-fills-address #shipping .wc-block-components-address-form__city,
.fulbit-fills-address:not(.fulbit-keeps-postcode) #shipping .wc-block-components-address-form__postcode { display: none; }

/* The classic checkout ships to the shipping fields when that box is ticked, else to the billing ones */
.fulbit-fills-address form.checkout:has(#ship-to-different-address-checkbox:checked) :is(#shipping_address_1_field, #shipping_address_2_field, #shipping_city_field),
.fulbit-fills-address form.checkout:not(:has(#ship-to-different-address-checkbox:checked)) :is(#billing_address_1_field, #billing_address_2_field, #billing_city_field),
.fulbit-fills-address:not(.fulbit-keeps-postcode) form.checkout:has(#ship-to-different-address-checkbox:checked) #shipping_postcode_field,
.fulbit-fills-address:not(.fulbit-keeps-postcode) form.checkout:not(:has(#ship-to-different-address-checkbox:checked)) #billing_postcode_field { display: none; }

/* The checkout editor's skeleton */
.fulbit-skeleton { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px dashed currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); border-radius: 4px; font-size: .875rem; }
.fulbit-skeleton__row { display: flex; gap: 12px; }
.fulbit-skeleton__field { height: 50px; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 20%, transparent); border-radius: 4px; background: color-mix(in srgb, currentColor 5%, transparent); }
.fulbit-skeleton__field--wide { flex: 2; }
.fulbit-skeleton__field--narrow { flex: 1; }
