/* =========================================================
   ARRIENDO - BUSCADOR INMUEBLES (VERSIÓN CORREGIDA)
   - SIN chips/burbujas
   - Layout móvil corregido (checkbox e icono separados)
   - Selección con color visible
   - Dropdowns estables
   - FIX: Imagen hero en móvil centrada en edificios
   ========================================================= */

:root{
  --arx-brand:#EE2624;
  --arx-ink:#111827;
  --arx-muted:#6b7280;
  --arx-radius:18px;
  --arx-shadow:0 22px 60px rgba(15,23,42,.22);
  --arx-border:rgba(15,23,42,.18);
  --field-h:54px;
  --card-max: 1420px;
  --card-pad: 22px;
}

/* =========================================================
   HERO / CARRUSEL
   ========================================================= */
.search-mod.arx-hero.js-arx-hero{
  position: relative;
  isolation: isolate;
  overflow: visible !important;
  z-index: 0;
  margin-top: 0 !important;
  background: #00000092 !important;
  padding: 78px 0 86px;
  min-height: 780px !important;
}

.js-arx-hero .arx-hero__bg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: opacity;
  z-index: 0;
  transform: none !important;
  clip-path: inset(0);
  -webkit-clip-path: inset(0);
  filter: none !important;
}

.js-arx-hero.is-a .arx-hero__bg--a{ opacity: 1; }
.js-arx-hero.is-b .arx-hero__bg--b{ opacity: 1; }

.js-arx-hero .arx-hero__overlay{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(1200px 600px at 20% 30%, rgba(0,0,0,0.137) 0%, rgba(0,0,0,0) 30%),
    linear-gradient(180deg, rgba(0,0,0,0.129) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0.119) 80%) !important;
}

.js-arx-hero .search-home-container{
  position: relative;
  z-index: 2;
}

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */
.search-home-container{
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 26px;
  overflow: visible !important;
}

/* =========================================================
   TÍTULOS
   ========================================================= */
.search-home-container > .search-titles{
  max-width: var(--card-max);
  margin: 0 auto 18px;
  padding: 0 var(--card-pad);
  text-align: left !important;
}

.search-home-container > .search-titles h1,
.search-home-container > .search-titles h2{
  color:#fff;
  font-size: clamp(44px, 5vw, 78px);
  line-height: 0.98;
  letter-spacing: -1px;
  font-weight: 900;
  margin: 0 0 16px;
  text-shadow: none !important;
}

.search-home-container > .search-titles p{
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: min(1020px, 94vw);
}

/* =========================================================
   CHIP y SUBLINE
   ========================================================= */
.search-home-container .hero-chip,
.search-home-container .hero-subline{
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.search-home-container .hero-chip{
  display: inline-block;
  font-size: 22px !important;
  line-height: 1.2;
  font-weight: 700;
  color: #f8ce1b;
}

.search-home-container .hero-chip b{
  color:#fff;
  font-weight: 900;
}

.search-home-container .hero-subline{
  display: inline-block;
  margin-top: 10px !important;
  border-radius: 0 !important;
  max-width: min(980px, 92vw);
  font-size: 16px !important;
  line-height: 1.18;
  font-weight: 700;
  color:#fff;
}

/* =========================================================
   CARD BLANCO
   ========================================================= */
.search-box{
  background:#ffffffc3;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: var(--arx-radius);
  box-shadow: var(--arx-shadow);
  width: 100%;
  max-width: var(--card-max);
  margin: 0 auto;
  position: relative;
  z-index: 3;
  overflow: visible !important;
  padding: 18px var(--card-pad) 22px;
}

.search-box::before{
  content:"";
  position:absolute;
  left: 18px;
  right: 18px;
  top: 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(238,38,36,1), rgba(248,206,27,1));
  opacity: .9;
}

/* =========================================================
   GRID + ANCLAJES
   ========================================================= */
.search-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
  margin: 0;
  overflow: visible !important;
}

@media(min-width:992px){
  .search-grid{
    grid-template-columns: 340px 1fr 260px;
    gap: 18px;
  }
}

