.shipo-hidden {
    display: none !important;
}

/* Classic checkout: keep the dependent county and locality fields together,
 * regardless of the checkout layout rules provided by the active theme. */
.woocommerce-checkout .shipo-classic-location-row {
    clear: both;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.woocommerce-checkout .shipo-classic-location-row .form-row {
    box-sizing: border-box;
    clear: none;
    float: none;
    margin: 0;
    width: 100%;
}

.woocommerce-checkout .shipo-classic-location-row .select2-container {
    width: 100% !important;
}

@media (max-width: 640px) {
    .woocommerce-checkout .shipo-classic-location-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }
}

.shipo-block-locality-controls {
    min-width: 0;
    position: relative;
}

/* WooCommerce Blocks can re-render its native city input after a county
 * change and remove the utility class added by the script. Scope the fallback
 * to the address form that actually has a Shipo replacement, so another
 * address form cannot lose its native city field before it is enhanced. */
.shipo-block-locality-enabled .wc-block-components-text-input:has(input[autocomplete~="address-level2"]),
.shipo-block-locality-enabled .wc-block-components-address-form__field:has(input[autocomplete~="address-level2"]) {
    display: none !important;
}

.shipo-block-locality-controls .wc-blocks-components-select {
    margin-top: 12px;
}

.shipo-block-locality-controls .shipo-block-locality-search {
    width: 100%;
}

.shipo-block-locality-controls .shipo-block-locality-search:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.shipo-block-locality-options {
    background: #fff;
    border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    box-sizing: border-box;
    list-style: none;
    margin: 4px 0 0;
    max-height: 15rem;
    overflow-y: auto;
    padding: 0.25rem 0;
    position: absolute;
    top: 100%;
    width: 100%;
    z-index: 1001;
}

.shipo-block-locality-options li {
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
    padding: 0.6rem 0.75rem;
}

.shipo-block-locality-options li:hover,
.shipo-block-locality-options li[aria-selected="true"] {
    background: rgba(0, 0, 0, 0.07);
}

.shipo-block-locality-options .shipo-block-locality-empty {
    color: rgba(43, 45, 47, 0.75);
    cursor: default;
}

.shipo-declared-value-error {
    color: #b81c23;
    font-size: 0.875em;
    margin-top: 0.5em;
}
