.properties-hero {
    padding: 120px 0 60px;
    margin-top: 80px;
    position: relative;
    color: #FFFFFF;
    overflow: hidden;
}

/* Overlay cálido para mejorar legibilidad, similar al Home */
.properties-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(145, 126, 98, 0.30);
    z-index: 1;
    pointer-events: none;
}

/* El contenido del hero debe quedar por encima del overlay */
.properties-hero .container {
    position: relative;
    z-index: 2;
}

/* Tipografía del título del hero en listados, inspirada en Home */
.properties-hero h1 {
    font-size: 3.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    line-height: 1.1;
    color: #FFFFFF;
}

/* Asegurar color y legibilidad del subtítulo (reusa .hero-subtitle global) */
.properties-hero .hero-subtitle {
    color: #FFFFFF;
}

.search-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    margin-bottom: 30px;
    border: 1px solid #f0f0f0;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.property-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.05);
}

.property-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-gold);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 30px);
}

.property-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Hero y contenedores de búsqueda y filtros (migrado desde template) */
.properties-hero {
    padding: 120px 0 60px;
    margin-top: 80px;
    position: relative;
}

.properties-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.search-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.filter-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.property-content { padding: 25px; }
.property-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 10px; color: var(--dark-gray); }
.property-location { color: var(--medium-gray); font-size: 0.9rem; margin-bottom: 15px; display: flex; align-items: center; gap: 5px; }
.property-features { display: flex; gap: 20px; margin-bottom: 15px; font-size: 0.9rem; color: var(--medium-gray); }
.property-features span { display: flex; align-items: center; gap: 5px; }