.search-grid > *{
  position: relative !important;
  overflow: visible !important;
  z-index: 1;
}

/* =========================================================
   WRAPPERS DE CAMPOS
   ========================================================= */
.arx-field-wrap{
  position: relative !important;
  overflow: visible !important;
}

.arx-field-wrap--types{ z-index: 10 !important; }
.arx-field-wrap--loc{ z-index: 9 !important; }

/* En móvil iOS, los wrappers necesitan z-index muy alto */
@media(max-width:900px){
  /* Wrapper de tipos (primer div del grid) */
  .search-grid > div:first-child {
    z-index: 1000 !important;
    position: relative !important;
  }
  
  /* Wrapper de ubicación (segundo div del grid) */
  .search-grid > div:nth-child(2) {
    z-index: 100 !important;
    position: relative !important;
  }
  
  .location-input-wrapper {
    z-index: 9999 !important;
  }
}

/* =========================================================
   LABELS
   ========================================================= */
.search-label{
  display:block;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
  font-size: 16px;
}

/* =========================================================
   INPUTS / BOTÓN TYPES
   ========================================================= */
.search-input,
.search-select,
#btn-types{
  width:100%;
  height: var(--field-h) !important;
  padding: 0 18px !important;
  border: 1px solid var(--arx-border);
  border-radius: 12px !important;
  font-size: 15px;
  background:#fff;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
  box-sizing: border-box;
}

.search-input::placeholder{ color: rgba(17,24,39,.42); }

.search-input:focus,
.search-select:focus{
  border-color: rgba(238,38,36,.65);
  outline:none;
  box-shadow: 0 0 0 4px rgba(238,38,36,.14);
}

.search-input:hover,
#btn-types:hover{
  border-color: rgba(238,38,36,.45);
  box-shadow: 0 14px 26px rgba(15,23,42,.08);
  transform: translateY(-1px);
}

/* =========================================================
   BOTÓN TYPES
   ========================================================= */
#btn-types{
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  position: relative;
  z-index: 4;
}

#btn-types .btn-text-types{ color: rgba(17,24,39,.86); }
#btn-types .icon_menu_types{ transition: transform .15s ease-in-out; font-size: 16px; }
#btn-types.open .icon_menu_types{ transform: rotate(180deg); }

/* =========================================================
   BOTÓN BUSCAR
   ========================================================= */
.search-button{
  width:100%;
  height: var(--field-h);
  border:0;
  border-radius: 12px;
  background: var(--arx-brand);
  color:#fff;
  font-weight: 800;
  font-size: 18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.search-button:hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(255, 220, 220, 0.22);
}

/* =========================================================
   ✅ UBICACIÓN - SIN CHIPS
   ========================================================= */
.location-input-wrapper {
  position: relative !important;
  display: block;
}

