/* Sistema de filtros moderno y mobile-friendly */

.filters-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 24px;
  overflow: hidden;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  cursor: pointer;
  user-select: none;
}

.filters-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-toggle {
  font-size: 24px;
  transition: transform 0.3s ease;
}

.filters-toggle.open {
  transform: rotate(180deg);
}

.filters-body {
  padding: 20px;
  display: none;
}

.filters-body.open {
  display: block;
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  margin-bottom: 8px;
}

/* Chips para tipos de bien */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chip:hover {
  border-color: #667eea;
  background: #f3f4f6;
}

.chip.active {
  border-color: #667eea;
  background: #667eea;
  color: #fff;
}

.chip .count {
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.chip.active .count {
  background: rgba(255,255,255,0.2);
}

/* Select personalizado para provincias */
.custom-select {
  position: relative;
}

.custom-select select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.custom-select select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Slider de precios */
.price-slider-container {
  padding: 8px 0;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.price-input-group {
  position: relative;
}

.price-input-group input {
  width: 100%;
  padding: 12px 16px 12px 32px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s ease;
}

.price-input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.price-input-group .currency {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-weight: 600;
}

.price-range-slider {
  position: relative;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  margin: 20px 0;
}

.price-range-progress {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
}

.price-range-input {
  position: relative;
}

.price-range-input input[type="range"] {
  position: absolute;
  width: 100%;
  height: 6px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  top: -20px;
}

.price-range-input input[type="range"]::-webkit-slider-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #667eea;
  pointer-events: auto;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.price-range-input input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #667eea;
  pointer-events: auto;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Botones de acción */
.filters-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-filter {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-filter-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-filter-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-filter-secondary {
  background: #fff;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.btn-filter-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Badge de filtros activos */
.active-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .filters-header {
    padding: 14px 16px;
  }
  
  .filters-header h3 {
    font-size: 16px;
  }
  
  .filters-body {
    padding: 16px;
  }
  
  .filter-section {
    margin-bottom: 20px;
  }
  
  .chips-container {
    gap: 6px;
  }
  
  .chip {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .price-inputs {
    grid-template-columns: 1fr;
  }
  
  .filters-actions {
    flex-direction: column;
  }
}

