/* ═══════════════════════════════════════════════════════════════
   Módulo: Listado / Búsqueda — Split View
   ═══════════════════════════════════════════════════════════════ */

/* Quitar footer en esta página */
.propiedades-page footer,
.propiedades-page .footer-bottom { display: none !important; }
.propiedades-page #section-body  { padding: 0 !important; }

/* ── Layout principal ────────────────────────────────────────── */
.prop-search-wrap {
    display: flex;
    height: calc(100vh - 68px);
    overflow: hidden;
    background: #f0f4f8;
}

/* ── Panel izquierdo ─────────────────────────────────────────── */
.prop-list-panel {
    width: 430px;
    min-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
    border-right: 1px solid #dde3ec;
    overflow: hidden;
    z-index: 2;
}

/* ── Barra de filtros ────────────────────────────────────────── */
.prop-filters {
    background: #fff;
    border-bottom: 1px solid #e8edf3;
    padding: 14px 16px 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.filter-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.filter-search-input {
    flex: 1;
    position: relative;
}

.filter-search-input .fa {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bcc5d0;
    font-size: 13px;
    pointer-events: none;
}

.filter-search-input input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid #e0e7ef;
    border-radius: 10px;
    font-size: 13px;
    background: #f8fafc;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    color: #333;
}

.filter-search-input input:focus {
    border-color: #22bef8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34,190,248,.12);
}