.sidebar-container { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.featured-property-card { background: white; border-radius: 10px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin-bottom: 30px; }
.featured-property-single { border: 1px solid #e0e0e0; border-radius: 12px; overflow: hidden; background: white; }
.featured-property-image-large { position: relative; height: 200px; overflow: hidden; }
.featured-property-image-large img { width: 100%; height: 100%; object-fit: cover; }
.property-badge { position: absolute; top: 15px; left: 15px; background: var(--primary-gold); color: white; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.featured-property-details { padding: 20px; }
.featured-property-price-large { font-size: 24px; font-weight: 700; color: var(--primary-gold); margin-bottom: 10px; }
.featured-property-title { font-size: 16px; font-weight: 600; color: var(--dark-gray); margin-bottom: 10px; line-height: 1.4; }
.featured-property-location { font-size: 13px; color: var(--medium-gray); margin-bottom: 15px; display: flex; align-items: flex-start; gap: 5px; }
.featured-property-location i { color: var(--primary-gold); margin-top: 2px; flex-shrink: 0; }
.featured-property-features { display: flex; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.featured-property-features span { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--medium-gray); }
.featured-property-features i { color: var(--primary-gold); }
.featured-property-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.property-tag { background: #f0f0f0; color: var(--medium-gray); padding: 4px 10px; border-radius: 15px; font-size: 11px; font-weight: 500; }
.filter-group { margin-bottom: 25px; }
.filter-title { font-size: 1rem; font-weight: 600; margin-bottom: 15px; color: var(--dark-gray); }
.filter-option { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; padding: 5px 0; }
.filter-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-gold); }
.filter-option label { cursor: pointer; font-size: 0.9rem; color: var(--medium-gray); }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 20px 0; border-bottom: 1px solid #f0f0f0; }
.results-count { font-size: 1.1rem; color: var(--dark-gray); }
.sort-dropdown { border: 1px solid #ddd; border-radius: 8px; padding: 8px 15px; background: white; color: var(--dark-gray); }
.items-per-page { display: flex; align-items: center; gap: 8px; }
.items-per-page label { font-size: 14px; color: #666; margin: 0; white-space: nowrap; }
.items-selector { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; background: white; font-size: 14px; color: #333; cursor: pointer; min-width: 120px; }
.items-selector:focus { outline: none; border-color: var(--primary-gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2); }

/* Utilidades para badges y botón sin estilos inline */
.badge-featured { background: #28a745; }
.badge-right { left: auto; right: 15px; }
.btn-details { color: #FFFF; background: rgba(145, 126, 98, 0.92); }

.property-content {
    padding: 25px;
}

.property-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.property-location {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-features {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.property-features span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Sidebar Container */
.sidebar-container {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.featured-property-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.featured-property-single {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.featured-property-image-large {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.featured-property-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-gold);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 30px);
}

.featured-property-details {
    padding: 20px;
}

.featured-property-price-large {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 10px;
}

.featured-property-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 10px;
    line-height: 1.4;
}

.featured-property-location {
    font-size: 13px;
    color: var(--medium-gray);
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.featured-property-location i {
    color: var(--primary-gold);
    margin-top: 2px;
    flex-shrink: 0;
}

.featured-property-features {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.featured-property-features span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--medium-gray);
}

.featured-property-features i {
    color: var(--primary-gold);
}

.featured-property-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.property-tag {
    background: #f0f0f0;
    color: var(--medium-gray);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 5px 0;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-gold);
}

.filter-option label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.results-count {
    font-size: 1.1rem;
    color: var(--dark-gray);
}

.sort-dropdown {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 15px;
    background: white;
    color: var(--dark-gray);
}


.items-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .items-per-page label {
        font-size: 14px;
        color: #666;
        margin: 0;
        white-space: nowrap;
    }

    .items-selector {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: white;
        font-size: 14px;
        color: #333;
        cursor: pointer;
        min-width: 120px;
    }

.items-selector:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* =============================================
   Ajustes móviles para listados (Propiedades/Desarrollos)
   Inspirados en la lógica aplicada en Home
   Breakpoint: max-width: 768px
   ============================================= */
@media (max-width: 768px) {
  /* Cards: mantener proporciones y mejorar lectura */
  .property-card { box-shadow: var(--shadow-md); border-radius: 12px; }
  .property-card:hover { transform: none; box-shadow: var(--shadow-md); }
  .property-image { height: 220px; }
  .property-price { font-size: 1rem; padding: 6px 12px; border-radius: 8px; }

  /* Contenido y features en horizontal con wrap */
  .property-content { padding: 16px; }
  .property-title { font-size: 1.05rem; line-height: 1.25; }
  .property-location { font-size: 0.85rem; }
  .property-features { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 12px; }
  .property-card .property-features { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px 16px; }
  .property-features span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; }
  .property-features i { color: var(--primary-gold); font-size: 1rem; }

  /* Header de resultados y filtros de ordenamiento */
  .results-header { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 0; border-bottom: none; }
  .results-count { font-size: 1rem; }
  .items-per-page { width: 100%; justify-content: space-between; }
  .items-selector { width: 100%; min-width: 0; }
  .sort-dropdown { width: 100%; }
  .results-header .d-flex { width: 100%; flex-wrap: wrap; gap: 12px; }

  /* Sección de búsqueda: mantener carta blanca consistente */
  .search-section {
      padding: 20px;
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.08);
      margin-top: 0; /* evitar que se “meta” debajo del hero y se vea cortado en mobile */
  }
}

/* =============================================
   Mejora de selects / desplegables en buscadores
   para Propiedades y Desarrollos
   ============================================= */
.search-section .form-select {
    min-height: 48px;
    border-radius: 10px;
    font-size: 0.95rem;
    padding-right: 2.5rem; /* espacio para ícono de desplegable en móviles */
}

@media (max-width: 768px) {
    .search-section form .col-md-3,
    .search-section form .col-md-2,
    .search-section form .col-md-1 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .search-section .btn {
        width: 100%;
    }
}

/* Dropdown con checkboxes para barrios */
.neighborhood-dropdown {
  position: relative;
  width: 100%;
  z-index: 1000;
}

/* Asegurar que los contenedores no corten el dropdown */
.search-section,
.search-section form,
.search-section form .row,
.search-section form .col-md-3 {
  overflow: visible !important;
}

.neighborhood-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border: 2px solid var(--light-gray, #E5E5E5);
  border-radius: 8px;
  background: white;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 768px) {
  .neighborhood-dropdown-toggle {
    font-size: 16px; /* Previene zoom automático en iOS */
    padding: 14px 16px;
    min-height: 44px;
  }
}

.neighborhood-dropdown-toggle:hover {
  border-color: var(--primary-gold, #D4AF37);
}

.neighborhood-dropdown-toggle:focus {
  outline: none;
  border-color: var(--primary-gold, #D4AF37);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.neighborhood-dropdown-toggle[aria-expanded="true"] {
  border-color: var(--primary-gold, #D4AF37);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.neighborhood-dropdown-toggle[aria-expanded="true"] .fas.fa-chevron-down {
  transform: rotate(180deg);
}

.neighborhood-selected-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

.neighborhood-selected-text:empty::before {
  content: "Barrio";
  color: #999;
}

.neighborhood-dropdown-toggle .fas {
  margin-left: 10px;
  transition: transform 0.3s ease;
  color: #666;
  flex-shrink: 0;
}

.neighborhood-dropdown-menu {
  position: absolute !important;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-gold, #D4AF37);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10001 !important;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 2px;
  pointer-events: auto !important;
}

.neighborhood-dropdown-menu.show {
  display: block;
}

/* Contenedor de búsqueda */
.neighborhood-search-container {
  position: relative;
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  background: white;
  z-index: 1;
}

.neighborhood-search-input {
  width: 100%;
  padding: 10px 35px 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #333;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.neighborhood-search-input:focus {
  outline: none;
  border-color: var(--primary-gold, #D4AF37);
  background: white;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.neighborhood-search-icon {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 0.85rem;
  pointer-events: none;
}

/* Items de checkbox */
.neighborhood-checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  min-height: 44px; /* Área táctil mínima en mobile */
}

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

.neighborhood-checkbox-item:hover {
  background-color: #f8f8f8;
}

/* En mobile, hacer que todo el item sea clickeable */
@media (max-width: 768px) {
  .neighborhood-checkbox-item {
    padding: 14px 16px;
    min-height: 48px;
  }
}

.neighborhood-checkbox {
  margin: 0;
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  border: 2px solid #ddd;
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .neighborhood-checkbox {
    width: 20px;
    height: 20px;
  }
}

.neighborhood-checkbox:checked {
  background-color: var(--primary-gold, #D4AF37);
  border-color: var(--primary-gold, #D4AF37);
}

.neighborhood-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (max-width: 768px) {
  .neighborhood-checkbox:checked::after {
    left: 5px;
    top: 1px;
    width: 6px;
    height: 12px;
  }
}

.neighborhood-checkbox-label {
  flex: 1;
  cursor: pointer;
  user-select: none;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .neighborhood-checkbox-label {
    font-size: 16px; /* Previene zoom automático en iOS */
    /* En mobile, el texto completo es clickeable */
    width: 100%;
    display: block;
  }
}

/* Ocultar el input hidden */
.neighborhood-dropdown input[type="hidden"] {
  display: none;
}

/* Cerrar dropdown al hacer click fuera */
.neighborhood-dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  display: none;
  background: transparent;
  pointer-events: auto;
}

.neighborhood-dropdown-backdrop.show {
  display: block;
}