/* ====================================================================
   elg-desktop-filters.css — ADD [2026-08-03] desktop-filters-redesign
   Estilos de la barra + panel "Más filtros" — SOLO DESKTOP.
   Todo scopeado a #desktop-search-form / #elg-morefilters-pop / .elg-price-*
   y envuelto en @media (min-width:801px) para NO afectar mobile.
   Reversión: borrar este archivo + su enqueue en functions.php.
   ==================================================================== */

@media (min-width: 801px) {

  /* ---- barra general ---- */
  #desktop-search-form .advanced-search-v1 > .d-flex { align-items: center; }
  #desktop-search-form .elg-save-search-desktop { margin-left: auto; }

  /* ---- anchos fijos ---- */
  #desktop-search-form .elg-w-status { flex: 0 0 auto; width: 118px; }
  #desktop-search-form .elg-w-beds   { flex: 0 0 auto; width: 132px; }
  #desktop-search-form .elg-w-type   { flex: 0 0 auto; width: 224px; }
  #desktop-search-form .elg-w-status .bootstrap-select,
  #desktop-search-form .elg-w-beds .bootstrap-select,
  #desktop-search-form .elg-w-type .bootstrap-select { width: 100% !important; }
  #desktop-search-form .elg-w-type .filter-option,
  #desktop-search-form .elg-w-type .filter-option-inner,
  #desktop-search-form .elg-w-type .filter-option-inner-inner {
    overflow: visible !important; text-overflow: clip !important; white-space: nowrap;
  }

  /* ---- badge círculo azul (Tipo · N) ---- */
  #desktop-search-form .elg-tipos-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; padding: 0; border-radius: 50%;
    background: #0E92D1; color: #fff; font-size: 12px; font-weight: 600;
    line-height: 1; margin-left: 2px; flex: 0 0 auto;
  }

  /* ---- PRECIO (botón + popover) ---- */
  #desktop-search-form .elg-price-wrap { position: relative; flex: 0 0 auto; max-width: 96px; }
  #desktop-search-form .elg-price-btnbox { position: relative; }
  #desktop-search-form .elg-price-toggle {
    position: relative; display: flex; align-items: center; width: 100%; height: 42.22px;
    background: #fff; border: 1.11px solid #dce0e0; border-radius: 4px;
    padding: 0 28px 0 12px; font-size: 15px; color: #54595f; font-weight: 400;
  }
  #desktop-search-form .elg-price-toggle:after {
    content: ''; position: absolute; right: 12px; top: 50%; width: 0; height: 0; margin-top: -2px;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #999;
  }
  #desktop-search-form .elg-price-toggle:hover,
  #desktop-search-form .elg-price-toggle:focus,
  #desktop-search-form .elg-price-toggle:active {
    background: #fff !important; border-color: #dce0e0 !important; color: #54595f !important; box-shadow: none !important;
  }
  #desktop-search-form .elg-price-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .elg-price-pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 1200; width: 320px;
    background: #fff; border: 1px solid #e6e9ec; border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0,0,0,.14); padding: 22px 18px 18px;
  }
  .elg-price-pop[hidden] { display: none; }
  .elg-price-pop .efm-price-track { position: relative; height: 34px; margin: 4px 4px 30px; }
  .elg-price-pop .efm-rail { position: absolute; top: 15px; left: 0; right: 0; height: 4px; background: #e6e9ec; border-radius: 4px; z-index: 0; pointer-events: none; }
  .elg-price-pop .efm-fill { position: absolute; top: 15px; height: 4px; background: #0E92D1; border-radius: 4px; z-index: 1; pointer-events: none; }
  .elg-price-pop .efm-price-track input[type=range] {
    position: absolute; top: 6px; left: 0; width: 100%; margin: 0; background: none;
    pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px;
  }
  .elg-price-pop #elgd-min { z-index: 3; }
  .elg-price-pop #elgd-max { z-index: 2; }
  .elg-price-pop .efm-price-track input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; pointer-events: auto; position: relative; z-index: 5;
    width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid #0E92D1;
    box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
  }
  .elg-price-pop .efm-price-track input[type=range]::-moz-range-thumb {
    pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: #fff;
    border: 2px solid #0E92D1; box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
  }
  .elg-price-pop .elg-bub {
    position: absolute; top: 26px; transform: none; font-weight: 400; font-size: 12px;
    color: #0E92D1; white-space: nowrap; pointer-events: none;
  }
  .elg-price-pop #elgd-bub-min { left: 0; right: auto; }
  .elg-price-pop #elgd-bub-max { left: auto; right: 0; }
  .elg-price-pop .efm-price-inputs { display: flex; align-items: center; gap: 10px; }
  .elg-price-pop .efm-in {
    flex: 1; min-width: 0; border: 1px solid #dce0e0; border-radius: 8px;
    padding: 9px 10px; font-size: 14px; color: #333; text-align: center;
  }
  .elg-price-pop .efm-in:focus { outline: none; border-color: #0E92D1; }
  .elg-price-pop .efm-dash { color: #9aa2a9; }
  .elg-price-pop .elg-price-apply {
    display: block; width: 100%; margin-top: 14px; background: #F15C61; border: none; color: #fff;
    border-radius: 8px; padding: 11px 0; font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .elg-price-pop .elg-price-apply:hover { background: #d94a4f; }

  /* ---- MÁS FILTROS (botón) ---- */
  #desktop-search-form .elg-morefilters-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
    width: auto !important; height: 42.22px; padding: 0 16px;
    border: 1.11px solid #dce0e0; border-radius: 4px; background: #fff; color: #54595f;
    font-size: 15px; font-weight: 400; transition: color .15s, background .15s, border-color .15s;
  }
  #desktop-search-form .elg-morefilters-btn:hover,
  #desktop-search-form .elg-morefilters-btn:focus,
  #desktop-search-form .elg-morefilters-btn:active,
  #desktop-search-form .elg-morefilters-btn.active,
  #desktop-search-form .elg-morefilters-btn[aria-expanded="true"] {
    background: rgba(14,146,209,.08) !important; border-color: #dce0e0 !important;
    color: #0E92D1 !important; box-shadow: none !important;
  }
  #desktop-search-form .elg-morefilters-btn:hover i,
  #desktop-search-form .elg-morefilters-btn:hover .houzez-icon { color: #0E92D1 !important; }

  /* ---- SEARCH reducido ---- */
  #desktop-search-form .elg-w-search { flex: 0 0 auto; width: auto; }
  #desktop-search-form .elg-w-search .half-map-search-js-btn { width: auto !important; min-width: 0; padding: 0 12px; }

  /* ---- GUARDAR BÚSQUEDA (coral) ---- */
  #desktop-search-form .elg-save-styled {
    display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 42.22px;
    background: #fff !important; border: 1.11px solid #F15C61 !important; color: #F15C61 !important;
    border-radius: 4px; padding: 0 18px; font-size: 15px; font-weight: 500;
  }
  #desktop-search-form .elg-save-styled:hover { background: #F15C61 !important; color: #fff !important; border-color: #F15C61 !important; }
  #desktop-search-form .elg-save-styled i { color: inherit; }

  /* ================= PANEL MÁS FILTROS ================= */
  #elg-morefilters-pop {
    z-index: 1300; background: #fff; border: 1px solid #e6e9ec; border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,.18); padding: 20px 26px;
  }
  #elg-morefilters-pop[hidden] { display: none; }
  #elg-morefilters-pop, #elg-morefilters-pop * { font-family: 'Cerebri', sans-serif; }

  #elg-morefilters-pop .elg-mf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  #elg-morefilters-pop .elg-mf-head h3 { margin: 0; font-size: 19px; font-weight: 600; color: #2a2f34; }
  #elg-morefilters-pop .elg-mf-x { background: none; border: none; font-size: 26px; line-height: 1; color: #9aa2a9; cursor: pointer; padding: 0 4px; }

  /* grilla completa: borde redondeado + líneas internas unidas */
  #elg-morefilters-pop .elg-mf-rows {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border: 1px solid #e6e9ec; border-radius: 12px 12px 0 0; overflow: hidden;
  }
  #elg-morefilters-pop .elg-mf-sec {
    border-right: 1px solid #e6e9ec; border-bottom: 1px solid #e6e9ec;
    padding: 14px 16px; margin: 0; display: flex; flex-direction: column;
  }
  #elg-morefilters-pop .elg-mf-sec:nth-child(2n) { border-right: none; }
  #elg-morefilters-pop .elg-mf-sec:nth-last-child(-n+2) { border-bottom: none; }
  #elg-morefilters-pop .elg-mf-sec label { margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: #2a2f34; }
  #elg-morefilters-pop .elg-mf-sec > .elg-mf-input,
  #elg-morefilters-pop .elg-mf-sec > .elg-mf-pair,
  #elg-morefilters-pop .elg-mf-sec > .elg-seg,
  #elg-morefilters-pop .elg-mf-sec > .elg-switch { margin-top: auto; }

  #elg-morefilters-pop .elg-mf-input {
    width: 100%; height: 40px; border: 1px solid #dce0e0; border-radius: 8px;
    padding: 0 12px; font-size: 14px; color: #333; background: #fff;
  }
  #elg-morefilters-pop .elg-mf-input:focus { outline: none; border-color: #0E92D1; }
  #elg-morefilters-pop .elg-mf-pair { display: flex; gap: 12px; }
  #elg-morefilters-pop .elg-mf-pair .elg-mf-input { flex: 1; min-width: 0; }

  /* segmentado (baños/garaje): pills unidas en una fila */
  #elg-morefilters-pop .elg-seg {
    display: flex; flex-wrap: nowrap; width: 100%; height: 40px;
    border: 1px solid #dce0e0; border-radius: 8px; overflow: hidden;
  }
  #elg-morefilters-pop .elg-seg-btn {
    flex: 1 1 0; display: flex; align-items: center; justify-content: center;
    border: none; border-right: 1px solid #dce0e0; background: #fff; color: #54595f;
    cursor: pointer; font-size: 14px; white-space: nowrap; padding: 0 8px; transition: all .12s;
  }
  #elg-morefilters-pop .elg-seg-btn:last-child { border-right: none; }
  #elg-morefilters-pop .elg-seg-btn:hover { background: #f4f9fc; color: #0E92D1; }
  #elg-morefilters-pop .elg-seg-btn.on { background: #0E92D1; color: #fff; }

  /* toggle precio reducido */
  #elg-morefilters-pop .elg-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 4px; }
  #elg-morefilters-pop .elg-switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
  #elg-morefilters-pop .elg-switch-track {
    position: relative; width: 42px; height: 24px; background: #cfd6db; border-radius: 999px;
    flex: 0 0 auto; transition: background .15s; display: inline-block;
  }
  #elg-morefilters-pop .elg-switch-track:before {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s;
  }
  #elg-morefilters-pop .elg-switch-input:checked + .elg-switch-track { background: #0E92D1; }
  #elg-morefilters-pop .elg-switch-input:checked + .elg-switch-track:before { transform: translateX(18px); }
  #elg-morefilters-pop .elg-switch-txt { font-size: 14px; color: #54595f; line-height: 1.3; }

  /* más características: fila full-width dentro del mismo marco */
  #elg-morefilters-pop .elg-mf-feats {
    border: 1px solid #e6e9ec; border-top: none; border-radius: 0 0 12px 12px;
    margin-top: -1px; padding: 14px 16px;
  }
  #elg-morefilters-pop .elg-mf-feats .features-list-wrap { padding: 0 !important; }
  #elg-morefilters-pop .elg-mf-feats .btn-features-list { font-size: 15px; color: #2a2f34; font-weight: 600; }

  /* footer */
  #elg-morefilters-pop .elg-mf-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 0; }
  #elg-morefilters-pop .elg-mf-clear { color: #F15C61; font-size: 15px; font-weight: 500; text-decoration: none; }
  #elg-morefilters-pop .elg-mf-clear:hover { text-decoration: underline; color: #F15C61; }
  #elg-morefilters-pop .elg-mf-apply {
    background: #F15C61; border: none; color: #fff; border-radius: 8px;
    padding: 11px 26px; font-size: 15px; font-weight: 600; cursor: pointer;
  }
  #elg-morefilters-pop .elg-mf-apply:hover { background: #d94a4f; }


  /* ── esconder botón Search (el disparo va por auto-filter + Aplicar). elg-hide-search ── */
  #desktop-search-form .elg-w-search { display: none !important; }
}