/* ✅ OCULTAR CHIPS COMPLETAMENTE */
#selected-locations {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ✅ Badge contador en el input */
.location-input-wrapper.has-selections::after {
  content: attr(data-count);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  background: var(--arx-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(238,38,36,.25);
}

/* Input con padding derecho para el badge */
.location-input-wrapper.has-selections .search-input {
  padding-right: 52px !important;
}

/* Placeholder oscuro cuando hay ubicaciones seleccionadas */
.location-input-wrapper.has-selections .search-input::placeholder {
  color: rgba(17,24,39,.85);
  font-weight: 500;
}

/* =========================================================
   DROPDOWN UBICACIÓN
   ========================================================= */
#location-results{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 22px 46px rgba(15,23,42,.18);
  z-index: 99990;
  display: none;
  max-height: 380px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Lista de items */
.location-items-list {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   ✅ ITEM DE UBICACIÓN - LAYOUT GRID (CORREGIDO)
   Dos columnas: checkbox | texto+icono
   ========================================================= */
.location-item {
  display: grid !important;
  grid-template-columns: 28px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  cursor: pointer;
  border-bottom: 1px solid rgba(15,23,42,.06);
  font-size: 14px;
  transition: background 0.15s ease;
  background: #fff;
}

.location-item:hover {
  background: rgba(238,38,36,.04);
}

.location-item:last-child {
  border-bottom: none;
}

/* ✅ Checkbox visual - columna 1 */
.location-item .loc-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(15,23,42,.25);
  border-radius: 5px;
  background: #fff;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.location-item .loc-checkbox::after {
  content: "";
  width: 6px;
  height: 10px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ✅ Contenedor de texto + icono - columna 2 */
.location-item .loc-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

/* ✅ Icono de ubicación */
.location-item .loc-icon {
  color: var(--arx-muted);
  font-size: 14px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

/* ✅ Texto de ubicación */
.location-item .loc-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--arx-ink);
  font-weight: 500;
}

/* =========================================================
   ✅ ESTADO SELECCIONADO - MÁS VISIBLE
   ========================================================= */
.location-item.is-selected {
  background: rgba(238,38,36,.08) !important;
}

.location-item.is-selected .loc-checkbox {
  background: var(--arx-brand);
  border-color: var(--arx-brand);
  box-shadow: 0 0 0 3px rgba(238,38,36,.15);
}

.location-item.is-selected .loc-checkbox::after {
  opacity: 1;
}

.location-item.is-selected .loc-text {
  color: var(--arx-brand);
  font-weight: 700;
}

.location-item.is-selected .loc-icon {
  color: var(--arx-brand);
}

/* Mensaje buscando */
.location-searching {
  padding: 16px;
  text-align: center;
  color: var(--arx-muted);
  font-size: 14px;
}

/* Sin resultados */
.location-item.location-no-results {
  color: var(--arx-muted);
  font-style: italic;
  cursor: default !important;
  padding: 16px !important;
  display: block !important;
  text-align: center;
}

.location-item.location-no-results:hover {
  background: transparent !important;
}

/* Footer con botón aplicar */
.location-footer {
  position: sticky;
  bottom: 0;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 -4px 12px rgba(15,23,42,.06);
}

.btn-apply-locations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--arx-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apply-locations:hover {
  background: #d42220;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(238,38,36,.25);
}

/* =========================================================
   DROPDOWN TIPOS
   ========================================================= */
#types-properties{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 280px;
  max-width: min(420px, 92vw);
  padding: 8px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  background: #fff !important;
  box-shadow: 0 18px 46px rgba(15,23,42,.18) !important;
  z-index: 99999 !important;
  display: none;
  max-height: 360px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* Cuando está abierto via clase */
#types-properties.is-open {
  display: block !important;
}

#types-properties br{ display:none !important; }

/* Scrollbar */
#types-properties::-webkit-scrollbar,
#location-results::-webkit-scrollbar,
.location-items-list::-webkit-scrollbar{ width: 6px; }

#types-properties::-webkit-scrollbar-track,
#location-results::-webkit-scrollbar-track,
.location-items-list::-webkit-scrollbar-track{ background: transparent; }

#types-properties::-webkit-scrollbar-thumb,
#location-results::-webkit-scrollbar-thumb,
.location-items-list::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.18);
  border-radius: 999px;
}

#types-properties,
#location-results,
.location-items-list{
  scrollbar-width: thin;
  scrollbar-color: rgba(15,23,42,.18) transparent;
}

/* Checkboxes ocultos */
#types-properties input[type="checkbox"]{
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  pointer-events: none !important;
}

/* Labels de tipos */
#types-properties label{
  position: relative !important;
  display:flex !important;
  align-items:center !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 10px 12px 10px 42px !important;
  margin: 0 0 4px 0 !important;
  border-radius: 10px !important;
  color: rgba(17,24,39,.88) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, transform .12s ease;
}

#types-properties label:hover{
  background: rgba(17,24,39,.04);
  transform: translateY(-1px);
}

/* Checkbox custom */
#types-properties label::before{
  content:"";
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(15,23,42,.25);
  background: #fff;
  box-shadow: 0 0 0 0 rgba(238,38,36,0);
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

#types-properties label::after{
  content:"";
  position:absolute;
  left: 20px;
  top: 50%;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translate(-50%,-55%) rotate(45deg);
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events:none;
}

/* Estados checked */
#types-properties input[type="checkbox"]:checked + label{
  background: rgba(238,38,36,.06) !important;
}

