/* === Contenedor general del buscador === */
.itemid-102 .property-search-wrapper {
  position: absolute;
  bottom: -76px;
  left: 50%;
  transform: translateX(-50%);
  padding: 25px 30px;
  border-radius: 10px;
  width: 85%;
  max-width: 1100px;
  margin: 0 auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.itemid-104 .property-search-wrapper,
.itemid-107 .property-search-wrapper {
 position: relative;
    transform: unset;
    left: 0;
    max-width: 1320px;
    padding: 0px;
    margin: 30px auto;
    width:100%;
}



/* === Ajuste responsive === */
@media (max-width: 768px) {
  .property-search-wrapper {
    width: 95%;
    bottom: -20px;
    padding: 20px;
  }
}

/* === Pestañas Venta / Alquiler === */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  background: transparent;
}

.tabs .tab {
  background: #e0e0e0;
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 2px 2px 0 0;
}

.tabs .tab.active {
  background: #7D8892;
  color: #fff;
}

.tabs .tab:hover {
  background: #000000;
    color: #fff;
  
}

/* === Formulario de búsqueda === */
.property-search-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  background: #EDEDED;
  padding: 15px 20px;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.11);
  margin-top: -2px;
}

@media (max-width: 1200px) {
  .property-search-form {
    flex-wrap: wrap;
  }
}

/* === Campos individuales del formulario === */
#location-dropdown { flex: 1.2; }
#property-type-dropdown { flex: 0.9; }
#price-dropdown { flex: 1; }
#area-dropdown { flex: 1; }
#bedrooms-dropdown { flex: 1; }
#ref-dropdown { flex: 0.7; }

/* === Dropdowns personalizados === */
.property-dropdown {
  position: relative;
  flex: 1;
  min-width: 150px;
}

.property-dropdown-toggle {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.property-dropdown-toggle:hover {
  border-color: #999;
}

.property-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 350px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 15px 20px;
  z-index: 20;
  animation: fadeIn 0.3s ease;
}

.property-dropdown.open .property-dropdown-menu {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.property-dropdown-menu p.dropdown-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.property-dropdown-menu input[type=text],
.property-dropdown-menu input[type=number] {
  width: 100%;
  padding: 8px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 10px;
}

.price-inputs {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.form-field {
  position: relative;
  flex: 1;
}

.currency {
  position: absolute;
  right: 8px;
  top: 7px;
  color: #777;
}

/* === Tipos de propiedad === */
.property-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
  margin-bottom: 15px;
  padding: 5px;
}

.property-types label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f8f8;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.property-types label:hover {
  background: #e9ecef;
}

.property-types input[type="checkbox"] {
  accent-color: #444;
  transform: scale(1.1);
}

.property-types i {
  color: #444;
  font-size: 16px;
  min-width: 20px;
}

.property-types label span,
.property-types label i {
  pointer-events: none;
}

/* === Dormitorios === */
.bedroom-options {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bedroom-options label {
  cursor: pointer;
  position: relative;
}

.bedroom-options input[type="checkbox"] {
  display: none;
}

.bedroom-options span {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 50%;
  background: #f3f3f3;
  font-weight: 600;
  color: #555;
  transition: all 0.2s ease;
}

.bedroom-options span:hover {
  background: #e0e0e0;
}

.bedroom-options input[type="checkbox"]:checked + span {
  background: #7D8892;
  color: #fff;
  box-shadow: 0 0 6px rgba(0,102,255,0.4);
}

/* === Botones === */
.btn-apply,
.search-btn {
  background: #7D8892;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-apply {
  padding: 8px 14px;
  font-size: 14px;
  margin-top: 10px;
}

.search-btn {
  padding: 0px 0px;
  flex: 0 0 50px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-apply:hover,
.search-btn:hover {
  background: #7D8892;
}

/* === Imagen lupa === */
.property-search-wrapper #lupa {
  width: 25px !important;
  height: 25px !important;
  max-width: none !important;
  display: block;
}

.property-search-wrapper,
.property-search-wrapper * {
    box-sizing: content-box; /* o border-box si prefieres que padding y border se incluyan en ancho/alto */
}

.property-dropdown-toggle i.fa-chevron-down {
    transition: transform 0.3s ease;
    display: inline-block; /* necesario para que gire */
}

/* Cuando el dropdown está abierto, gira 180° */
.property-dropdown.open .property-dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}





@media (max-width: 768px) {

  /* Oculta todo el formulario (dropdowns, botones, lupa) */
  .property-search-form {
    display: none !important;
  }

  /* Mantén las pestañas visibles y hazlas compactas */
  .property-search-wrapper {
    width: 100%;
    left: 0;
    transform: none;
    bottom: 0;
    padding: 8px 10px;
  }

  .tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .tabs .tab {
    padding: 8px;
 
    border-radius: 3%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #7D8892;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    color: #ffffff;
    border: none;
  }

  /* Oculta el texto y deja visible solo el icono */
  .tabs .tab .tab-text {
    display: none;
  }

  /* Asegura que el icono tenga buen tamaño */
  .tabs .tab i,
  .tabs .tab img {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
  }

  /* Indicación visual de cuál está activo (círculo coloreado) */
  .tabs .tab.active {
    background: #7D8892;
    color: #fff;
  }
  /* Override: si el form está dentro del panel móvil, forzamos que se muestre */
.property-search-mobile-panel .property-search-form,
.property-search-mobile-panel__panel .property-search-form {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Asegurar inputs y botones visibles por encima de otros elementos */
.property-search-mobile-panel .property-search-form * {
  z-index: 667744;
  position: relative;
}

}
@media (max-width: 768px) {
  .tabs .tab:hover {
    background: #000000;
  }
  img#lupa {
    width: 9%;
}

}


/* ------------------------
  Opcional: cuando la pantalla es intermedia (<=1200) hacemos que el formulario use varias filas
-------------------------*/
@media (max-width: 1200px) {
  .property-search-form { flex-wrap: wrap; gap: 8px; }
}

.search-btn:hover {
  background: #000000; /* Fondo negro al pasar el ratón */
}

.property-search-wrapper,
.property-search-wrapper * {
    box-sizing: border-box !important;
}













/* BOTÓN móvil y panel (no tocan tu HTML actual en desktop) */
.property-search-mobile-toggle {
  display: none;
  position: fixed;
  right: 8px;
  bottom: 18px;
  z-index: 1500;
  background: #7D8892;
  color: #fff;
  border: none;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* icono dentro del botón */
.property-search-mobile-toggle img { width:18px; height:18px; display:inline-block; vertical-align:middle; }

/* Panel off-canvas creado por JS */
.property-search-mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 1490;
  display: none;
  pointer-events: none;
}
.property-search-mobile-panel.open { display: block; pointer-events: auto; }

.property-search-mobile-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity .22s ease;
}

