* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden; /* SIN padding-top aquí */
}

/* Contenedor principal - IGUAL QUE INDEX */
.main-container {
  width: 100vw;
  min-height: 100vh;
  background: none;
  background-attachment: fixed;
  position: relative;
}

/* NAVBAR FIJO - COPIADO DEL INDEX */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* background: rgba(251,202,10,0.95);  */
  background:rgba(251,202,10,0.7);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 0 20px;
  transition: all 0.3s ease;
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0; /* Igual que index */
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 80px; /* Ajustado para propiedades */
  width: auto;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.1);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links li a {
  text-decoration: none;
  color: #333; /* Color oscuro para fondo amarillo */
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links li a:hover {
  color: #555;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: #666;
  transition: width 0.3s ease;
}

.nav-links li a:hover::after {
  width: 100%;
}

/* Hamburger menu - IGUAL QUE INDEX */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #333;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section CON FILTROS INTEGRADOS */
.page-hero {
  min-height: 500px;
  background: linear-gradient(135deg, #6c757d 0%, #343a40 100%);
  padding: 120px 0 60px;
  text-align: center;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.page-hero h1 {
  font-family: 'Archivo', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-top: 30px;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 40px auto; /* Agregué margin-bottom para separar del filtro */
}

/* Filters Section DENTRO DEL HERO */
.page-hero .filters-section {
  display: flex;
  margin: 30px auto 0; /* Espaciado desde el párrafo */
  width: min(90%, 1000px);
  border-radius: 25px;
  padding: 4px;
  background: linear-gradient(45deg, #fbca0a, #f57f17, #fbca0a);
  background-size: 200% 200%;
  animation: gradientShift 3s ease-in-out infinite;
}

.filters-container {
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #adb5bd 0%, #868e96 100%);
  border-radius: 21px;
  width: 100%;
}

.filter-group {
  font-family: 'Archivo', serif;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 150px;
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
}

.filter-input {
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.3s ease;
  width: 100%;
}

.filter-input:focus {
  outline: none;
  border-color: #fbca0a;
  box-shadow: 0 0 0 3px rgba(251, 202, 10, 0.2);
}

.results-count {
  margin-left: auto;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Properties Section */
.properties-section {
  padding: 60px 0;
  background: #f8f9fa;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  color: #333;
  margin-bottom: 15px;
  font-family: 'Archivo', serif;
}

.section-subtitle {
  color: #666;
  font-size: 1.1rem;
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.property-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.property-image {
  height: 250px;
  background: linear-gradient(135deg, rgba(62,62,62,1) 0%, rgba(90,90,90,1) 100%);
  position: relative;
  overflow: hidden;
}

.property-image::after {
  content: '🏠';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  color: white;
  opacity: 0.7;
}

/* Estilos para imágenes de Cloudinary */
.property-image-carousel,
.property-image-single {
  height: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.property-image-carousel img,
.property-image-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.property-image-carousel:hover img,
.property-image-single:hover img {
  transform: scale(1.05);
}

.image-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 20px 15px 15px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.property-image-carousel:hover .image-overlay,
.property-image-single:hover .image-overlay {
  transform: translateY(0);
}

.image-overlay span {
  font-weight: 500;
  font-size: 0.9rem;
}

.property-image-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #6c757d;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.7;
}

.placeholder-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.property-info {
  padding: 25px;
}

.property-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  line-height: 1.3;
}

.property-price {
  font-size: 1.8rem;
  font-weight: bold;
  color: #fbca0a;
  margin-bottom: 10px;
}

.property-location {
  color: #666;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.property-description {
  color: #777;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-features {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.feature-tag {
  background: linear-gradient(45deg, #f0f2ff, #e8f5e8);
  color: rgba(252,201,11,255);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.property-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.property-type {
  background: #fbca0a;
  color: #333;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.contact-btn {
  background: linear-gradient(135deg, rgba(62,62,62,1) 0%, rgba(90,90,90,1) 100%);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* MODAL DE IMÁGENES - CORREGIDO */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000; /* Z-index más alto */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85); /* Fondo más oscuro */
  cursor: pointer;
  z-index: 10001; /* Detrás del contenido */
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  z-index: 10002; /* Por encima del backdrop */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.3rem;
}

.image-counter-modal {
  background: #fbca0a;
  color: #333;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-modal:hover {
  background: #e9ecef;
  color: #333;
}

.image-carousel {
  position: relative;
  display: flex;
  align-items: center;
}

.image-container {
  position: relative;
  width: 80vw;
  max-width: 1000px;
  height: 70vh;
  max-height: 600px;
  overflow: hidden;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8f9fa;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-container img.active {
  opacity: 1;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10003; /* Por encima de todo */
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

/* Estados de carga */
.loading, .no-properties, .error-message {
  text-align: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.loading {
  color: #666;
  font-size: 1.2rem;
}

.loading::before {
  content: '⏳';
  display: block;
  font-size: 3rem;
  margin-bottom: 15px;
}

.no-properties {
  color: #999;
}

.no-properties::before {
  content: '🏠';
  display: block;
  font-size: 4rem;
  margin-bottom: 20px;
}

.error-message {
  color: #d32f2f;
  background: #ffebee;
  border-radius: 10px;
}

/* Footer básico */
.footer {
  background: #333;
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 15px;
  color: #fbca0a;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #555;
  color: #ccc;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE - COPIADO DEL INDEX.HTML */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  
  .nav-links {
    position: absolute; /* CLAVE: absolute, NO fixed */
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(251,202,10,0.98); /* Fondo amarillo */
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-links li {
    margin: 10px 0;
  }
  
  .nav-links li a {
    font-size: 1.2rem;
  }
  
  /* Hero móvil */
  .page-hero {
    min-height: 700px;
    padding: 120px 0 100px; /* Más padding para compensar navbar */
  }
  
  .page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 25px;
  }
  
  .page-hero p {
    font-size: 1.1rem;
    margin-bottom: 50px;
    padding: 0 10px;
  }
  
  /* Filtros móviles */
  .page-hero .filters-section {
    width: 95%;
    margin: 40px auto 0;
  }
  
  .filters-container {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 25px 15px;
  }
  
  .filter-group {
    min-width: auto;
  }
  
  .results-count {
    margin-left: 0;
    text-align: center;
    order: -1;
    padding: 10px 0;
  }
  
  /* Properties section móvil */
  .properties-section {
    padding: 100px 0 60px;
    margin-top: 0;
  }
  
  .properties-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }
  
  .property-card {
    margin: 0 auto;
    max-width: 400px;
  }
  
  /* Modal móvil */
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h3 {
    font-size: 1.1rem;
  }
  
  .image-container {
    width: 90vw;
    height: 60vh;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .carousel-btn.prev {
    left: 10px;
  }
  
  .carousel-btn.next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .page-hero h1 {
    font-size: 2rem;
  }
  
  .page-hero {
    min-height: 750px;
    padding: 100px 0 120px;
  }
  
  .page-hero p {
    margin-bottom: 60px;
    padding: 0 15px;
  }
  
  .page-hero .filters-section {
    margin: 50px auto 0;
  }
  
  .filters-container {
    padding: 20px 10px;
  }
  
  .properties-section {
    padding: 120px 0 60px;
  }
  
  .property-info {
    padding: 20px;
  }
  
  .property-title {
    font-size: 1.2rem;
  }
  
  .property-price {
    font-size: 1.5rem;
  }
}

  /* Estilos para el pop-up de propiedad completa */
      .property-popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
      }

      .property-popup-content {
        background: white;
        border-radius: 15px;
        max-width: 90vw;
        max-height: 90vh;
        width: 100%;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
      }

      .property-popup-header {
        position: sticky;
        top: 0;
        background: white;
        padding: 20px 30px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        z-index: 10;
      }

      .property-popup-header h2 {
        margin: 0;
        font-size: 1.5rem;
        color: #333;
      }

      .close-property-popup {
        background: none;
        border: none;
        font-size: 2rem;
        color: #666;
        cursor: pointer;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s ease;
      }

      .close-property-popup:hover {
        background: #f5f5f5;
        color: #333;
      }

      .property-popup-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        padding: 30px;
      }

      .property-popup-images {
        position: relative;
      }

      .property-popup-carousel {
        position: relative;
        border-radius: 10px;
        overflow: hidden;
        background: #f5f5f5;
        aspect-ratio: 16/10;
      }

      .property-popup-carousel img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 0.3s ease;
      }

      .property-popup-carousel img:not(.active) {
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
      }

      .property-popup-carousel img.active {
        opacity: 1;
      }

      .popup-carousel-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        padding: 15px;
        cursor: pointer;
        font-size: 1.2rem;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
      }

      .popup-carousel-btn:hover {
        background: rgba(0, 0, 0, 0.9);
      }

      .popup-carousel-btn.prev {
        left: 15px;
      }

      .popup-carousel-btn.next {
        right: 15px;
      }

      .popup-image-counter {
        position: absolute;
        bottom: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 0.9rem;
      }

      .property-popup-info {
        display: flex;
        flex-direction: column;
        gap: 25px;
      }

      .property-popup-price {
        font-size: 2rem;
        font-weight: bold;
        color: #2c5aa0;
        margin: 0;
      }

      .property-popup-location {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1.1rem;
        color: #666;
      }

      .property-popup-features {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
      }

      .popup-feature-tag {
        background: #f0f8ff;
        color: #2c5aa0;
        padding: 10px 15px;
        border-radius: 25px;
        font-weight: 500;
        border: 2px solid #e1f0ff;
      }

      .property-popup-description {
        line-height: 1.6;
        color: #444;
        font-size: 1rem;
      }

      .property-popup-type {
        background: #2c5aa0;
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-weight: 500;
        display: inline-block;
        width: fit-content;
      }

      .property-popup-contact {
        background: #25d366;
        color: white;
        border: none;
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 10px;
        cursor: pointer;
        font-weight: 500;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: center;
      }

      .property-popup-contact:hover {
        background: #20b954;
        transform: translateY(-2px);
      }

      /* Botón "Ver más" en las cards */
      .see-more-btn {
        background: none;
        border: none;
        color: #2c5aa0;
        cursor: pointer;
        font-weight: 500;
        text-decoration: underline;
        padding: 0;
        margin-top: 5px;
      }

      .see-more-btn:hover {
        color: #1e3f73;
      }

      /* Responsive */
      @media (max-width: 768px) {
        .property-popup-content {
          max-width: 95vw;
          max-height: 95vh;
        }

        .property-popup-body {
          grid-template-columns: 1fr;
          gap: 20px;
          padding: 20px;
        }

        .property-popup-header {
          padding: 15px 20px;
        }

        .property-popup-header h2 {
          font-size: 1.2rem;
        }

        .popup-carousel-btn {
          width: 40px;
          height: 40px;
          font-size: 1rem;
        }
      }