.filter-search-input input::placeholder { color: #bcc5d0; }

.filter-go-btn {
    padding: 10px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22bef8, #0ea3d8);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    white-space: nowrap;
    letter-spacing: .3px;
}

.filter-go-btn:hover  { opacity: .9; }
.filter-go-btn:active { transform: scale(.97); }

/* Chips de operación */
.filter-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip-group { display: flex; gap: 4px; }

.chip {
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid #dde3ec;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #778;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}

.chip:hover       { border-color: #22bef8; color: #22bef8; }
.chip.chip-active { background: #22bef8; border-color: #22bef8; color: #fff; box-shadow: 0 2px 8px rgba(34,190,248,.3); }

.filter-select {
    padding: 5px 10px;
    border-radius: 10px;
    border: 1.5px solid #dde3ec;
    background: #fff;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}

.filter-select:focus { border-color: #22bef8; }

/* Cabecera de lista */
.prop-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e8edf3;
    flex-shrink: 0;
}

.prop-count {
    font-size: 12.5px;
    color: #8a96a5;
    font-weight: 500;
}

.map-toggle-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1.5px solid #22bef8;
    color: #22bef8;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: none;
}

/* ── Lista scrollable ────────────────────────────────────────── */
.prop-cards-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ccd4de transparent;
}

.prop-cards-list::-webkit-scrollbar { width: 5px; }
.prop-cards-list::-webkit-scrollbar-thumb { background: #ccd4de; border-radius: 4px; }

/* Estado cargando / vacío */
.list-state {
    text-align: center;
    padding: 50px 20px;
    color: #b0bac7;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.list-state p {
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
    color: #8a96a5;
}

.list-state--empty .fa { opacity: .35; }

/* ── Autocomplete dropdown ───────────────────────────────────── */
.ac-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.06);
    z-index: 9999;
    overflow: hidden;
    max-height: 340px;
    overflow-y: auto;
    animation: acFade .15s ease;
    scrollbar-width: thin;
    scrollbar-color: #dde3ec transparent;
}

@keyframes acFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ac-group-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: #a0adb8;
    padding: 9px 14px 5px;
    background: #f8fafc;
    border-bottom: 1px solid #eef1f5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-group-label .fa { color: #c5cdd8; font-size: 11px; }

.ac-item {
    padding: 8px 14px 8px 22px;
    cursor: pointer;
    font-size: 13px;
    color: #3a4455;
    border-bottom: 1px solid #f5f7fa;
    transition: background .12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

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

.ac-item:hover,
.ac-item.is-active   { background: #f0f9ff; color: #0a2d4d; }

.ac-item-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-item-nombre {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-item-sub {
    font-size: 11px;
    color: #a0adb8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-item-right { flex-shrink: 0; }

.ac-count {
    font-size: 11px;
    font-weight: 600;
    color: #22bef8;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.ac-count--zero {
    color: #a0adb8;
    background: #f5f7fa;
    border-color: #e2e8f0;
}

.ac-match {
    color: #22bef8;
    font-weight: 700;
}

/* Aviso "mostrando X de Y" */
.list-more-hint {
    text-align: center;
    font-size: 11.5px;
    color: #8a96a5;
    background: #f0f4f8;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px dashed #ccd4de;
    line-height: 1.5;
}

.list-more-hint .fa { margin-right: 5px; color: #b0bac7; }

/* ═══════════════════════════════════════════════════════════════
   CARD DE PROPIEDAD
   ═══════════════════════════════════════════════════════════════ */
.search-card {
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.07), 0 0 0 1.5px #eaeff5;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s, transform .15s;
    text-decoration: none !important;
    color: inherit !important;
    min-height: 110px;
}

.search-card:hover,
.search-card.is-highlighted {
    border-color: #22bef8;
    box-shadow: 0 6px 22px rgba(34,190,248,.18), 0 1px 6px rgba(0,0,0,.06);
    transform: translateY(-2px);
    color: inherit !important;
    text-decoration: none !important;
}

/* Imagen */
.sc-img-wrap {
    width: 130px;
    min-height: 110px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #e8edf5;
}

.sc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}

.search-card:hover .sc-img-wrap img { transform: scale(1.05); }

.card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccd4de;
    font-size: 32px;
}

/* Badge Venta/Renta */
.sc-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    pointer-events: none;
}

.sc-badge.op-venta { background: rgba(34,190,248,.92); color: #fff; }
.sc-badge.op-renta { background: rgba(16,185,129,.92);  color: #fff; }

/* Cuerpo */
.sc-body {
    flex: 1;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sc-price {
    font-size: 16px;
    font-weight: 800;
    color: #0a2d4d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.sc-type {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1;
    margin-bottom: 2px;
}

.sc-title {
    font-size: 12.5px;
    color: #4a5568;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.sc-loc {
    font-size: 11px;
    color: #a0adb8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-loc .fa { margin-right: 3px; color: #c5cdd8; }

/* Amenidades */
.sc-amens {
    display: flex;
    gap: 10px;
    font-size: 11.5px;
    color: #6a7685;
    margin-top: auto;
    padding-top: 7px;
    border-top: 1px solid #f0f4f8;
    flex-wrap: wrap;
}

.sc-amens span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sc-amens .fa { color: #b0bac7; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════════
   PANEL DEL MAPA
   ═══════════════════════════════════════════════════════════════ */
.prop-map-panel {
    flex: 1;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

#search-map {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
}

/* ── Leyenda ─────────────────────────────────────────────────── */
.map-legend {
    position: absolute;
    bottom: 30px;
    right: 12px;
    background: rgba(255,255,255,.96);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.14);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 11.5px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.8);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #4a5568;
    font-weight: 500;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

/* ── Markers ─────────────────────────────────────────────────── */
.prop-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,.28);
    border: 2.5px solid rgba(255,255,255,.8);
    transition: transform .15s;
}

.prop-pin-label {
    transform: rotate(45deg);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -.5px;
}

/* Cluster */
.cluster-wrap { background: transparent !important; border: none !important; }

.cluster-bubble {
    border-radius: 50%;
    background: linear-gradient(135deg, #22bef8, #0ea3d8);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(34,190,248,.5);
    display: block;
}

/* ── Popup ───────────────────────────────────────────────────── */
.prop-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    border: none;
}

.prop-popup-wrap .leaflet-popup-content {
    margin: 0;
    width: 230px !important;
}

.prop-popup-wrap .leaflet-popup-tip-container { display: none; }

.prop-popup { width: 230px; }

.popup-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.popup-no-img {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8edf5;
    color: #ccd4de;
    font-size: 36px;
}

.popup-body {
    padding: 10px 12px 12px;
}

.popup-price {
    font-size: 14px;
    font-weight: 800;
    color: #0a2d4d;
    margin-bottom: 2px;
}

.popup-title {
    font-size: 12px;
    color: #555;
    margin-bottom: 5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.popup-amens {
    font-size: 11px;
    color: #888;
    margin-bottom: 8px;
}

.popup-btn {
    display: block;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #22bef8, #0ea3d8);
    color: #fff !important;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: opacity .2s;
}

.popup-btn:hover { opacity: .88; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .prop-search-wrap {
        flex-direction: column;
        height: calc(100vh - 60px);
    }

    .prop-list-panel {
        width: 100%;
        min-width: unset;
        height: 55vh;
        border-right: none;
        border-bottom: 1px solid #dde3ec;
    }

    .prop-map-panel {
        height: 45vh;
        flex: none;
    }

    .prop-map-panel.map-visible {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        height: 100dvh;
        z-index: 1100;
    }

    .map-toggle-btn { display: flex; align-items: center; gap: 5px; }
}
