/* CSS Arreglo para buscador lateral estilo sidebar */
@media (min-width: 768px) {
  #tipoEnv,
  #habitacionesEnv,
  #banosEnv {
    width: 100% !important;
  }

  #tipoEnv {
    margin-bottom: 25px;
  }

  #habitacionesEnv {
    margin-top: 25px;
    margin-bottom: 0;
    /* para que no se aleje baños */
  }

  /* Arreglo Video en Inmuebles y posicionamiento correcto de buscadores */
  .block-content:last-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
    position: relative;
    z-index: 1;
    isolation: isolate;
  }

  .block-content:last-of-type .vc_row {
    margin-top: 0 !important;
  }
}

/* ======================================
    CSS sidebar version mv ACTUALIZACION
  ======================================== */

/* CSS para dispositivos móviles (menores a 768px) */
@media (max-width: 767px) {
  /* Contenedor del formulario */
  .adv1-holder {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  /* Todos los campos del formulario */
  .adv1-holder > div[class*="col-"] {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  /* Párrafos de título */
  .adv1-holder p {
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    text-align: left !important;
  }

  /* Sección de Tamaño */
  .selabajo {
    margin: 0;
    padding: 0;
    width: 100% !important;
  }

  .metrosparcela {
    margin-top: 20px !important;
  }

  /* Checkboxes y opciones adicionales */
  .masopc {
    width: 100% !important;
    padding: 15px 0 !important;
  }

  #EstadoCons {
    width: 100% !important;
    margin-top: 5px;
  }

  /* Buscar Propiedades */
  #advanced_submit_2 {
    width: 100%;
    padding: 0 50px !important;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  #advanced_submit_2 {
    border: 2px solid #f16901 !important;
    background: #f16901 !important;
    color: #fff !important;
    border-radius: 0px !important;
  }

  #advanced_submit_2:hover {
    background: #000 !important;
    border: 2px solid #000 !important;
    color: white !important;
  }

  #advanced_submit_2 {
    font-size: 16px;
    font-weight: 600;
    min-height: 48px;
  }

  /* Campos ocultos permanecen ocultos */
  [style*="display:none"],
  [style*="display: none"] {
    display: none !important;
  }

  /* Ajustes para selectores específicos */
  .selector-buscador-ubicacion {
    width: 100%;
  }

  /* Espaciado general */
  .flagicon,
  .radiostipo {
    margin-bottom: 0 !important;
  }

  /* Fix para sup en móvil */
  sup {
    font-size: 0.7em;
    vertical-align: super;
  }

  /* Mejora de accesibilidad táctil */
  select,
  input,
  button {
    touch-action: manipulation;
  }

  /* Evitar scroll horizontal */
  .adv1-holder {
    overflow-x: hidden;
  }

  /* BOTON 'BUSCAR PROPIEDADES SOBRE MAPA' */
  .gem-button-position-center,
  .thegem-heading {
    display: none;
  }

  /* HAY N RESULTADOS */
  #resultsyorden1 h3 {
    justify-content: center;
  }
  /* ACTUALIZACION: Cambios en version Mv de dispositivo 
           (oculto lo que no sean filtros) para mostrar primero inmuebles 
        -------------------------------------------------------------------- */
  .wpb_wrapper p,
  #resultsyorden,
  #resultsyorden1 h3,
  .operation-buttons .btn-operation {
    display: none;
  }

  .wpb_column:first-of-type .wpb_wrapper p:first-of-type {
    display: none;
  }

  .wpb_column .wpb_wrapper p {
    display: block;
  }

  /* filtro para ordenar por fecha, precio, etc... */
  .operation-buttons #ordenacion {
    /*display:none !important;*/
    margin: 0;
    padding: 0;
    margin-top: -50px !important;
    margin-left: 15px !important;
    border-radius: 33px;
  }

  #toggleFiltros {
    position: fixed;
    bottom: 20px; /* posicionado al lado de la flecha negra */
    right: 20px;
    z-index: 9999;
    padding: 10px;
    background-color: #f16901;
    border: 1px solid #f16901;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  #toggleFiltros:hover {
    background-color: #d85c00;
    transform: scale(1.05);
  }

  /* Asegurar que el contenedor de filtros se muestre sobre todo */
  #contenedorFiltros {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    overflow-y: auto;
    padding: 40px;
    z-index: 9998 !important;
    margin-top: 30px;
  }

  /* Evita que elementos padres oculten los filtros */
  .vc_row,
  .vc_column-inner,
  .thegem-te-heading,
  .wpb_wrapper {
    overflow: visible !important;
  }

  /* flecha negra siempre visible solo para busqueda de inmuebles */
  .scroll-top-button {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 99999 !important;
    display: none !important; /* oculta en busqueda*/
  }
}