#cc_c2a {
    border-width: 2px !important;
    border-color: #ced4da !important;
    border-radius: 0 !important;
    z-index: 9999998 !important;
}

/* Present the Address Search field as a secondary callout (mirrors .alert / .alert-secondary
   via the same --bs-alert-* tokens). Uses the theme's per-field hook .form-group-<name>, so
   no shared template edit and no JS layout shift. mb-3 supplies the bottom margin. */
.form-group-cc_search,
.opc-form #field_custom_cc_search {
    --bs-alert-color: var(--bs-secondary-text-emphasis);
    --bs-alert-bg: var(--bs-secondary-bg-subtle);
    --bs-alert-border-color: var(--bs-secondary-border-subtle);
    --bs-alert-link-color: var(--bs-secondary-text-emphasis);
    --bs-alert-padding-x: 1rem;
    --bs-alert-padding-y: 1rem;
    --bs-alert-margin-bottom: 1rem;
    --bs-alert-border: var(--bs-border-width) solid var(--bs-alert-border-color);
    --bs-alert-border-radius: var(--bs-border-radius);
    background-color: var(--bs-alert-bg);
    border: var(--bs-alert-border);
    border-radius: var(--bs-alert-border-radius);
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
}

/* Collapse the address fields on a NEW address form (data-id-address="0" = empty; every saved
   address has address1) until the adapter reveals them (.cc-revealed). Server-rendered, so no
   on-load layout shift. The adapter reveals on select / "enter manually", and reveals immediately
   when Hide fields is off. */
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-address1,
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-address2,
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-address3,
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-city,
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-id_state,
.js-address-form form[data-id-address="0"]:not(.cc-revealed) .form-group-postcode {
    display: none !important;
}

/* OPC's field wrapper is a grid column; inset it by the gutter so the box lines up with the inputs. */
#checkout #opc_main .opc-form #field_custom_cc_search {
    width: calc(100% - var(--bs-gutter-x, 1.5rem));
    margin: 0 calc(var(--bs-gutter-x, 1.5rem) * .5) 1rem;
    padding: var(--bs-alert-padding-y) var(--bs-alert-padding-x);
}

/* Checkout forms carry no new-address marker and the guest's first step needs city/county/postcode,
   so the adapter decides there and sets .cc-collapsed. */
.opc-form.cc-collapsed .field-container[id$="_address1"],
.opc-form.cc-collapsed .field-container[id$="_address2"],
.opc-form.cc-collapsed .field-container[id$="_address3"],
.opc-form.cc-collapsed .field-container[id$="_city"],
.opc-form.cc-collapsed .field-container[id$="_id_state"],
.opc-form.cc-collapsed .field-container[id$="_postcode"] {
    display: none !important;
}
