/* Contenedor Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  padding: 20px 0;
}
.catalog-section {
  padding: 4rem 1rem;
  background-color: #f9f9f9;
  text-align: center;
}
.section-title {
  position: relative;
  display: inline-block;
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #c08457, #e0c2a4);
}
.section-description {
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: #7f8c8d;
  line-height: 1.6;
  font-style: italic;
}

/* Card de Casa */
.casa-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.casa-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.card-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges (Nuevo y Descuento) */
.badge {
  position: absolute;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}
.badge.descuento {
  background: linear-gradient(135deg, #FF0F7B 0%, #F89B29 100%);
  top: 15px;
  left: 15px;
  padding: 8px 15px;
  font-size: 0.9rem;
  box-shadow: 0 0 15px rgba(255, 15, 123, 0.7);
  animation: pulse 1.5s infinite, neonGlow 2s infinite alternate;
  border: 1px solid #fff;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes neonGlow {
  from { box-shadow: 0 0 10px rgba(255, 15, 123, 0.7); }
  to { box-shadow: 0 0 20px rgba(255, 15, 123, 0.9), 
                 0 0 30px rgba(255, 15, 123, 0.5); }
}
.nuevo-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center; /* Centra verticalmente */
  justify-content: center; /* Centra horizontalmente */
  animation: bounce 1.5s infinite ease-in-out;
  z-index: 3;
}
.estrella-fondo {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FFD700 30%, #FFA500 100%);
  clip-path: polygon(
    50% 0%, 
    61% 35%, 
    98% 35%, 
    68% 57%, 
    79% 91%, 
    50% 70%, 
    21% 91%, 
    32% 57%, 
    2% 35%, 
    39% 35%
  );
}
.nuevo-texto {
  position: relative;
  color: #000;
  font-weight: bold;
  font-size: 0.5rem;
  text-align: center;
  z-index: 2;
  margin-top: 2px; /* Ajuste fino para centrado óptico */
  transform: none; /* Eliminamos la rotación */
  writing-mode: horizontal-tb; /* Aseguramos orientación horizontal */
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Detalles de la Casa */
.card-details {
  padding: 15px;
}
.card-details h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
  color: #333;
}
.card-details .precio {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2c3e50;
  margin: 8px 0;
}
.caracteristicas {
  display: flex;
  justify-content: center; /* Centra horizontalmente */
  align-items: center; /* Centra verticalmente */
  gap: 1rem; /* Espacio entre elementos */
  flex-wrap: wrap; /* Permite que se ajusten en móviles */
  margin-top: 1rem;
  text-align: center; /* Centra el texto */
}
.caracteristicas span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #555;
}
.caracteristicas .bi {
  font-size: 1rem;
  color: #c08457;
}

/* Seccion de Precios*/
.price-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  flex-wrap: wrap;
}
.normal-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #c08457;
}
.original-price {
  font-size: 1rem;
  color: #95a5a6;
  text-decoration: line-through;
}
.discount-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #c08457;
}
.price-separator {
  color: #bdc3c7;
  font-weight: normal;
}
.consultar-price {
  font-style: italic;
  color: #666;
}

/* Paginacion del catalogo */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}
.pagination-button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 40px;
}
.pagination-button:hover:not(:disabled) {
  background: #f0f0f0;
}
.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.page-number {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}
.page-number.active {
  background: #c08457;
  color: white;
  border-color: #c08457;
}
.page-numbers {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.page-numbers button {
  min-width: 40px;
}
.page-numbers button.active {
  background: #c08457;
  color: white;
  border-color: #c08457;
}
.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.page-info-mobile {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #555;
}
.mobile-page-info {
  font-size: 0.9rem;
  color: #555;
  margin: 0 10px;
}

/* Filtros mejorados */
.filters-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.filter-group {
  position: relative;
  min-width: 180px;
}
.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #2c3e50;
  font-weight: 500;
}
.elegant-select {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232c3e50' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}
.elegant-select:focus {
  outline: none;
  border-color: #c08457;
  box-shadow: 0 0 0 2px rgba(192, 132, 87, 0.2);
}
.elegant-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
}
.elegant-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c08457;
  cursor: pointer;
  transition: all 0.2s;
}
.elegant-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(192, 132, 87, 0.3);
}
#price-value {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #2c3e50;
}

/* Checkbox personalizado */
.checkbox-container {
  position: relative;
  display: inline-block;
  margin-top: 0.5rem;
}
.elegant-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.custom-checkbox {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.elegant-checkbox:checked ~ .custom-checkbox {
  background-color: #c08457;
  border-color: #c08457;
}
.custom-checkbox:after {
  content: "";
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.elegant-checkbox:checked ~ .custom-checkbox:after {
  display: block;
}

/* Mensaje sin resultados */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #7f8c8d;
}
.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}
.no-results p {
  margin-bottom: 1.5rem;
}
.reset-filters {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background-color: #c08457;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}
.reset-filters:hover {
  background-color: #a5714a;
  transform: translateY(-2px);
}

/* Badges de filtros activos */
.active-filters {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filter-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  background-color: #e8f4fc;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #2c3e50;
}
.filter-badge button {
  background: none;
  border: none;
  color: #7f8c8d;
  cursor: pointer;
  font-size: 0.9rem;
}
.filter-badge button:hover {
  color: #e74c3c;
}

/* Responsivo del catalogo */
@media (min-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}
/* Para tablets: 2 columnas */
@media (max-width: 1023px) and (min-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Para móviles: 1 columna y máximo 3 casas */
@media (max-width: 767px) {
  .section-title {
    font-size: 2rem;
  }
  .filters-container {
    gap: 1.5rem;
    flex-direction: column;
    align-items: center;
  }
  .filter-group {
    width: 100%;
    max-width: 300px;
  }
  .page-numbers {
    gap: 3px;
  }
  .page-number, .pagination-button {
    padding: 6px 10px;
    font-size: 0.9rem;
    min-width: 30px;
  }
  .page-number:not(.active):not(.dots) {
    display: none;
  }
  .page-number.dots {
    pointer-events: none;
    border: none;
    background: transparent;
  }
  .page-number:not(.active):not(.dots):not(.page-info-mobile) {
    display: none;
  }
  .pagination-controls {
    gap: 5px;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .casa-card:nth-child(n+4) {
    display: none;
  }
  .caracteristicas {
    gap: 0.8rem;
  }
  .caracteristicas span {
    font-size: 0.85rem;
  }
  .original-price {
    font-size: 0.9rem;
  }
  .discount-price, .normal-price {
    font-size: 1.1rem;
  }
}
