/* P4 CODEX REPAIR LAYER — 2026-07-11 */

/* Prevent the previous layout flashing while the redesigned page is assembled. */
html.p4-codex-boot body:not(.wp-admin) {
  opacity: 0 !important;
  pointer-events: none !important;
}
html:not(.p4-codex-boot) body:not(.wp-admin) {
  transition: opacity .16s ease;
}

/* Point Four does not offer WhatsApp contact. */
a[href^="https://wa.me/"],
a[href^="https://wa.me?"] {
  display: none !important;
}

body.p4-mobile-search-ready #p4-mobile-filter-toggle {
  display: none;
}

/* Mobile navigation drawer */
@media (max-width: 1199px) {
  #mobilewrapper_links,
  #mobilewrapper_links .snap-drawers,
  #mobilewrapper_links .snap-drawer-left {
    background: linear-gradient(180deg, #71172d 0%, #531020 100%) !important;
    color: #fff !important;
  }

  #mobilewrapper_links .snap-drawer-left {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 34px;
  }

  #mobilewrapper_links .mobilemenu-close {
    position: absolute !important;
    top: 18px !important;
    right: 16px !important;
    z-index: 3;
    width: 38px !important;
    height: 38px !important;
    border: 1px solid rgba(255,255,255,.24) !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.08) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  #mobilewrapper_links .p4-mobile-brand {
    display: flex !important;
    align-items: center;
    min-height: 78px;
    padding: 18px 68px 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,.14);
  }

  #mobilewrapper_links .p4-mobile-brand img {
    display: block;
    width: 126px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
  }

  #mobilewrapper_links .header_phone {
    margin: 0 !important;
    padding: 16px 22px !important;
    border-bottom: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(0,0,0,.09) !important;
    color: rgba(255,255,255,.72) !important;
    font: 600 11px/1.4 Inter, sans-serif !important;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  #mobilewrapper_links .header_phone a {
    display: block !important;
    margin-top: 3px;
    color: #fff !important;
    font-size: 17px !important;
    letter-spacing: .01em;
    text-transform: none;
  }

  #mobilewrapper_links .mobilex-menu,
  #mobilewrapper_links .mobilex-menu ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  #mobilewrapper_links .mobilex-menu > li {
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,.12) !important;
  }

  #mobilewrapper_links .mobilex-menu > li > a {
    display: flex !important;
    align-items: center;
    min-height: 54px;
    padding: 14px 56px 14px 22px !important;
    color: #fff !important;
    background: transparent !important;
    font: 600 14px/1.35 Inter, sans-serif !important;
    letter-spacing: .01em;
    text-transform: none !important;
  }

  #mobilewrapper_links .mobilex-menu > li.current-menu-item > a,
  #mobilewrapper_links .mobilex-menu > li.current-menu-ancestor > a {
    color: #f4c36a !important;
  }

  #mobilewrapper_links .p4-submenu-toggle {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.09);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  #mobilewrapper_links .p4-submenu-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform .2s ease;
  }

  #mobilewrapper_links .p4-submenu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  #mobilewrapper_links .mobilex-menu li > .sub-menu {
    position: static !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    display: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(22, 9, 14, .2) !important;
  }

  #mobilewrapper_links .mobilex-menu li.p4-submenu-open > .sub-menu {
    display: block !important;
  }

  #mobilewrapper_links .mobilex-menu .sub-menu li {
    border-top: 1px solid rgba(255,255,255,.08) !important;
  }

  #mobilewrapper_links .mobilex-menu .sub-menu a {
    display: block !important;
    padding: 13px 22px 13px 34px !important;
    color: rgba(255,255,255,.86) !important;
    background: transparent !important;
    font: 500 13px/1.35 Inter, sans-serif !important;
    text-transform: none !important;
  }

  #mobilewrapper_links .mobilex-menu .sub-menu a:hover,
  #mobilewrapper_links .mobilex-menu .sub-menu a:focus {
    color: #f4c36a !important;
  }

  /* Complete property search form on phones and tablets. */
  body.p4-mobile-search-ready #p4-mobile-filter-toggle {
    width: calc(100% - 32px);
    min-height: 52px;
    margin: 18px 16px 10px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: #71172d;
    color: #fff;
    box-shadow: 0 12px 28px rgba(63, 12, 27, .18);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font: 700 14px/1.2 Inter, sans-serif;
    cursor: pointer;
  }

  body.p4-mobile-search-ready #p4-mobile-filter-toggle .p4-filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.p4-mobile-search-ready #p4-mobile-filter-toggle svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
  }

  body.p4-mobile-search-ready #p4-mobile-filter-toggle .p4-filter-chevron {
    transition: transform .2s ease;
  }

  body.p4-mobile-search-ready #p4-mobile-filter-toggle[aria-expanded="true"] .p4-filter-chevron {
    transform: rotate(180deg);
  }

  body.p4-mobile-search-ready #search_wrapper {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: calc(100% - 32px) !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 16px 18px !important;
    padding: 0 !important;
    border: 1px solid #eadfe3 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 18px 42px rgba(54, 18, 30, .12) !important;
    overflow: visible !important;
    display: none !important;
  }

  body.p4-mobile-search-ready #search_wrapper.p4-filter-open {
    display: block !important;
  }

  body.p4-mobile-search-ready #search_wrapper #adv_search_form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
    margin: 0 !important;
  }

  body.p4-mobile-search-ready #search_wrapper .adv1-holder {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.p4-mobile-search-ready #search_wrapper #adv_search_form > *,
  body.p4-mobile-search-ready #search_wrapper [class*="col-"] {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.p4-mobile-search-ready #search_wrapper .p4-mobile-field-hidden {
    display: none !important;
  }

  body.p4-mobile-search-ready #search_wrapper .dropdown.bootstrap-select,
  body.p4-mobile-search-ready #search_wrapper .form-control,
  body.p4-mobile-search-ready #search_wrapper input,
  body.p4-mobile-search-ready #search_wrapper select {
    width: 100% !important;
    min-height: 48px !important;
  }

  body.p4-mobile-search-ready #search_wrapper .btn,
  body.p4-mobile-search-ready #search_wrapper .form-control,
  body.p4-mobile-search-ready #search_wrapper input,
  body.p4-mobile-search-ready #search_wrapper select {
    border: 1px solid #ded7da !important;
    border-radius: 10px !important;
    background-color: #fff !important;
    color: #16202b !important;
    font: 500 14px/1.3 Inter, sans-serif !important;
  }

  body.p4-mobile-search-ready #search_wrapper .wpresidence_button,
  body.p4-mobile-search-ready #search_wrapper input[type="submit"],
  body.p4-mobile-search-ready #search_wrapper button[type="submit"] {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    margin: 4px 0 0 !important;
    padding: 14px 18px !important;
    min-height: 50px !important;
    border-color: #71172d !important;
    background: #71172d !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-indent: 0 !important;
    font: 700 13px/1.2 Inter, sans-serif !important;
    font-weight: 700 !important;
  }

  body.p4-mobile-search-ready #search_wrapper .residence_advanced_submit_button_search_1::before {
    display: none !important;
  }

  body.p4-mobile-search-ready .listing_filter_select.p4-mobile-redundant {
    display: none !important;
  }

  body.p4-mobile-search-ready .listing_filter_select.p4-mobile-sort {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body.p4-mobile-search-ready .listing_filter_select.p4-mobile-sort .dropdown-toggle {
    width: 100% !important;
    border-radius: 10px !important;
  }
}

@media (max-width: 767px) {
  /* Fixed theme controls were covering form buttons on small screens. */
  .backtop,
  .contact-box {
    display: none !important;
  }
}