#types-properties input[type="checkbox"]:checked + label::before{
  background: var(--arx-brand);
  border-color: rgba(238,38,36,.75);
  box-shadow: 0 0 0 3px rgba(238,38,36,.12);
}

#types-properties input[type="checkbox"]:checked + label::after{ opacity: 1; }

/* Select All sticky */
#types-properties label[for="select-all"]{
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 14px rgba(15,23,42,.08);
  border: 1px solid rgba(15,23,42,.06);
}

#types-properties label[for="select-all"]:hover{
  transform: none;
  background: rgba(17,24,39,.03) !important;
}

/* =========================================================
   PORTAL: DROPDOWNS EN EL BODY (posición fija)
   ========================================================= */
body > #types-properties,
body > #location-results,
.arx-dd-portal,
.arx-dd-desktop {
  position: fixed !important;
  z-index: 999999 !important;
  background: #fff !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 22px 50px rgba(15,23,42,.22) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

body > #types-properties.is-open {
  padding: 8px !important;
  display: block !important;
}

body > #location-results {
  padding: 0 !important;
  overflow: hidden !important;
}

body > #location-results .location-items-list {
  max-height: calc(100% - 56px);
  overflow-y: auto;
}

/* Labels en portal */
body > #types-properties label {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 10px 12px 10px 42px !important;
  margin: 0 0 4px 0 !important;
  border-radius: 10px !important;
  color: rgba(17,24,39,0.88) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, transform 0.12s ease;
}

body > #types-properties label:hover {
  background: rgba(17,24,39,0.04);
  transform: translateY(-1px);
}

body > #types-properties label::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(15,23,42,0.25);
  background: #fff;
  transition: background 0.12s ease, border-color 0.12s ease;
}

body > #types-properties label::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translate(-50%,-55%) rotate(45deg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

body > #types-properties input[type="checkbox"]:checked + label {
  background: rgba(238,38,36,0.06) !important;
}

body > #types-properties input[type="checkbox"]:checked + label::before {
  background: #EE2624;
  border-color: rgba(238,38,36,0.75);
}

body > #types-properties input[type="checkbox"]:checked + label::after {
  opacity: 1;
}

body > #types-properties label[for="select-all"] {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 14px rgba(15,23,42,0.08);
  border: 1px solid rgba(15,23,42,0.06);
}

body > #types-properties input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  pointer-events: none !important;
}

body > #types-properties br {
  display: none !important;
}

/* ✅ Items de ubicación en portal - LAYOUT GRID */
body > #location-results .location-item,
#location-results.arx-dd-portal .location-item {
  display: grid !important;
  grid-template-columns: 28px 1fr !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  cursor: pointer;
  border-bottom: 1px solid rgba(15,23,42,.06);
  font-size: 14px;
  transition: background 0.15s ease;
  background: #fff;
}

body > #location-results .location-item:hover,
#location-results.arx-dd-portal .location-item:hover {
  background: rgba(238,38,36,.04);
}

body > #location-results .location-item:last-child,
#location-results.arx-dd-portal .location-item:last-child {
  border-bottom: none;
}

/* Checkbox en portal */
body > #location-results .loc-checkbox,
#location-results.arx-dd-portal .loc-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(15,23,42,.25);
  border-radius: 5px;
  background: #fff;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body > #location-results .loc-checkbox::after,
#location-results.arx-dd-portal .loc-checkbox::after {
  content: "";
  width: 6px;
  height: 10px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Estado seleccionado en portal */
body > #location-results .location-item.is-selected,
#location-results.arx-dd-portal .location-item.is-selected {
  background: rgba(238,38,36,.08) !important;
}

body > #location-results .location-item.is-selected .loc-checkbox,
#location-results.arx-dd-portal .location-item.is-selected .loc-checkbox {
  background: var(--arx-brand);
  border-color: var(--arx-brand);
  box-shadow: 0 0 0 3px rgba(238,38,36,.15);
}

body > #location-results .location-item.is-selected .loc-checkbox::after,
#location-results.arx-dd-portal .location-item.is-selected .loc-checkbox::after {
  opacity: 1;
}