.property-search-mobile-panel__panel {
  position: absolute;
  top: 15%;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(18%);
  width: 96%;
  max-width: 520px;
  height: 75%;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  overflow: auto;
  transition: transform .26s cubic-bezier(.2,.9,.2,1), opacity .18s;
  opacity: 0;
  padding: 18px;
}

.property-search-mobile-panel.open .property-search-mobile-panel__backdrop { opacity: 1; }
.property-search-mobile-panel.open .property-search-mobile-panel__panel { transform: translateX(-50%) translateY(0); opacity: 1; }

.property-search-mobile-panel__close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* Mostrar toggle solo en pantallas móviles */
@media (max-width: 991px) {
  .property-search-mobile-toggle { display: inline-flex; }
}

/* Evitar mostrar panel en desktop por si acaso */
@media (min-width: 992px) {
  .property-search-mobile-panel { display: none !important; }
}











/* ===== Mostrar el form COMO FORMULARIO sólo cuando esté dentro del panel móvil ===== */
.property-search-mobile-panel .property-search-form,
.property-search-mobile-panel__panel .property-search-form,
.property-search-form.in-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 0 !important; /* el panel ya tiene padding */
  background: transparent !important;
  width: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Forzar los dropdowns a mostrarse como bloques dentro del panel */
.property-search-form.in-panel .property-dropdown,
.property-search-mobile-panel .property-dropdown {
  display: block !important;
  position: static !important;
  width: 100% !important;
}

/* Mostrar obligatoriamente el contenido del dropdown */
.property-search-form.in-panel .property-dropdown .property-dropdown-menu,
.property-search-mobile-panel .property-dropdown .property-dropdown-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 0 8px 0 !important;
}

/* Opcional: ocultar la flecha / chevron porque no hace falta expandir/contraer dentro del panel */
.property-search-form.in-panel .property-dropdown-toggle i,
.property-search-mobile-panel .property-dropdown-toggle i {
  display: none !important;
}

/* Si deseas que el "Cerrar" de cada dropdown no aparezca en versión in-panel */
.property-search-form.in-panel .btn-apply {
  display: none !important;
}

/* Asegurar visibilidad de inputs y botones dentro del panel */
.property-search-mobile-panel .property-search-form input,
.property-search-mobile-panel .property-search-form select,
.property-search-mobile-panel .property-search-form textarea,
.property-search-mobile-panel .property-search-form button {
  position: relative !important;
  z-index: 1700 !important;
}

/* Estética: campos en columna y botón a ancho completo dentro del panel */
.property-search-form.in-panel .property-dropdown,
.property-search-mobile-panel .property-dropdown { padding: 6px 0; }
.property-search-form.in-panel .search-btn,
.property-search-mobile-panel .search-btn {
  width: 100% !important;
  display: flex;
  justify-content: center;
  align-items: center;
}








/* -------------------------
   Estilos para panel móvil:
   títulos en negrita sin recuadro
   y botón "Cerrar" visible y táctil
   ------------------------- */

