/* ============================================================
   Soping Postcode Autocomplete
   ============================================================ */

/* Wrap the postcode field so the dropdown positions correctly */
.soping-pca-wrap {
    position: relative !important;
}

/* The dropdown list */
.soping-pca-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-top: 2px solid #0073aa;
    border-radius: 0 0 6px 6px;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;   /* smooth scroll on iOS */
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Each option row */
.soping-pca-dropdown li {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #f2f2f2 !important;
    margin: 0 !important;
    list-style: none !important;
    transition: background .1s;
    user-select: none;
}

.soping-pca-dropdown li:last-child {
    border-bottom: none !important;
    border-radius: 0 0 6px 6px;
}

.soping-pca-dropdown li:hover,
.soping-pca-dropdown li.soping-pca-active {
    background: #f0f6ff !important;
}

/* Postcode badge (bold, fixed width) */
.soping-pca-code {
    font-weight: 700;
    color: #222;
    font-size: 13px;
    min-width: 52px;
    flex-shrink: 0;
}

/* City name */
.soping-pca-city {
    color: #555;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar styling (webkit) */
.soping-pca-dropdown::-webkit-scrollbar {
    width: 6px;
}
.soping-pca-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 0 0 6px 6px;
}
.soping-pca-dropdown::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 3px;
}
.soping-pca-dropdown::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* City field when locked (read-only) */
#billing_city_field  input[readonly],
#shipping_city_field input[readonly] {
    background-color: #f7f7f7 !important;
    color: #444 !important;
    cursor: default !important;
    border-color: #ddd !important;
}

/* City-first rows (when searching by city) */
.soping-pca-city-main {
    color: #333;
    font-weight: 600;
    flex: 1;
}
.soping-pca-code-right {
    color: #999;
    font-size: 12px;
    min-width: 52px;
    text-align: right;
    flex-shrink: 0;
}

/* Hide country/region field completely */
#billing_country_field,
#shipping_country_field,
p.form-row.hidden,
.woocommerce-address-fields .form-row.hidden {
    display: none !important;
}