body > #location-results .location-item.is-selected .loc-text,
#location-results.arx-dd-portal .location-item.is-selected .loc-text {
  color: var(--arx-brand);
  font-weight: 700;
}

body > #location-results .location-item.is-selected .loc-icon,
#location-results.arx-dd-portal .location-item.is-selected .loc-icon {
  color: var(--arx-brand);
}

/* Contenido en portal */
body > #location-results .loc-content,
#location-results.arx-dd-portal .loc-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}

body > #location-results .loc-icon,
#location-results.arx-dd-portal .loc-icon {
  color: var(--arx-muted);
  font-size: 14px;
  flex-shrink: 0;
  width: 16px;
}

body > #location-results .loc-text,
#location-results.arx-dd-portal .loc-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--arx-ink);
  font-weight: 500;
}

/* Footer en portal */
body > #location-results .location-footer,
#location-results.arx-dd-portal .location-footer {
  position: sticky;
  bottom: 0;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 -4px 12px rgba(15,23,42,.06);
}

body > #location-results .btn-apply-locations,
#location-results.arx-dd-portal .btn-apply-locations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--arx-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

body > #location-results .btn-apply-locations:hover,
#location-results.arx-dd-portal .btn-apply-locations:hover {
  background: #d42220;
}

/* =========================================================
   TOGGLE FILA INFERIOR
   ========================================================= */
.toggle-search-mode{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
}

.toggle-search-mode > div{
  display:flex;
  align-items:center;
  gap: 10px;
}

.toggle-label{ font-size: 13px; color: #000; }

.advanced-search{
  text-decoration:none;
  color: rgba(17,24,39,.55);
  font-weight: 700;
}
.advanced-search:hover{ color: rgba(17,24,39,.85); }

/* Switch */
.switch{
  position:relative;
  display:inline-block;
  width:32px;
  height:18px;
}

.switch input{
  opacity:0;
  width:0;
  height:0;
}

.switch > .slidercheck{
  position:absolute;
  cursor:pointer;
  inset:0;
  background:#ffffff;
  border-radius:999px;
  transition:.25s;
}

.switch input[type="checkbox"] + .slidercheck::before{
  content:"";
  width:14px;
  height:14px;
  background:#fff;
  position:absolute;
  top:2px;
  left:2px;
  border-radius:50%;
  transition:.25s;
}

.switch input:checked + .slidercheck{ background: var(--arx-brand); }
.switch input:checked + .slidercheck::before{ transform: translateX(14px); }

/* =========================================================
   POPULARES (oculto)
   ========================================================= */
.popular-searches{ display:none !important; }

/* =========================================================
   BUSCAR POR CÓDIGO
   ========================================================= */
#search-by-code-form{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  position: relative;
}

@media(min-width:992px){
  #search-by-code-form{ 
    grid-template-columns: 5fr 1.2fr;
    align-items: end;
  }
}

@media(max-width:991px){
  .search-grid,
  #search-by-code-form {
    min-height: 220px;
  }
  
  #search-by-code-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 10px 0;
  }
}

#property-code{ text-transform: uppercase; }

#property-code.loading-border{
  border-bottom: 1px solid var(--arx-brand);
  border-top: 1px solid var(--arx-brand);
  animation: pulseBorder 0.5s infinite ease-in-out;
}