/* Variables: usa las tuyas si existen; fallback por si falta */
:root{
  --primary-color: #e04a5a;    /* color acento (ejemplo) */
  --muted-bg: #f5f5f5;         /* fondo de campos si quieres */
  --text-color: #222;          /* color texto */
}

/* Cuando el formulario está IN PANEL (off-canvas) */
.property-search-mobile-panel .property-dropdown,
.property-search-form.in-panel .property-dropdown {
  background: transparent !important;    /* quitar recuadros de fondo */
  border: none !important;               /* quitar borde */
  box-shadow: none !important;           /* quitar sombra */
  padding: 8px 0 !important;             /* mantener separación */
}

/* Títulos (el texto "Ubicación", "Tipo", ...) en negrita y sin recuadro.
   Se aplica en versión in-panel y también al .property-dropdown-toggle si se quiere */
.property-search-mobile-panel .property-dropdown-toggle,
.property-search-form.in-panel .property-dropdown-toggle {
  background: transparent !important;
  border: none !important;
  padding: 0 0 6px 0 !important;
}

/* El span que contiene el título */
.property-search-mobile-panel .property-dropdown-toggle > span,
.property-search-form.in-panel .property-dropdown-toggle > span {
  font-weight: 700 !important;       /* negrita */
  color: var(--text-color) !important;
  background: transparent !important; /* quitar recuadro */
  display: block;
  padding: 6px 0;
  margin: 0;
  font-size: 1rem;                   /* ajusta si quieres más grande */
}

/* Subtítulo (ej. "¿Dónde quieres buscar?") */
.property-search-mobile-panel .dropdown-title,
.property-search-form.in-panel .dropdown-title {
  font-weight: 600;
  margin: 6px 0 8px 0;
  color: var(--text-color);
}

/* Campos interiores para seguir con fondo suave (si quieres mantener cajas para inputs) */
.property-search-mobile-panel .property-dropdown .property-dropdown-menu,
.property-search-form.in-panel .property-dropdown .property-dropdown-menu {
  padding: 8px 0 14px 0 !important;
  background: transparent !important;
}

/* Ocultar la flecha/chevron dentro del panel (si ya no procede) */
.property-search-mobile-panel .property-dropdown-toggle i,
.property-search-form.in-panel .property-dropdown-toggle i {
  display: none !important;
}

/* -------------------------
   Botón Cerrar dentro del panel
   (redondo, contrastado, táctil)
   ------------------------- */


/* Hover / focus accesible */
.property-search-mobile-panel__close:hover,
.property-search-mobile-panel__close:focus {
  background: var(--primary-color);
  color: #fff;
  outline: none;
  transform: translateY(-1px);
}

/* Aumentar hit area en móviles (más fácil de tocar) */
@media (max-width: 480px){
  .property-search-mobile-panel__close {
    width: 48px;
    height: 48px;
    right: 10px;
    top: 10px;
    font-size: 22px;
  }
}

/* Pequeños ajustes de espaciado/padding para que el contenido no choque con la X */
.property-search-mobile-panel__panel {
  padding-top: 56px; /* deja espacio para el botón cerrar */
}

/* Mantener inputs visibles y botones a ancho completo dentro del panel */
.property-search-form.in-panel .search-btn,
.property-search-mobile-panel .search-btn {
  width: 100% !important;
  display: flex;
  justify-content: center;
}

body.itemid-102 #property-search-mobile-toggle {
    display: none !important;
}




/* ===== Símbolos dentro de los inputs (precio y superficie) ===== */
.property-search-form .form-field {
  position: relative;
}

/* Aumenta el padding derecho del input para dejar espacio al símbolo */
.property-search-form .form-field input[type="number"],
.property-search-form .form-field input[type="text"] {
  padding-right: 44px; /* ajusta si quieres más/menos espacio */
  box-sizing: border-box;
}

/* Posiciona el símbolo dentro del input, a la derecha, centrado verticalmente */
.property-search-form .form-field .currency {
  position: absolute;
  right: 12px;
  top: 45%;
  transform: translateY(-50%);
  pointer-events: none;       /* no interfiere al clicar */
  color: #666;                /* gris suave, cámbialo por tu color */
  font-size: 0.95rem;
  line-height: 1;
}

/* Si quieres que el símbolo quede ligeramente dentro con fondo claro */
.property-search-form .form-field {
  /* opcional: background o borde diferente si decides */
}

/* Ajustes responsivos (si el input se hace más pequeño en móvil) */
@media (max-width: 480px) {
  .property-search-form .form-field input[type="number"],
  .property-search-form .form-field input[type="text"] {
    padding-right: 48px;
  }
  .property-search-form .form-field .currency {
    right: 10px;
  }
}


@media (max-width: 800px) {
  .property-search-form.in-panel .search-btn, .property-search-mobile-panel .search-btn {
    display: none;
  }
}