/* 5.1.77: bounded input and native half-map integration. No viewport zoom lock. */
body.amx-site-shell {
  --amx-field-border-focus: var(--amx-field-border, #d1d7e2);
  --amx-field-focus-ring: none;
}
body.amx-site-shell :is(input, textarea, select):focus,
body.amx-site-shell :is(button, a, [role="button"]):focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}
/* Retain a neutral keyboard-only indicator, never the blue tap halo. */
body.amx-site-shell :is(button, a, [role="button"]):focus-visible {
  outline: 2px solid #596579 !important;
  outline-offset: 2px;
  box-shadow: none !important;
}
body.amx-homepage #main-content #amx-location,
body.amx-homepage #main-content #amx-location:focus {
  min-width: 0;
  max-width: 100%;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
body.amx-homepage #amx-home-search,
body.amx-homepage #amx-home-search .amx-search__field {min-width:0;max-width:100%;}
@media (max-width: 1024px) {
  /* iOS focuses text fields below 16px by zooming the visual viewport. */
  body.amx-homepage #main-content #amx-location,
  body.amx-site-shell.wpresidence_half_map_body_class #main-content .amx-half-map-search-shell .adv_locations_search_component_wrapper input {
    font-size: 16px !important;
  }
  body.amx-homepage #main-content #amx-location::placeholder {
    font-size: clamp(11.5px, 3.2vw, 13px);
  }
}
/* Contain legacy map z-indices in one plane below navigation. Its native
   controls, filter handlers and form nodes remain intact, at all breakpoints. */
body.amx-site-shell.wpresidence_half_map_body_class #main-content {
  position: relative;
  isolation: isolate;
  z-index: 0;
}
body.amx-site-shell.wpresidence_half_map_body_class:is(.amx-nav-open, .amx-account-open) :is(.amx-mobile-filter-sheet, .amx-mobile-sort-sheet, .half_map_controllers_wrapper) {
  z-index: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 767.98px) {
  /* Mobile headers scroll with the document, never stick over the content. */
  body.amx-site-shell:not(.amx-homepage) #amx-site-header {
    position:relative!important;
    top:auto!important;
  }
  body.amx-site-shell.amx-homepage #amx-site-header {
    position:absolute!important;
  }
  /* Only maps with the actual native location field get the compact header. */
  body.amx-site-shell.wpresidence_half_map_body_class:has(.amx-half-map-search-shell .adv_locations_search_component_wrapper) {
    --amx-map-top: 0px;
    --amx-mobile-header-row-height: 64px;
    --amx-mobile-header-total-height: 133px;
    --amx-mobile-gutter: 12px;
    --amx-mobile-menu-slot: 42px;
    --amx-mobile-signin-slot: 70px;
  }
  /* WordPress already offsets the document for its mobile admin toolbar.
     Do not add that offset again inside the positioned map wrapper. */
  html:has(body.admin-bar.amx-site-shell.wpresidence_half_map_body_class) {margin-top:46px!important;}
  body.admin-bar.amx-site-shell.wpresidence_half_map_body_class {padding-top:0!important;}
  body.amx-site-shell.wpresidence_half_map_body_class:has(.amx-half-map-search-shell .adv_locations_search_component_wrapper) #amx-site-header {
    position: absolute !important;
    top: var(--amx-map-top) !important;
    left: 0; right: 0;
    height: 64px !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    pointer-events: none;
  }
  body.amx-site-shell.wpresidence_half_map_body_class:has(.amx-half-map-search-shell .adv_locations_search_component_wrapper) #amx-site-header .amx-header__inner {
    height:64px;
    padding:0 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
  }
  body.amx-site-shell.wpresidence_half_map_body_class:has(.amx-half-map-search-shell .adv_locations_search_component_wrapper) #amx-site-header .amx-brand {display:none;}
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header :is(.amx-nav-toggle, .amx-sign-in, .amx-account__toggle) {pointer-events:auto;}
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-nav-toggle {
    width:42px; height:42px; flex:0 0 42px; padding:0; justify-content:center;
    color:#1264f6; background:#fff;
  }
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-nav-toggle__label {display:none;}
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-sign-in {
    width:70px; min-height:40px; padding:0 6px; font-size:12px;
    background:#1264f6; border-color:#1264f6; color:#fff!important;
  }
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-account {margin-left:auto;}
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-account__toggle {min-width:70px;gap:7px;}
  body.amx-site-shell.wpresidence_half_map_body_class #amx-site-header .amx-account__avatar {width:38px;height:38px;flex-basis:38px;}
  body.amx-site-shell.wpresidence_half_map_body_class:has(.amx-half-map-search-shell .adv_locations_search_component_wrapper) .amx-half-map-search-shell {
    /* Native rows remain in document flow and scroll away with the header. */
    position:relative!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    min-height:133px!important;
  }
  body.amx-site-shell.wpresidence_half_map_body_class .amx-half-map-search-shell .wpresidence_note_half_search > .adv_locations_search_component_wrapper {
    position:absolute!important;
    top:10px!important;
    left:62px!important;
    right:90px!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    height:44px!important;
  }
  body.amx-site-shell.wpresidence_half_map_body_class .amx-half-map-search-shell .adv_locations_search_component_wrapper input {
    width:100%!important;min-width:0!important;height:44px!important;
    border-color:#cfd8e6!important;
  }
  body.amx-site-shell.wpresidence_half_map_body_class .amx-half-map-search-action {width:40px!important;}
  body.amx-site-shell.wpresidence_half_map_body_class .amx-half-map-search-shell .adv_locations_search_component_wrapper.has-amx-half-map-search-action .form-control {padding-left:10px!important;padding-right:64px!important;}
}