@keyframes pulseBorder{
  0%   { border-bottom-color: var(--arx-brand); border-top-color: #8a0200; }
  50%  { border-bottom-color: #e96b69; border-top-color: #e96b69; }
  100% { border-bottom-color: #8a0200; border-top-color: var(--arx-brand); }
}

#search-code-button.loading{ opacity:.6; cursor:not-allowed; }

#snackbarSearch{
  visibility:hidden;
  min-width:300px;
  background: var(--arx-brand);
  color:#fff;
  text-align:center;
  border-radius:12px;
  padding: 3px 18px;
  position:absolute;
  z-index:9999;
  left:50%;
  bottom:-40px;
  transform: translateX(-50%);
}

#snackbarSearch.show{
  visibility:visible;
  animation: fadein .5s, fadeout .5s 2.5s;
}

@keyframes fadein{ from{bottom:0; opacity:0;} to{bottom:-40px; opacity:1;} }
@keyframes fadeout{ from{bottom:-40px; opacity:1;} to{bottom:0; opacity:0;} }

/* =========================================================
   FIX: SECCIONES SIGUIENTES
   ========================================================= */
.search-mod.arx-hero + *,
.search-mod.arx-hero ~ section,
.search-mod.arx-hero ~ .destacados-home,
.search-mod.arx-hero ~ .widget_es-listings,
.destacados-home,
.tt-sect,
section.intro-sect,
.buscar-ciudad-home,
.mod-inmuebles-colombia {
  position: relative !important;
  z-index: 1 !important;
}

/* =========================================================
   RESPONSIVE - MÓVIL
   ========================================================= */
@media(max-width:900px){
  .search-home-container{ padding: 0 16px; }

  .search-home-container > .search-titles{
    padding: 0;
    max-width: 92%;
    text-align: left !important;
  }

  .search-mod.arx-hero.js-arx-hero{
    padding: 64px 0 72px;
    min-height: 520px !important;
    overflow: visible !important;
  }

  /* =========================================================
     ✅ FIX: IMAGEN HERO EN MÓVIL - MOSTRAR EDIFICIOS
     Valores: 50%=centro, 65%=más edificios, 75%=máximo edificios
     ========================================================= */
  .js-arx-hero .arx-hero__bg,
  .js-arx-hero .arx-hero__bg--a,
  .js-arx-hero .arx-hero__bg--b,
  .search-mod.arx-hero .arx-hero__bg,
  .search-mod.arx-hero.js-arx-hero .arx-hero__bg,
  .search-mod.arx-hero.js-arx-hero .arx-hero__bg--a,
  .search-mod.arx-hero.js-arx-hero .arx-hero__bg--b,
  [class*="arx-hero"] .arx-hero__bg,
  [class*="arx-hero"] [class*="arx-hero__bg"] {
    background-position: 78% center !important;
  }

  .search-home-container .hero-chip{ font-size: 18px !important; }
  .search-home-container .hero-subline{ font-size: 14px !important; }

  /* Portal en móvil - z-index máximo */
  .arx-dd-portal{
    z-index: 2147483647 !important;
  }
  
  /* =========================================================
     iOS ESPECÍFICO - Sin portal, position absolute
     ========================================================= */
  #location-results.arx-dd-ios,
  #types-properties.arx-dd-ios {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: #fff !important;
    border: 1px solid rgba(15,23,42,.12) !important;
    border-radius: 14px !important;
    box-shadow: 0 22px 46px rgba(15,23,42,.22) !important;
    z-index: 999999 !important;
  }
  
  /* Types en iOS necesita display block cuando tiene is-open */
  #types-properties.arx-dd-ios.is-open {
    display: block !important;
  }
  
  #location-results.arx-dd-ios .location-items-list {
    max-height: 240px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* TIPOS en móvil - solo aplica estilos visuales cuando está abierto */
  #types-properties.is-open,
  #types-properties.arx-dd-portal.is-open,
  body > #types-properties.is-open {
    display: block !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 22px 46px rgba(15,23,42,.18) !important;
  }

  /* Ubicación en móvil - estilos robustos */
  #location-results.arx-dd-portal,
  body > #location-results,
  #location-results {
    max-height: 340px !important;
    overflow: hidden !important;
    background: #fff !important;
    border: 1px solid rgba(15,23,42,.12) !important;
    border-radius: 14px !important;
    box-shadow: 0 22px 46px rgba(15,23,42,.18) !important;
    z-index: 999999 !important;
  }

  body > #location-results .location-items-list,
  #location-results.arx-dd-portal .location-items-list,
  #location-results .location-items-list {
    max-height: 280px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background: #fff !important;
  }

  /* ✅ Items en móvil - grid corregido (estilos robustos) */
  body > #location-results .location-item,
  #location-results.arx-dd-portal .location-item,
  #location-results .location-item {
    display: grid !important;
    grid-template-columns: 26px 1fr !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 12px !important;
    font-size: 14px !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(15,23,42,.06) !important;
  }
  
  /* ✅ Item seleccionado en móvil */
  #location-results .location-item.is-selected {
    background: rgba(238,38,36,.06) !important;
  }
  
  #location-results .location-item.is-selected .loc-text {
    color: var(--arx-brand) !important;
    font-weight: 600 !important;
  }

  /* Checkbox en móvil */
  body > #location-results .loc-checkbox,
  #location-results.arx-dd-portal .loc-checkbox,
  #location-results .loc-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid rgba(15,23,42,.25) !important;
    border-radius: 4px !important;
    background: #fff !important;
  }
  
  /* Checkbox seleccionado en móvil */
  #location-results .location-item.is-selected .loc-checkbox {
    background: var(--arx-brand) !important;
    border-color: var(--arx-brand) !important;
  }
  
  #location-results .location-item.is-selected .loc-checkbox::after {
    content: '' !important;
    display: block !important;
    width: 5px !important;
    height: 9px !important;
    border: solid #fff !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    position: absolute !important;
    left: 5px !important;
    top: 1px !important;
  }

  /* Badge contador en móvil */
  .location-input-wrapper.has-selections::after {
    right: 10px;
    min-width: 22px;
    height: 22px;
    font-size: 11px;
  }

  /* Labels tipos en móvil */
  body > #types-properties label,
  #types-properties.arx-dd-portal label {
    padding: 10px 12px 10px 40px !important;
    font-size: 14px !important;
    margin: 0 0 4px 0 !important;
  }

  body > #types-properties label::before,
  #types-properties.arx-dd-portal label::before {
    left: 12px !important;
    width: 16px !important;
    height: 16px !important;
  }

  body > #types-properties label::after,
  #types-properties.arx-dd-portal label::after {
    left: 20px !important;
  }

  /* Botón aplicar en móvil */
  body > #location-results .btn-apply-locations,
  #location-results.arx-dd-portal .btn-apply-locations,
  #location-results .btn-apply-locations {
    padding: 11px 14px;
    font-size: 14px;
  }
  
  /* Footer en móvil */
  #location-results .location-footer {
    position: sticky !important;
    bottom: 0 !important;
    padding: 10px 12px !important;
    background: #fff !important;
    border-top: 1px solid rgba(15,23,42,.08) !important;
    box-shadow: 0 -4px 12px rgba(15,23,42,.06) !important;
  }
}

@media(max-width:680px){
  :root{ --card-pad: 14px; }

  .search-home-container{ padding: 0 16px; }
  .search-box{ padding: 16px var(--card-pad) 18px; }

  #types-properties.is-open,
  body > #types-properties.is-open {
    max-height: 300px !important;
  }
  
  #location-results {
    max-height: 320px !important;
  }
  
  /* ✅ FIX imagen en móvil pequeño */
  .js-arx-hero .arx-hero__bg,
  .js-arx-hero .arx-hero__bg--a,
  .js-arx-hero .arx-hero__bg--b {
    background-position: 70% center !important;
  }
}

@media(max-width:480px){
  body > #types-properties.is-open,
  #types-properties.arx-dd-portal.is-open,
  #types-properties.is-open {
    max-height: 280px !important;
  }

  body > #types-properties label,
  #types-properties.arx-dd-portal label,
  #types-properties label {
    padding: 9px 10px 9px 38px !important;
    font-size: 13px !important;
  }

  body > #location-results,
  #location-results.arx-dd-portal,
  #location-results {
    max-height: 280px !important;
  }

  body > #location-results .location-item,
  #location-results.arx-dd-portal .location-item,
  #location-results .location-item {
    padding: 10px !important;
    font-size: 13px !important;
    grid-template-columns: 24px 1fr !important;
    gap: 8px !important;
  }
  
  /* ✅ FIX imagen en móvil muy pequeño */
  .js-arx-hero .arx-hero__bg,
  .js-arx-hero .arx-hero__bg--a,
  .js-arx-hero .arx-hero__bg--b {
    background-position: 70% center !important;
  }
}